mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
give internal injected PSI operations names so that we don't waste time creating Throwable for them
This commit is contained in:
+10
-1
@@ -32,6 +32,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.DebugUtil;
|
||||
import com.intellij.psi.impl.PsiManagerEx;
|
||||
import com.intellij.psi.impl.PsiParameterizedCachedValue;
|
||||
import com.intellij.psi.impl.source.DummyHolder;
|
||||
@@ -449,7 +450,15 @@ public class InjectedLanguageUtil {
|
||||
VirtualFileWindowImpl virtualFile = (VirtualFileWindowImpl)injected.getVirtualFile();
|
||||
PsiManagerEx psiManagerEx = (PsiManagerEx)injected.getManager();
|
||||
if (psiManagerEx.getProject().isDisposed()) return;
|
||||
psiManagerEx.getFileManager().setViewProvider(virtualFile, null);
|
||||
|
||||
DebugUtil.startPsiModification("injected clearCaches");
|
||||
try {
|
||||
psiManagerEx.getFileManager().setViewProvider(virtualFile, null);
|
||||
}
|
||||
finally {
|
||||
DebugUtil.finishPsiModification();
|
||||
}
|
||||
|
||||
PsiElement context = InjectedLanguageManager.getInstance(injected.getProject()).getInjectionHost(injected);
|
||||
PsiFile hostFile;
|
||||
if (context != null) {
|
||||
|
||||
+9
-3
@@ -445,9 +445,15 @@ public class MultiHostRegistrarImpl implements MultiHostRegistrar, ModificationT
|
||||
oldViewProvider.performNonPhysically(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final DiffLog diffLog = BlockSupportImpl.mergeTrees(oldFile, oldFileNode, injectedNode, new DaemonProgressIndicator(),
|
||||
oldFileNode.getText());
|
||||
DocumentCommitProcessor.doActualPsiChange(oldFile, diffLog);
|
||||
DebugUtil.startPsiModification("injected tree diff");
|
||||
try {
|
||||
final DiffLog diffLog = BlockSupportImpl.mergeTrees(oldFile, oldFileNode, injectedNode, new DaemonProgressIndicator(),
|
||||
oldFileNode.getText());
|
||||
DocumentCommitProcessor.doActualPsiChange(oldFile, diffLog);
|
||||
}
|
||||
finally {
|
||||
DebugUtil.finishPsiModification();
|
||||
}
|
||||
}
|
||||
});
|
||||
assert shreds.isValid();
|
||||
|
||||
Reference in New Issue
Block a user