How to use snippets in emacs with lsp-mode?
Closed this issue · 6 comments
Thanks for your great work. I've configured emacs with readme.md and downloaded snippets, but I don't know how to make these snippets work.
Have you tried yasnippets?
Yes, I installed yasnippsets and lsp-mode. Cpp and Python work well. But it seems that the server can’t find the sv snippets, where should I put the snippets?
Do I need to manually configure the search options of lsp for svlangserver?
The language server doesn't interact with the snippets. They are meant only for snippet extension such as yasnippet. Can you please try saving the snippets under ~/.emacs.d/snippets/verilog-mode and see if that works?
I tried it a few minutes ago and I moved the systemverilog.json under the git repository to " ~/.emacs.d/snippets/verilog-mode/".
What really happened is that after clicking, the contents of the entire json file will be inserted into the file
Maybe I should read yasnippets document to let it work with json files.
Thanks for your work!
oh yeah. The format that yasnippet expects is different I guess. The json based snippets work with VSCode and coc-snippets (vim) I believe
It seems that yas cannot work with json, I will try to rewrite the systemverilog.json file into yas format.