I am trying to use tree-sitter with NeoVim. Initially it was appealing, since I had the regex based highlighting break often, and I thought queries on a parse tree would be better.
But it seems that Haskell is hard with tree-sitter, since it can’t know if something is a function or not without doing type checking.
For example if I have
int :: Int -> Int
int = id
and I do :Inspect
on the latter int
, I get @function.haskell
.
But if I change to:
type Int2Int = Int -> Int
int :: Int2Int
int = id
the color is changed and it now looks like any other term.
This makes me wonder, does tree-sitter even make sense with Haskell? Are we going to highlight using LSP at some point? Then I suppose Haskellers could skip tree-sitter entirely.
I suppose you could make the point that highlighting doesn’t need to be perfect. But in that case, you could make the argument that regexes are good enough. They seem to have less moving parts.
Or should I, as the title suggests, just color functions the same as other terms, and enjoy highlighting on other elements?