FileType (@NotNull String name, @NotNull String extension, @NotNull Disposable parent) { FileType foo = new FakeFileType() { @Override public boolean isMyFileType(@NotNull VirtualFile file) { return file.getName().endsWith("." + extension); } @Override public @NotNull String getName() { return name; } @Override public @NotNull String getDescription() { return name; } }; ((FileTypeManagerImpl)FileTypeManager.getInstance()).registerFileType(foo, List.of(), parent, PluginManagerCore.getPlugin(PluginManagerCore.CORE_ID)); return foo; }