mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
[Inline Param Name Hints] do not show single hint if it is string literal
This commit is contained in:
+39
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user