From e559e04a60e4d937af1875396c06d07e86650408 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 22 Apr 2016 06:55:47 +0200 Subject: [PATCH] assert that completion file copy should be non-physical and non-event-system-enabled --- .../codeInsight/completion/CodeCompletionHandlerBase.java | 4 ++++ 1 file changed, 4 insertions(+) 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 3b484adc4e4c..7a5285067dc1 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java @@ -752,6 +752,10 @@ public class CodeCompletionHandlerBase { } final PsiFile copy = (PsiFile)file.copy(); + if (copy.isPhysical() || copy.getViewProvider().isEventSystemEnabled()) { + LOG.error("File copy should be non-physical and non-event-system-enabled! Language=" + file.getLanguage() + "; file=" + file + " of " + file.getClass()); + } + if (mayCacheCopy) { final Document document = copy.getViewProvider().getDocument(); assert document != null;