mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
[Parameter Name Hints] added diagnostic
This commit is contained in:
+3
-3
@@ -88,7 +88,8 @@ class InlayAssert(private val file: PsiFile, val inlays: List<Inlay>) {
|
||||
val hintOffsets = hints.map { it.first }
|
||||
val hintNames = hints.map { it.second }
|
||||
|
||||
assertThat(hints.size).isEqualTo(expectedInlays.size)
|
||||
val elements = hintOffsets.mapNotNull { file.findElementAt(it) }
|
||||
assertThat(hints.size).isEqualTo(expectedInlays.size).withFailMessage("Element at offsets: ${elements.joinToString(", ")}")
|
||||
|
||||
val expect = expectedInlays.map { it.substringBefore("->") to it.substringAfter("->") }
|
||||
val expectedHintNames = expect.map { it.first }
|
||||
@@ -96,8 +97,7 @@ class InlayAssert(private val file: PsiFile, val inlays: List<Inlay>) {
|
||||
|
||||
assertThat(hintNames).isEqualTo(expectedHintNames)
|
||||
|
||||
val wordsAfter = hintOffsets.mapNotNull { file.findElementAt(it) }.map { it.text }
|
||||
|
||||
val wordsAfter = elements.map { it.text }
|
||||
assertThat(wordsAfter).isEqualTo(expectedWordsAfter)
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -708,13 +708,16 @@ class Key {
|
||||
setup("""
|
||||
class Test {
|
||||
void test() {
|
||||
xxx(100);
|
||||
check(1 + 1);
|
||||
int i=1; check(1 + 1 + 1);
|
||||
}
|
||||
void check(int isShow) {}
|
||||
void xxx(int followTheSum) {}
|
||||
}
|
||||
""")
|
||||
|
||||
|
||||
onLineStartingWith("xxx").assertInlays("followTheSum->100")
|
||||
onLineStartingWith("check").assertInlays("isShow->1")
|
||||
onLineStartingWith("int").assertInlays("isShow->1")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user