tree-sitter-rescript
tree-sitter-rescript copied to clipboard
Function highlight ?
As we discuss here : https://github.com/rescript-lang/vim-rescript/issues/49#issuecomment-905650526
should we highlight functions ?
@nkrkv i'm playing with the tree sitter, I added some highlights. I don't know the status of this project, but if you wish I can open a PR.
Demo:

Thanks! I’ve read that the idea of Tree-sitter based highlighting is to color the same symbols using the same colors. So that if you see several pink words in random places, you know they refer to the same thing. From that point of view, highlighting function use and not highlighting its declaration is incorrect. And in a language like ReScript where all functions are lambdas the true way is hardly applicable at all.
I might be mistaken. Let’s leave the issue floating… If more people would like the call-only highlight… well, it would be worth doing so.
Thanks for the answer. The declaration can be highlighted as @function, an example:
(let_binding
(value_identifier) @function
(function))
I don't know if this one covers everything

So, the missing case is when we have higher order function ? Seems good enough to me. Not sure if tree-sitter will/can detect that in the future, probably not :/