From c1bd599acdbd95cf14ab517dfa9215ea9ed147da Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 5 Jan 2018 21:10:19 +0100 Subject: [PATCH] mad testing: don't expect completion in regexp characters --- .../testFramework/propertyBased/CompletionPolicy.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/testFramework/testSrc/com/intellij/testFramework/propertyBased/CompletionPolicy.java b/platform/testFramework/testSrc/com/intellij/testFramework/propertyBased/CompletionPolicy.java index fab8eaa34b57..f2b33cb317e6 100644 --- a/platform/testFramework/testSrc/com/intellij/testFramework/propertyBased/CompletionPolicy.java +++ b/platform/testFramework/testSrc/com/intellij/testFramework/propertyBased/CompletionPolicy.java @@ -20,6 +20,7 @@ import com.intellij.openapi.editor.Editor; import com.intellij.psi.*; import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.psi.util.PsiUtilCore; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -52,6 +53,12 @@ public class CompletionPolicy { return null; } + if (leafText.length() == 1 && + "org.intellij.lang.regexp.RegExpElementType".equals(PsiUtilCore.getElementType(leaf).getClass().getName())) { + // regexp has a token for each character: not interesting (and no completion) + return null; + } + if (isDeclarationName(editor, file, leaf)) return null; if (ref != null) {