[Inline Param Name Hints] do not show single hint if it is string literal

This commit is contained in:
Yaroslav Lepenkin
2016-09-29 17:53:34 +03:00
parent 4c2612e490
commit bcf5640e52
3 changed files with 51 additions and 4 deletions
@@ -478,6 +478,45 @@ public class VarArgTest {
.assertInlays("test->this", "endIndex->1000")
}
fun `test do not show single parameter hint if it is string literal`() {
setup("""
public class Test {
public void test() {
debug("Error message");
info("Error message", new Object());
}
void debug(String message) {}
void info(String message, Object error) {}
}
""")
onLineStartingWith("debug(").assertNoInlays()
onLineStartingWith("info(").assertNoInlays()
}
fun `test show hints for literals if there are many of them`() {
setup("""
public class Test {
public void test() {
int a = 2;
debug("Debug", "DTitle", a);
info("Error message", "Title");
}
void debug(String message, String title, int value) {}
void info(String message, String title) {}
}
""")
onLineStartingWith("debug(").assertInlays("message->\"Debug\"", "title->\"DTitle\"")
onLineStartingWith("info(").assertInlays("message->\"Error message\"", "title->\"Title\"")
}
private fun getInlays(): List<Inlay> {
val editor = myFixture.editor
return editor.inlayModel.getInlineElementsInRange(0, editor.document.textLength)