Add diagnostic attachments for commit document assertion

simplify logging
This commit is contained in:
Alexander Zolotov
2014-01-30 20:25:14 +04:00
parent e0fbc6320e
commit 6f94942cff
@@ -194,20 +194,13 @@ public abstract class DocumentCommitProcessor {
if (myTreeElementBeingReparsedSoItWontBeCollected.getTextLength() != document.getTextLength()) {
final String documentText = document.getText();
String fileText = file.getText();
if (ApplicationManager.getApplication().isInternal()) {
LOG.error("commitDocument left PSI inconsistent; file len=" + myTreeElementBeingReparsedSoItWontBeCollected.getTextLength() +
"; doc len=" + document.getTextLength() +
"; doc.getText() == file.getText(): " + Comparing.equal(fileText, documentText) +
";\n file psi text=" + fileText +
";\n doc text=" + documentText +
";\n old psi file text=" + oldPsiText);
}
else {
LOG.error("commitDocument left PSI inconsistent: " + file,
new Attachment("file psi text", fileText),
new Attachment("old text", documentText),
new Attachment("old psi file text", oldPsiText));
}
LOG.error("commitDocument left PSI inconsistent: " + file +
"; file len=" + myTreeElementBeingReparsedSoItWontBeCollected.getTextLength() +
"; doc len=" + document.getTextLength() +
"; doc.getText() == file.getText(): " + Comparing.equal(fileText, documentText),
new Attachment("file psi text", fileText),
new Attachment("old text", documentText),
new Attachment("old psi file text", oldPsiText));
file.putUserData(BlockSupport.DO_NOT_REPARSE_INCREMENTALLY, Boolean.TRUE);
try {