ClassLoader (RemoteCall call) { String pluginId = call.getPluginId(); if (pluginId == null || pluginId.isEmpty()) return getClass().getClassLoader(); if (pluginId.contains("/")) { String mainId = StringsKt.substringBefore(pluginId, "/", pluginId); String moduleId = StringsKt.substringAfter(pluginId, "/", pluginId); IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(PluginId.getId(mainId)); if (plugin == null) throw new IllegalStateException("No such plugin " + mainId); List<PluginContentDescriptor.ModuleItem> modules = ((IdeaPluginDescriptorImpl)plugin).content.modules; for (PluginContentDescriptor.ModuleItem module : modules) { if (Objects.equals(moduleId, module.name)) { return requireNonNull(module.requireDescriptor().getPluginClassLoader()); } } throw new IllegalStateException("No such plugin module " + pluginId); } IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(PluginId.getId(pluginId)); if (plugin == null) throw new IllegalStateException("No such plugin " + pluginId); return plugin.getClassLoader(); }