mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
clear cache before notify listeners to ensure that listeners don't get outdated data
GitOrigin-RevId: c98fd042cfacf7ebfd0a438485eb5a3cc5a2d4d5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2eb3105710
commit
bec63807ce
@@ -1,9 +1,8 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.uast;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.MetaLanguage;
|
||||
import com.intellij.openapi.extensions.ExtensionPointChangeListener;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.uast.UastLanguagePlugin;
|
||||
@@ -12,10 +11,7 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public class UastMetaLanguage extends MetaLanguage {
|
||||
public final class UastMetaLanguage extends MetaLanguage {
|
||||
private final Set<Language> myLanguages;
|
||||
|
||||
protected UastMetaLanguage() {
|
||||
@@ -25,16 +21,10 @@ public class UastMetaLanguage extends MetaLanguage {
|
||||
myLanguages = new THashSet<>(languagePlugins.size());
|
||||
initLanguages(languagePlugins);
|
||||
|
||||
UastLanguagePlugin.Companion
|
||||
.getExtensionPointName()
|
||||
.getPoint(null)
|
||||
.addExtensionPointListener(new ExtensionPointChangeListener() {
|
||||
@Override
|
||||
public void extensionListChanged() {
|
||||
myLanguages.clear();
|
||||
initLanguages(UastLanguagePlugin.Companion.getInstances());
|
||||
}
|
||||
}, false, null);
|
||||
UastLanguagePlugin.Companion.getExtensionPointName().addChangeListener(() -> {
|
||||
myLanguages.clear();
|
||||
initLanguages(UastLanguagePlugin.Companion.getInstances());
|
||||
}, null);
|
||||
}
|
||||
|
||||
private void initLanguages(Collection<UastLanguagePlugin> languagePlugins) {
|
||||
|
||||
Reference in New Issue
Block a user