mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
DomExtenderEP: request stub index rebuild a bit later
to avoid deadlock in tests because EP listeners are run under a lock, requestRebuild works synchronously and spawns threads inside which wait for the same EP lock GitOrigin-RevId: 5820c596e950409ca1abf79efb36851f0f65bbac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
899483290c
commit
db27a4ba44
@@ -16,6 +16,7 @@
|
||||
package com.intellij.util.xml.reflect;
|
||||
|
||||
import com.intellij.diagnostic.PluginException;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.extensions.AbstractExtensionPointBean;
|
||||
@@ -42,17 +43,23 @@ public class DomExtenderEP extends AbstractExtensionPointBean {
|
||||
private static final Logger LOG = Logger.getInstance(DomExtenderEP.class);
|
||||
|
||||
static {
|
||||
Application app = ApplicationManager.getApplication();
|
||||
EP_NAME.addExtensionPointListener(new ExtensionPointListener<DomExtenderEP>() {
|
||||
@Override
|
||||
public void extensionAdded(@NotNull DomExtenderEP extension, @NotNull PluginDescriptor pluginDescriptor) {
|
||||
StubIndex.getInstance().forceRebuild(new Throwable());
|
||||
extensionsChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void extensionRemoved(@NotNull DomExtenderEP extension, @NotNull PluginDescriptor pluginDescriptor) {
|
||||
StubIndex.getInstance().forceRebuild(new Throwable());
|
||||
extensionsChanged();
|
||||
}
|
||||
}, ApplicationManager.getApplication());
|
||||
|
||||
private void extensionsChanged() {
|
||||
Throwable trace = new Throwable();
|
||||
app.invokeLater(() -> StubIndex.getInstance().forceRebuild(trace), app.getDisposed());
|
||||
}
|
||||
}, app);
|
||||
}
|
||||
|
||||
@Attribute("domClass")
|
||||
|
||||
Reference in New Issue
Block a user