tree-sitter / tree-sitter-go

Go grammar for tree-sitter
MIT License
317 stars 63 forks source link

Constant not being recognized after declaration #131

Closed jaymorelli96 closed 1 year ago

jaymorelli96 commented 1 year ago

Constant seems only to be recognized when declared (const_spec). After it has been declared, it is treated just as a normal keyword.

I am pretty sure this is not mean to be the correct behavior? It seems impossible to change the highlight group for a constant that has already being declared.

image

image

image

Not sure if is possible but would be good to have it to be parsed as constant.

Also I have no clue how to implement that, but maybe with some direction and guidance I can start working on that.

amaanq commented 1 year ago

that's not tree-sitter's job but rather an lsp to provide semantic tokens