-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vhdl language support #5826
Conversation
0a6b2d7
to
220aabc
Compare
I'm far from a tree-sitter query expert but I've done my best here, most keywords/operators/etc are highlighted for me, with vhdl_ls I get nice linter checks showing up. It's a reasonable experience, not quite on par with emacs or even vscode quite yet (vscode uses a textmate syntax highlighter which just seems to work better than my hacky treesitter queries) I'm very open to suggestions on improving the highlights querying. The original author added a large number of error queries to annotate erroneous code which probably is best left for the language server to be frank. So it might be worth ripping out that stuff, and having a helix specific highlights.scm? Thoughts? |
Yeah I think we should rip out the |
So I'm finding that a lot of things just aren't in the grammar and thus don't get highlighted, things I'd really like to highlight. std_logic/std_logic_vector are defined as part of the std_logic_1164 library that comes with vhdl, these aren't in the grammar. They are effectively builtin types though for how widely they are used. Can tree-sitter somehow highlight types/functions if a library is imported somehow? the textmate vhdl highlighter seemed to do something like that. |
Regarding highlighting it is part of the LSP spec and probably something vhdl_ls could do without much effort. |
This would make more sense for vhdl probably than most, is that something helix would be open to enabling/allowing? @the-mikedavis ? |
Tree-sitter will always remain the primary mechanism for syntax highlighting as it is used for a lot of other functionality in helix like motions. LSP syntax highlights also produce a lot of overhead and there is hesitancy about supporting it #5589 (comment). The feature would also be challenging to add into the architecture of helix and no one is working on it so I don't expect this to be available anytime soon. If it's supported it would only augment tree sitter not replace it: #814 (comment) I am not as much of an expert on tree-sitter queries as @the-mikedavis but adding special captures for certain commonly used types should be possible regardless. |
Simple highlight query file with keywords and builtin types matching. Many VHDL types however are defined in std libraries which do not currently get matched on. This is because the grammar doesn't consider them builtin types.
Points at my fork of the vhdl treesitter grammar for highlights for now, original author seems inactive. Points at vhdl_ls as a (rust!) vhdl language server.
dd4ab22
to
b5330a8
Compare
@the-mikedavis @archseer been awhile since this was posted. I understand the project has a lot of churn but it would be nice to at least have the startings of vhdl support |
Could you add some info on vhdl_ls to the language server wiki? https://github.com/helix-editor/helix/wiki/How-to-install-the-default-language-servers Looks like they suggest installing from the GitHub releases artifacts https://github.com/VHDL-LS/rust_hdl |
Simple highlight query file with keywords and builtin types matching. Many VHDL types however are defined in std libraries which do not currently get matched on. This is because the grammar doesn't consider them builtin types.
Simple highlight query file with keywords and builtin types matching. Many VHDL types however are defined in std libraries which do not currently get matched on. This is because the grammar doesn't consider them builtin types.
Simple highlight query file with keywords and builtin types matching. Many VHDL types however are defined in std libraries which do not currently get matched on. This is because the grammar doesn't consider them builtin types.
The vhdl tree sitter grammar is great but the queries primarily focus on error highlights. This adds some highlights for keywords and such.
It also adds support for vhdl_ls as a language server.