IDEA-195668 Do not show completion hints in improper context

This commit is contained in:
Dmitry Batrak
2018-07-17 15:05:49 +03:00
parent 717484f15a
commit ef01d133bc
2 changed files with 15 additions and 2 deletions
@@ -1369,7 +1369,7 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase {
"}");
}
public void testCaretMovementOverVirtualComma() throws Exception {
public void testCaretMovementOverVirtualComma() {
enableVirtualComma();
configureJava("class C { void m() { System.getPro<caret> } }");
@@ -1380,6 +1380,12 @@ public class CompletionHintsTest extends AbstractParameterInfoTestCase {
checkResultWithInlays("class C { void m() { System.getProperty(<Hint text=\"key:\"/>, <HINT text=\"def:\"/><caret>) } }");
}
public void testHintsAreNotShownInImproperContext() {
configureJava("class C { void m() { int a = Math.ma<caret>5; } }");
complete("max(int a, int b)");
checkResult("class C { void m() { int a = Math.max(<caret>)5; } }");
}
private void checkResultWithInlays(String text) {
myFixture.checkResultWithInlays(text);
}