mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
InvokeIntention: remove debug info
This commit is contained in:
-16
@@ -36,7 +36,6 @@ import com.intellij.openapi.util.TextRange;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.DebugUtil;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtilBase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
@@ -89,19 +88,11 @@ public class InvokeIntention extends ActionOnFile {
|
||||
PsiDocumentManager.getInstance(project).commitAllDocuments();
|
||||
|
||||
FileViewProvider viewProvider = getFile().getViewProvider();
|
||||
String filesBefore = viewProvider.getAllFiles().toString();
|
||||
boolean containsErrorElements = MadTestingUtil.containsErrorElements(viewProvider);
|
||||
|
||||
String treesBefore = viewProvider.getAllFiles().stream().map(f -> DebugUtil.psiToString(f, false)).collect(
|
||||
Collectors.joining("\n\n"))
|
||||
+ "\n\n hasErrorPSI=" + containsErrorElements
|
||||
+ "\n hasErrorPSI2=" + MadTestingUtil.containsErrorElements(viewProvider)
|
||||
+ "\n filesBefore=" + filesBefore;
|
||||
|
||||
List<HighlightInfo> errors = highlightErrors(project, editor);
|
||||
boolean hasErrors = !errors.isEmpty() || containsErrorElements;
|
||||
|
||||
|
||||
PsiFile file = PsiUtilBase.getPsiFileInEditor(editor, getProject());
|
||||
assert file != null;
|
||||
List<IntentionAction> intentions = getAvailableIntentions(editor, file);
|
||||
@@ -158,13 +149,6 @@ public class InvokeIntention extends ActionOnFile {
|
||||
message += ".\nIf it's by design that " + intentionString + " doesn't change source files, " +
|
||||
"it should return false from 'startInWriteAction'";
|
||||
}
|
||||
message += "\n Debug info: " + treesBefore + "\n\nafter:" +
|
||||
file.getViewProvider().getAllFiles().stream().map(
|
||||
f ->
|
||||
DebugUtil.psiToString(f, false) +
|
||||
"\n\n" +
|
||||
SyntaxTraverser.psiTraverser(file).filter(PsiErrorElement.class).toList()
|
||||
).collect(Collectors.joining("\n\n"));
|
||||
throw new AssertionError(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user