VHDL
Check for existing issues
- [X] Completed
Language
VHDL
Tree Sitter parser link
https://github.com/jpt13653903/tree-sitter-vhdl
Language server link
https://github.com/VHDL-LS/rust_hdl
Misc notes
No response
I second this. I would absolutely switch to Zed for my main VHDL editor if this were implemented.
In fact, I have some free time. I'll see if I can put something together
Hi, if it can be useful a first implementation had been done here, functional but not yet merged due to partially missing snippet support: #729
I have actually been using this for quite some time on my own projects
@rapgenic Alright, great. The snippet support looks fairly comprehensive to me, what is missing? Also, I see there was some conversation about migrating to a new tree-sitter parser. Earlier today, I attempted to get something working, and I ran into the same printf issues that you did. Your implementation of the LSP is much cleaner than what I came up with too.
So if some more snippets are added, and perhaps migrated to the new parser, do you think that that will be good to get it into the extension repo?
The snippet support looks fairly comprehensive to me, what is missing?
Basically https://github.com/zed-industries/zed/issues/12739. This means that entity instantiations completions (which rust_hdl provides as snippets) are not inserted into the editor.
Video del 2024-09-04 08-49-27.webm
new tree-sitter parser.
Regarding this, I have tried multiple times to get it working: first of all removing the printf statements: this gets it to build correctly and to load in Zed. However, as reported in the PR it seems that the parsed syntax tree is full of errors! (i.e. it is not parsing the code correctly/completely). In the end I stopped trying because the previous grammar is working well for me. Of course I have no problem with a newer parser, as long as it works as well, of course :)
So if some more snippets are added, and perhaps migrated to the new parser, do you think that that will be good to get it into the extension repo?
Yes definitely. (mainly the snippets)
I would be instantly done with VSCode if Zed supported VHDL. Any progress in solving underlying issues?
The extension is usable but incomplete, as the issues discussed above (i.e. the snippet support) are not yet fixed. However I use it daily and have adapted to its limitations. If people are interested I can reopen the PR to try and get it merged anyway
@rapgenic I tried to install it as a dev extension, but it didn't work. Nothing has loaded. Do I need to compile zed with this extension?
Hi @xtrollyj00, I actually tried myself and I had some problems too.
Of course you need rust to be installed (for compilation) and in my case running rustup update before installing the dev extension from the editor was what I needed.
Also running zed from the command line with zed --foreground helps usually me understand what's happening
@rapgenic Thank you, it worked. The extension looks awesome. Now, I just need to wait for full support of remote development 😄.
@rapgenic May I ask what sorts of snippets have yet to be added? I have some free time.
Hey @breynard0, when considering snippets there are two different things to be implemented yet:
- snippets as in "hard-coded", extension provided snippets (in
snippets.json). Those can be retrieved from the VHDL_LS vscode extension source code. They should work as is, but when I copied the file from the vscode extension to zed's it didn't work, so it should be a matter of gradually implementing them excluding or fixing the ones that don't work. - snippets provided by the language server itself. Those are what i referred to when I wrote about a missing Zed implementation. In fact the LS sometimes provides, as completions, snippets with an advanced syntax that the editor itself is not able to understand. There is an issue for that (It is referred in my original PR, i can't find it easily rn as I'm writing from my phone)
Since we now have the extension, let's close this issue out and move bug reports and such over to the extension repo.