blob: 3e9dcd76a3ad54d187f1f5df34dfa9dc6e6afc48 [file] [log] [blame]
This test checks the output of textDocument/semanticTokens/range.
TODO: add more assertions.
-- a.go --
package p //@token("package", "keyword", "")
const C = 42 //@token("C", "variable", "definition readonly")
func F() { //@token("F", "function", "definition")
x := 2 + 3//@token("x", "variable", "definition"),token("2", "number", ""),token("+", "operator", "")
_ = x //@token("x", "variable", "")
_ = F //@token("F", "function", "")
}
func _() {
// A goto's label cannot be found by ascending the syntax tree.
goto loop //@ token("goto", "keyword", ""), token("loop", "label", "")
loop: //@token("loop", "label", "definition")
for {
continue loop //@ token("continue", "keyword", ""), token("loop", "label", "")
}
}