inspection view: wrap with write action (EA-86818)
authorDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Mon, 15 Aug 2016 11:48:09 +0000 (14:48 +0300)
committerDmitry Batkovich <dmitry.batkovich@jetbrains.com>
Tue, 16 Aug 2016 07:08:35 +0000 (10:08 +0300)
platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewUtil.java

index 4f2eddd066d80c2e43be2fee141b96e8fd360db8..e2eaa58a87573e3450ecbbf9fc268d338caa1d9f 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.codeInspection.ui;
 import com.intellij.codeInspection.ex.InspectionToolWrapper;
 import com.intellij.codeInspection.reference.RefElement;
 import com.intellij.codeInspection.reference.RefEntity;
+import com.intellij.openapi.application.WriteAction;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.EditorFactory;
@@ -61,7 +62,7 @@ public class InspectionResultsViewUtil {
       final PsiFile containingFile = containingElement.getContainingFile();
       if (containingFile != null) {
         final VirtualFile file = containingFile.getVirtualFile();
-        PsiDocumentManager.getInstance(containingFile.getProject()).commitAllDocuments();
+        WriteAction.run(() -> PsiDocumentManager.getInstance(containingFile.getProject()).commitAllDocuments());
         final Document document = FileDocumentManager.getInstance().getDocument(file);
         if (document != null && document.getLineCount() > lineNumber - 1) {
           return new OpenFileDescriptor(containingElement.getProject(),