From 0f4e14965f7d38c49fb36751749dee6cfd611557 Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 18 Jun 2013 10:49:22 +0200 Subject: [PATCH] more debug info on stub-ast mismatch --- .../src/com/intellij/psi/impl/source/PsiFileImpl.java | 8 ++++++++ .../src/com/intellij/psi/stubs/StubUpdatingIndex.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/core-impl/src/com/intellij/psi/impl/source/PsiFileImpl.java b/platform/core-impl/src/com/intellij/psi/impl/source/PsiFileImpl.java index f17a438c2cdb..91470351f87d 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/source/PsiFileImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/source/PsiFileImpl.java @@ -313,6 +313,13 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF msg += "\n name=" + getName(); msg += "\n stub debugInfo=" + stubTree.getDebugInfo(); msg += "\n document before=" + cachedDocument; + + ObjectStubTree latestIndexedStub = StubTreeLoader.getInstance().readFromVFile(getProject(), getVirtualFile()); + msg += "\nlatestIndexedStub=" + latestIndexedStub; + if (latestIndexedStub != null) { + msg += "\nsame size=" + (stubTree.getPlainList().size() == latestIndexedStub.getPlainList().size()); + msg += "\ndebugInfo=" + latestIndexedStub.getDebugInfo(); + } FileViewProvider viewProvider = getViewProvider(); msg += "\n viewProvider=" + viewProvider; @@ -326,6 +333,7 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF if (document != null) { msg += "\n doc saved: " + !FileDocumentManager.getInstance().isDocumentUnsaved(document); msg += "; doc stamp: " + document.getModificationStamp(); + msg += "; doc size: " + document.getTextLength(); msg += "; committed: " + PsiDocumentManager.getInstance(getProject()).isCommitted(document); } diff --git a/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java b/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java index 4dcd9e661f54..b7084b84c408 100644 --- a/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java +++ b/platform/lang-impl/src/com/intellij/psi/stubs/StubUpdatingIndex.java @@ -162,7 +162,7 @@ public class StubUpdatingIndex extends CustomImplementationFileBasedIndexExtensi long stamp = stream.readLong(); long size = stream.readLong(); stream.close(); - return "indexed at " + stamp + " with size " + size; + return "indexed at " + stamp + " with size " + size + ", queried at " + file.getTimeStamp(); } catch (IOException e) { return ExceptionUtil.getThrowableText(e);