Open unorsk opened 1 year ago
I think likely the best way to do this would actually be through the Semantic Tokens LSP request, since in Unison we can't know the difference between a term, type, or constructor name through syntax alone, you need access to the codebase.
It should be relatively straight-forward to analyze the Haskell type for a parsed file and produce the semantic tokens response, but we're a bit busy lately so it's unlikely to happen in the short term.
In the meantime though we'd accept reasonable updates to the Regex-based highlighting, or we'd love to have a Tree-sitter grammar if anyone's up to that task 😄
For anyone reading this, I'm pretty close to being done with a tree sitter grammar at https://github.com/kylegoetz/tree-sitter-unison
(I came here because I was looking at how the VS Code plugin does highlighting for doc blocks)
I've noticed that syntax highlighting is a bit too simple.
Just to compare unison share and vscode highlighting:
Unison share:
VSCode:
Yeah, the color schemes are different, but the highlighting itself seems to be completely different too.
Is it hard to make it work similarly to unison share (and/or the haskell vscode extension)
Here's a sample for Haskell
None
andhelloHandler
to have different colors