suoto / hdl_checker

Repurposing existing HDL tools to help writing better code
GNU General Public License v3.0
187 stars 22 forks source link

[Question] LSP hover information and dependencies navigation functionalities #87

Open pidgeon777 opened 3 years ago

pidgeon777 commented 3 years ago

As a language server, HDL Checker will provide

1 - Diagnostics 2 - Hover information

3 - Go to definition of dependencies

How would it be possible to make use of features 2 and 3 in Vim or similar (for example, Neovim)?

Best regards

bramhooimeijer commented 2 years ago

Depends on how HDL checker is integrated (Ale/lspconfig/coc etc).

E.g., for lspconfig, the following configuration is recommended in the lspconfig readme:

buf_set_keymap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)

That would allow hover with 'K' and go to definition with 'gd'. For e.g. VHDL, this works when hovering over the entity name in an instantiation.

Coc, ale and others have their own commands listed in their respective readmes.