From 69df7ce681bb615064876fad728b4d7cebe6d255 Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 13 Jul 2017 17:37:36 +0200 Subject: [PATCH] completion property tests: don't expect boolean literals to be suggested --- .../java/propertyBased/InvokeCompletion.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/java/java-tests/testSrc/com/intellij/java/propertyBased/InvokeCompletion.java b/java/java-tests/testSrc/com/intellij/java/propertyBased/InvokeCompletion.java index 76cdabb99c46..e108e4af015c 100644 --- a/java/java-tests/testSrc/com/intellij/java/propertyBased/InvokeCompletion.java +++ b/java/java-tests/testSrc/com/intellij/java/propertyBased/InvokeCompletion.java @@ -164,10 +164,14 @@ class InvokeCompletion extends ActionOnRange { return null; } if (leaf instanceof PsiIdentifier) return null; // it's not a ref, just some name - if (leaf instanceof PsiKeyword && - leaf.getParent() instanceof PsiClassObjectAccessExpression && - PsiUtil.resolveClassInType(((PsiClassObjectAccessExpression)leaf.getParent()).getType()) == null) { - return null; + if (leaf instanceof PsiKeyword) { + if (leaf.getParent() instanceof PsiClassObjectAccessExpression && + PsiUtil.resolveClassInType(((PsiClassObjectAccessExpression)leaf.getParent()).getType()) == null) { + return null; + } + if (leaf.textMatches(PsiKeyword.TRUE) || leaf.textMatches(PsiKeyword.FALSE)) { + return null; // boolean literal presence depends on expected types, which can be missing in red files + } } } return leafText;