diff options
| author | Dimitris Dimitropoulos <dimitris.dimitropoulos00@gmail.com> | 2025-08-11 21:38:30 +0300 |
|---|---|---|
| committer | Dimitris Dimitropoulos <dimitris.dimitropoulos00@gmail.com> | 2025-08-11 21:45:12 +0300 |
| commit | 099e4fd6fa391872319cb11c453d7e6eec9c2234 (patch) | |
| tree | 8abd276709ae088b07c07933f1df28510befd104 /lsp/svlangserver.lua | |
| parent | fix(rust_analyzer): update config to 0.11+ (diff) | |
| download | nvim-lspconfig-099e4fd6fa391872319cb11c453d7e6eec9c2234.tar nvim-lspconfig-099e4fd6fa391872319cb11c453d7e6eec9c2234.tar.gz nvim-lspconfig-099e4fd6fa391872319cb11c453d7e6eec9c2234.tar.bz2 nvim-lspconfig-099e4fd6fa391872319cb11c453d7e6eec9c2234.tar.lz nvim-lspconfig-099e4fd6fa391872319cb11c453d7e6eec9c2234.tar.xz nvim-lspconfig-099e4fd6fa391872319cb11c453d7e6eec9c2234.tar.zst nvim-lspconfig-099e4fd6fa391872319cb11c453d7e6eec9c2234.zip | |
fix(svlangserver): update config to 0.11+
- Drop .buf.execute_command and use :exec_cmd
Diffstat (limited to 'lsp/svlangserver.lua')
| -rw-r--r-- | lsp/svlangserver.lua | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lsp/svlangserver.lua b/lsp/svlangserver.lua index 9e205e28..9fed7358 100644 --- a/lsp/svlangserver.lua +++ b/lsp/svlangserver.lua @@ -10,21 +10,6 @@ --- $ npm install -g @imc-trading/svlangserver --- ``` -local function build_index() - local params = { - command = 'systemverilog.build_index', - } - vim.lsp.buf.execute_command(params) -end - -local function report_hierarchy() - local params = { - command = 'systemverilog.report_hierarchy', - arguments = { vim.fn.expand '<cword>' }, - } - vim.lsp.buf.execute_command(params) -end - return { cmd = { 'svlangserver' }, filetypes = { 'verilog', 'systemverilog' }, @@ -34,11 +19,24 @@ return { includeIndexing = { '*.{v,vh,sv,svh}', '**/*.{v,vh,sv,svh}' }, }, }, - on_attach = function(_, bufnr) - vim.api.nvim_buf_create_user_command(bufnr, 'LspSvlangserverBuildIndex', build_index, { + ---@param client vim.lsp.Client + ---@param bufnr integer + on_attach = function(client, bufnr) + vim.api.nvim_buf_create_user_command(bufnr, 'LspSvlangserverBuildIndex', function() + client:exec_cmd({ + title = 'Build Index', + command = 'systemverilog.build_index', + }, { bufnr = bufnr }) + end, { desc = 'Instructs language server to rerun indexing', }) - vim.api.nvim_buf_create_user_command(bufnr, 'LspSvlangserverReportHierarchy', report_hierarchy, { + vim.api.nvim_buf_create_user_command(bufnr, 'LspSvlangserverReportHierarchy', function() + client:exec_cmd({ + title = 'Build Index', + command = 'systemverilog.build_index', + arguments = { vim.fn.expand '<cword>' }, + }, { bufnr = bufnr }) + end, { desc = 'Generates hierarchy for the given module', }) end, |
