void () { FileTypeManager fileTypeManager = myFileTypeManager; FileType bundled = Objects.requireNonNull(fileTypeManager.findFileTypeByName("Image")); //PluginDescriptor pluginDescriptor = Objects.requireNonNull(PluginManagerCore.getPluginDescriptorOrPlatformByClassName(bundled.getClass().getName())); //assertTrue(pluginDescriptor.isBundled()); //LOG.debug("pluginDescriptor = " + pluginDescriptor); String ext = myFileTypeManager.getAssociations(bundled).get(0).toString().replace("*.", ""); FileTypeBean bean = new FileTypeBean(); bean.name = new MyCustomImageFileType().getName(); bean.extensions = ext; bean.implementationClass = MyCustomImageFileType.class.getName(); bean.setPluginDescriptor(new DefaultPluginDescriptor(PluginId.getId("myTestPlugin"), FileTypeManagerImpl.coreIdeaPluginDescriptor().getPluginClassLoader())); FileTypeBean bean2 = new FileTypeBean(); bean2.name = new MyCustomImageFileType2().getName(); bean2.extensions = ext; bean2.implementationClass = MyCustomImageFileType2.class.getName(); bean2.setPluginDescriptor(new DefaultPluginDescriptor(PluginId.getId("myTestPlugin2"), FileTypeManagerImpl.coreIdeaPluginDescriptor().getPluginClassLoader())); Disposable disposable = Disposer.newDisposable(); Disposer.register(getTestRootDisposable(), disposable); WriteAction.run(() -> { FileTypeManagerImpl.EP_NAME.getPoint().registerExtension(bean, disposable); FileTypeManagerImpl.EP_NAME.getPoint().registerExtension(bean2, disposable); }); assertInstanceOf(fileTypeManager.findFileTypeByName(bean.name), MyCustomImageFileType.class); assertInstanceOf(fileTypeManager.findFileTypeByName(bean2.name), MyCustomImageFileType2.class); assertInstanceOf(fileTypeManager.getFileTypeByExtension(ext), MyCustomImageFileType.class); // either MyCustomImageFileType or MyCustomImageFileType2 WriteAction.run(() -> Disposer.dispose(disposable)); }