mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
invalidate injected PSI without retrieving its host smart pointer PSI
This commit is contained in:
+7
-10
@@ -456,16 +456,13 @@ public class InjectedLanguageUtil {
|
||||
DebugUtil.finishPsiModification();
|
||||
}
|
||||
|
||||
PsiElement context = InjectedLanguageManager.getInstance(injected.getProject()).getInjectionHost(injected);
|
||||
PsiFile hostFile;
|
||||
if (context != null) {
|
||||
hostFile = context.getContainingFile();
|
||||
}
|
||||
else {
|
||||
VirtualFile delegate = virtualFile.getDelegate();
|
||||
hostFile = delegate.isValid() ? psiManagerEx.findFile(delegate) : null;
|
||||
}
|
||||
if (hostFile != null) {
|
||||
VirtualFile delegate = virtualFile.getDelegate();
|
||||
if (!delegate.isValid()) return;
|
||||
|
||||
FileViewProvider viewProvider = psiManagerEx.getFileManager().findCachedViewProvider(delegate);
|
||||
if (!(viewProvider instanceof SingleRootFileViewProvider)) return;
|
||||
|
||||
for (PsiFile hostFile : ((SingleRootFileViewProvider)viewProvider).getCachedPsiFiles()) {
|
||||
// modification of cachedInjectedDocuments must be under PsiLock
|
||||
synchronized (InjectedLanguageManagerImpl.ourInjectionPsiLock) {
|
||||
List<DocumentWindow> cachedInjectedDocuments = getCachedInjectedDocuments(hostFile);
|
||||
|
||||
Reference in New Issue
Block a user