From fb3d08758fc951fa9f74fab605253fb963f41774 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 23 Nov 2011 20:58:37 +0100 Subject: [PATCH] extensions for error attachments --- .../codeInsight/completion/CodeCompletionHandlerBase.java | 4 ++-- .../com/intellij/util/xml/impl/PhysicalDomParentStrategy.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java index 04fdb13567ea..94fff0951ef7 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java @@ -393,13 +393,13 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler { if (!range.substring(fileCopy.getText()).equals(insertedElement.getText())) { LOG.error(LogMessageEx.createEvent("Inconsistent completion tree", "range=" + range + "\n" + DebugUtil.currentStackTrace(), createFileTextAttachment(fileCopy, originalFile), createAstAttachment(fileCopy, originalFile), - new Attachment("Element at caret", insertedElement.getText()))); + new Attachment("Element at caret.txt", insertedElement.getText()))); } return insertedElement; } private static Attachment createAstAttachment(PsiFile fileCopy, final PsiFile originalFile) { - return new Attachment(originalFile.getViewProvider().getVirtualFile().getPath() + " syntactic tree", DebugUtil.psiToString(fileCopy, false)); + return new Attachment(originalFile.getViewProvider().getVirtualFile().getPath() + " syntactic tree.txt", DebugUtil.psiToString(fileCopy, false)); } private static Attachment createFileTextAttachment(PsiFile fileCopy, final PsiFile originalFile) { diff --git a/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java b/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java index afcd4438d0e8..43bce867456a 100644 --- a/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java +++ b/xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java @@ -108,8 +108,8 @@ public class PhysicalDomParentStrategy implements DomParentStrategy { "navContext?.physical=" + (navContext != null && navContext.isPhysical()) + ";\n" + "myElement.physical=" + myElement.isPhysical() + ";\n" + "thatElement.physical=" + thatElement.isPhysical() + "\n" + DebugUtil.currentStackTrace(), - new Attachment("Including tag text 1", curContext == null ? "null" : curContext.getText()), - new Attachment("Including tag text 2", navContext == null ? "null" : navContext.getText()) + new Attachment("Including tag text 1.xml", curContext == null ? "null" : curContext.getText()), + new Attachment("Including tag text 2.xml", navContext == null ? "null" : navContext.getText()) )); throw new AssertionError(); }