void () { final class MyFileType extends XmlLikeFileType { private MyFileType() { super(XMLLanguage.INSTANCE); } @Override @NotNull public String getName() { return "MY"; } @Override @NotNull public String getDefaultExtension() { return "my"; } @Override @NotNull public String getDescription() { return "my own"; } @Override public Icon getIcon() { return null; } } PsiFile file = PsiFileFactory.getInstance(getProject()).createFileFromText("DummyFile.my", new MyFileType(), "<gggg></gggg>", LocalTimeCounter.currentTime(), true); Document document = Objects.requireNonNull(PsiDocumentManager.getInstance(getProject()).getDocument(file)); assertTrue(document.isWritable()); assertTrue(file.getVirtualFile().getFileType() instanceof MyFileType); assertTrue(DaemonCodeAnalyzer.getInstance(getProject()).isHighlightingAvailable(file)); }