Skip to content

Commit f749367

Browse files
committed
Polish
Signed-off-by: BoykoAlex <alex.boyko@broadcom.com>
1 parent eac1166 commit f749367

File tree

1 file changed

+2
-15
lines changed
  • headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness

1 file changed

+2
-15
lines changed

headless-services/commons/language-server-test-harness/src/main/java/org/springframework/ide/vscode/languageserver/testharness/Editor.java

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,22 +1096,9 @@ public void assertDocumentSymbols(String... symbols) throws Exception {
10961096
assertEquals(expected.toString(), actual.toString());
10971097
}
10981098

1099-
public void assertSemanticTokensFull(ExpectedSemanticToken... expectedTokens) throws InterruptedException, ExecutionException {
1099+
public void assertSemanticTokensFull(ExpectedSemanticToken... expectedTokens) throws Exception {
11001100
List<SemanticTokenData> actualTokens = harness.getSemanticTokensFull(doc);
1101-
Iterator<SemanticTokenData> itr = actualTokens.iterator();
1102-
for (ExpectedSemanticToken expected : expectedTokens) {
1103-
if (!itr.hasNext()) {
1104-
fail("Number of expected tokens is larger than the actual number of tokens");
1105-
}
1106-
SemanticTokenData actual = itr.next();
1107-
String actualText = doc.textBetween(actual.getStart(), actual.getEnd());
1108-
assertEquals(expected.text(), actualText, String.format("Token text does not match %s", actual));
1109-
assertEquals(expected.type(), actual.type(), String.format("Token '%s' type does not match: %s", actualText, actual));
1110-
assertArrayEquals(expected.modifiers(), actual.modifiers(), String.format("Token '%s' modifiers do not match: %s", actualText, actual));
1111-
}
1112-
if (itr.hasNext()) {
1113-
fail("Number of expected tokens is less than the actual number of tokens");
1114-
}
1101+
SemanticTokensAssert.assertTokens(getRawText(), actualTokens, expectedTokens);
11151102
}
11161103

11171104
public void assertHierarchicalDocumentSymbols(String expectedSymbolDump) throws Exception {

0 commit comments

Comments
 (0)