void () { assertInstanceOf(myFileTypeManager.findFileTypeByName(MyHaskellFileType.NAME), AbstractFileType.class); FileTypeBean bean = new FileTypeBean(); bean.name = MyHaskellFileType.NAME; bean.extensions = "hs"; bean.implementationClass = MyHaskellFileType.class.getName(); Disposable disposable = registerFileType(bean, FileTypeManagerImpl.coreIdeaPluginDescriptor()); assertInstanceOf(myFileTypeManager.findFileTypeByName(MyHaskellFileType.NAME), MyHaskellFileType.class); assertInstanceOf(myFileTypeManager.getFileTypeByFileName("foo.hs"), MyHaskellFileType.class); WriteAction.run(() -> Disposer.dispose(disposable)); // todo restore old AbstractFileType automatically? AbstractFileType old = new AbstractFileType(new SyntaxTable()); old.setName(MyHaskellFileType.NAME); myFileTypeManager.registerFileType(old, List.of(), myFileTypeManager, FileTypeManagerImpl.coreIdeaPluginDescriptor()); }