extensions for error attachments

This commit is contained in:
peter
2011-11-23 21:51:08 +01:00
parent 07986b875f
commit fb3d08758f
2 changed files with 4 additions and 4 deletions
@@ -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) {
@@ -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();
}