java mad testing: don't expect completions on broken case

This commit is contained in:
peter
2019-01-04 18:32:08 +01:00
parent 581dd6cbc8
commit 41beeed926
@@ -165,6 +165,9 @@ class JavaCompletionPolicy extends CompletionPolicy {
return false; // no modifiers for local classes/variables
}
}
if (parent instanceof PsiSwitchLabelStatementBase && ((PsiSwitchLabelStatementBase)parent).getEnclosingSwitchBlock() == null) {
return false; // bad syntax
}
}
if (leaf.textMatches(PsiKeyword.TRUE) || leaf.textMatches(PsiKeyword.FALSE)) {
return false; // boolean literal presence depends on expected types, which can be missing in red files