private void handlePluginRemoved(@NotNull PluginDescriptor pluginDescriptor) {
    if (!myExternalBuildPlugins.contains(pluginDescriptor)) return;

    Map<JpsModuleSourceRootType<?>, JpsModuleSourceRootPropertiesSerializer<?>> removed = new HashMap<>();
    for (JpsModelSerializerExtension extension : loadExtensions(JpsModelSerializerExtension.class)) {
      for (JpsModuleSourceRootPropertiesSerializer<?> serializer : extension.getModuleSourceRootPropertiesSerializers()) {
        removed.put(serializer.getType(), serializer);
      }
    }

    for (JpsModelSerializerExtension extension : loadExtensions(JpsModelSerializerExtension.class, descriptor -> !descriptor.equals(pluginDescriptor))) {
      for (JpsModuleSourceRootPropertiesSerializer<?> serializer : extension.getModuleSourceRootPropertiesSerializers()) {
        removed.remove(serializer.getType());
      }
    }

    if (!removed.isEmpty()) {
      for (Project project : ProjectManager.getInstance().getOpenProjects()) {
        replaceWithUnknownRootType(project, removed.values());
      }
    }
    myExternalBuildPlugins.remove(pluginDescriptor);
    myModificationStamp.incrementAndGet();
    JpsServiceManager jpsServiceManager = JpsServiceManager.getInstance();
    if (jpsServiceManager instanceof JpsServiceManagerImpl) {
      ((JpsServiceManagerImpl)jpsServiceManager).cleanupExtensionCache();
    }
    SourceRootTypeRegistryImpl.getInstance().clearCache();
  }
private void handlePluginRemoved(@NotNull PluginDescriptor pluginDescriptor)