use of org.eclipse.lsp4j.SemanticTokens in project magik-tools by StevenLooman.
the class SemanticTokenProviderTest method testDocCommentParam.
@Test
void testDocCommentParam() {
final String code = " ## @param {sw:char16_vector} p1 Description of p1";
final SemanticTokens semanticTokens = this.getSemanticTokens(code);
final int docModifier = SemanticToken.Modifier.DOCUMENTATION.getModifierType();
assertThat(semanticTokens.getData()).containsExactly(0, 1, "##".length(), SemanticToken.Type.COMMENT.getTokenType(), docModifier, 0, 3, "@param".length(), SemanticToken.Type.KEYWORD.getTokenType(), docModifier, 0, 8, "sw:char16_vector".length(), SemanticToken.Type.CLASS.getTokenType(), docModifier, 0, 18, "p1".length(), SemanticToken.Type.PARAMETER.getTokenType(), docModifier, 0, 3, "Description of p1".length(), SemanticToken.Type.COMMENT.getTokenType(), docModifier);
}
use of org.eclipse.lsp4j.SemanticTokens in project magik-tools by StevenLooman.
the class SemanticTokenProviderTest method testDocCommentFunction.
@Test
void testDocCommentFunction() {
final String code = " ## doc comment";
final SemanticTokens semanticTokens = this.getSemanticTokens(code);
final int docModifier = SemanticToken.Modifier.DOCUMENTATION.getModifierType();
assertThat(semanticTokens.getData()).containsExactly(0, 1, "## doc comment".length(), SemanticToken.Type.COMMENT.getTokenType(), docModifier);
}
use of org.eclipse.lsp4j.SemanticTokens in project magik-tools by StevenLooman.
the class SemanticTokenProviderTest method testNumber.
@Test
void testNumber() {
final String code = "100";
final SemanticTokens semanticTokens = this.getSemanticTokens(code);
assertThat(semanticTokens.getData()).containsExactly(0, 0, "100".length(), SemanticToken.Type.NUMBER.getTokenType(), 0);
}
use of org.eclipse.lsp4j.SemanticTokens in project magik-tools by StevenLooman.
the class SemanticTokenProviderTest method testVariableDefinition.
@Test
void testVariableDefinition() {
final String code = "_local xxx";
final SemanticTokens semanticTokens = this.getSemanticTokens(code);
assertThat(semanticTokens.getData()).containsExactly(0, 0, "_local".length(), SemanticToken.Type.KEYWORD.getTokenType(), 0, 0, 7, "xxx".length(), SemanticToken.Type.VARIABLE.getTokenType(), 0);
}
use of org.eclipse.lsp4j.SemanticTokens in project magik-tools by StevenLooman.
the class SemanticTokenProviderTest method testForVariable.
@Test
void testForVariable() {
final String code = "_for aaa _over a() _loop _endloop";
final SemanticTokens semanticTokens = this.getSemanticTokens(code);
assertThat(semanticTokens.getData()).containsExactly(0, 0, "_for".length(), SemanticToken.Type.KEYWORD.getTokenType(), 0, 0, 5, "aaa".length(), SemanticToken.Type.VARIABLE.getTokenType(), 0, 0, 4, "_over".length(), SemanticToken.Type.KEYWORD.getTokenType(), 0, 0, 6, "a".length(), SemanticToken.Type.FUNCTION.getTokenType(), 0, 0, 4, "_loop".length(), SemanticToken.Type.KEYWORD.getTokenType(), 0, 0, 6, "_endloop".length(), SemanticToken.Type.KEYWORD.getTokenType(), 0);
}
Aggregations