diff options
| author | Igor <igorlfs@ufmg.br> | 2025-08-18 23:41:27 -0300 |
|---|---|---|
| committer | Igor <igorlfs@ufmg.br> | 2025-08-18 23:41:27 -0300 |
| commit | ec27b247a5e25f6997b66aee30090eda18efaa27 (patch) | |
| tree | 6430c1e4e840c0936a6796009fcc3b6cd509e0e8 | |
| parent | chore: add type annotation for configs (diff) | |
| download | nvim-lspconfig-ec27b247a5e25f6997b66aee30090eda18efaa27.tar nvim-lspconfig-ec27b247a5e25f6997b66aee30090eda18efaa27.tar.gz nvim-lspconfig-ec27b247a5e25f6997b66aee30090eda18efaa27.tar.bz2 nvim-lspconfig-ec27b247a5e25f6997b66aee30090eda18efaa27.tar.lz nvim-lspconfig-ec27b247a5e25f6997b66aee30090eda18efaa27.tar.xz nvim-lspconfig-ec27b247a5e25f6997b66aee30090eda18efaa27.tar.zst nvim-lspconfig-ec27b247a5e25f6997b66aee30090eda18efaa27.zip | |
chore: miscellaneous type fixes
| -rw-r--r-- | lsp/basedpyright.lua | 2 | ||||
| -rw-r--r-- | lsp/biome.lua | 4 | ||||
| -rw-r--r-- | lsp/clangd.lua | 3 | ||||
| -rw-r--r-- | lsp/custom_elements_ls.lua | 2 | ||||
| -rw-r--r-- | lsp/denols.lua | 2 | ||||
| -rw-r--r-- | lsp/ds_pinyin_lsp.lua | 4 | ||||
| -rw-r--r-- | lsp/ltex_plus.lua | 8 | ||||
| -rw-r--r-- | lsp/marksman.lua | 5 | ||||
| -rw-r--r-- | lsp/pyright.lua | 2 | ||||
| -rw-r--r-- | lsp/scheme_langserver.lua | 4 | ||||
| -rw-r--r-- | lsp/svelte.lua | 1 | ||||
| -rw-r--r-- | lsp/svlangserver.lua | 2 | ||||
| -rw-r--r-- | lsp/texlab.lua | 2 | ||||
| -rw-r--r-- | lsp/tinymist.lua | 2 | ||||
| -rw-r--r-- | lsp/ts_ls.lua | 4 | ||||
| -rw-r--r-- | lsp/tsgo.lua | 4 | ||||
| -rw-r--r-- | lsp/vtsls.lua | 4 |
17 files changed, 20 insertions, 35 deletions
diff --git a/lsp/basedpyright.lua b/lsp/basedpyright.lua index 9f93b9f1..ad3b03b7 100644 --- a/lsp/basedpyright.lua +++ b/lsp/basedpyright.lua @@ -15,7 +15,7 @@ local function set_python_path(path) else client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } }) end - client.notify('workspace/didChangeConfiguration', { settings = nil }) + client:notify('workspace/didChangeConfiguration', { settings = nil }) end end diff --git a/lsp/biome.lua b/lsp/biome.lua index f7209042..88faa714 100644 --- a/lsp/biome.lua +++ b/lsp/biome.lua @@ -47,7 +47,7 @@ return { local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } local project_root = vim.fs.root(bufnr, project_root_markers) if not project_root then - return nil + return end -- We know that the buffer is using Biome if it has a config file @@ -63,7 +63,7 @@ return { stop = vim.fs.dirname(project_root), })[1] if not is_buffer_using_biome then - return nil + return end on_dir(project_root) diff --git a/lsp/clangd.lua b/lsp/clangd.lua index 1a1c1072..07ad3470 100644 --- a/lsp/clangd.lua +++ b/lsp/clangd.lua @@ -82,15 +82,12 @@ return { }, offsetEncoding = { 'utf-8', 'utf-16' }, }, - ---@param client vim.lsp.Client ---@param init_result ClangdInitializeResult on_init = function(client, init_result) if init_result.offsetEncoding then client.offset_encoding = init_result.offsetEncoding end end, - ---@param client vim.lsp.Client - ---@param bufnr integer on_attach = function(client, bufnr) vim.api.nvim_buf_create_user_command(bufnr, 'LspClangdSwitchSourceHeader', function() switch_source_header(bufnr, client) diff --git a/lsp/custom_elements_ls.lua b/lsp/custom_elements_ls.lua index 3103f564..86e8a1a7 100644 --- a/lsp/custom_elements_ls.lua +++ b/lsp/custom_elements_ls.lua @@ -27,5 +27,5 @@ return { init_options = { hostInfo = 'neovim' }, cmd = { 'custom-elements-languageserver', '--stdio' }, - root_dir = { 'tsconfig.json', 'package.json', 'jsconfig.json', '.git' }, + root_markers = { 'tsconfig.json', 'package.json', 'jsconfig.json', '.git' }, } diff --git a/lsp/denols.lua b/lsp/denols.lua index 90155126..8c051fbf 100644 --- a/lsp/denols.lua +++ b/lsp/denols.lua @@ -98,7 +98,7 @@ return { client:exec_cmd({ command = 'deno.cache', arguments = { {}, vim.uri_from_bufnr(bufnr) }, - }, { bufnr = bufnr }, function(err, _result, ctx) + }, { bufnr = bufnr }, function(err, _, ctx) if err then local uri = ctx.params.arguments[2] vim.notify('cache command failed for' .. vim.uri_to_fname(uri), vim.log.levels.ERROR) diff --git a/lsp/ds_pinyin_lsp.lua b/lsp/ds_pinyin_lsp.lua index 1c3a9643..68a99faa 100644 --- a/lsp/ds_pinyin_lsp.lua +++ b/lsp/ds_pinyin_lsp.lua @@ -23,7 +23,7 @@ end local function ds_pinyin_lsp_off(bufnr) local ds_pinyin_lsp_client = vim.lsp.get_clients({ bufnr = bufnr, name = 'ds_pinyin_lsp' })[1] if ds_pinyin_lsp_client then - ds_pinyin_lsp_client.notify('$/turn/completion', { + ds_pinyin_lsp_client:notify('$/turn/completion', { ['completion_on'] = false, }) else @@ -34,7 +34,7 @@ end local function ds_pinyin_lsp_on(bufnr) local ds_pinyin_lsp_client = vim.lsp.get_clients({ bufnr = bufnr, name = 'ds_pinyin_lsp' })[1] if ds_pinyin_lsp_client then - ds_pinyin_lsp_client.notify('$/turn/completion', { + ds_pinyin_lsp_client:notify('$/turn/completion', { ['completion_on'] = true, }) else diff --git a/lsp/ltex_plus.lua b/lsp/ltex_plus.lua index dfbe14b5..c241cb74 100644 --- a/lsp/ltex_plus.lua +++ b/lsp/ltex_plus.lua @@ -32,10 +32,6 @@ local language_id_mapping = { text = 'plaintext', } -local function get_language_id(_, filetype) - return language_id_mapping[filetype] or filetype -end - ---@type vim.lsp.Config return { cmd = { 'ltex-ls-plus' }, @@ -60,7 +56,9 @@ return { 'xhtml', }, root_markers = { '.git' }, - get_language_id = get_language_id, + get_language_id = function(_, filetype) + return language_id_mapping[filetype] or filetype + end, settings = { ltex = { enabled = { diff --git a/lsp/marksman.lua b/lsp/marksman.lua index 52c4f3b6..fc1e048f 100644 --- a/lsp/marksman.lua +++ b/lsp/marksman.lua @@ -8,12 +8,9 @@ --- --- Pre-built binaries can be downloaded from https://github.com/artempyanykh/marksman/releases -local bin_name = 'marksman' -local cmd = { bin_name, 'server' } - ---@type vim.lsp.Config return { - cmd = cmd, + cmd = { 'marksman', 'server' }, filetypes = { 'markdown', 'markdown.mdx' }, root_markers = { '.marksman.toml', '.git' }, } diff --git a/lsp/pyright.lua b/lsp/pyright.lua index e2eaaecb..2df4a173 100644 --- a/lsp/pyright.lua +++ b/lsp/pyright.lua @@ -15,7 +15,7 @@ local function set_python_path(path) else client.config.settings = vim.tbl_deep_extend('force', client.config.settings, { python = { pythonPath = path } }) end - client.notify('workspace/didChangeConfiguration', { settings = nil }) + client:notify('workspace/didChangeConfiguration', { settings = nil }) end end diff --git a/lsp/scheme_langserver.lua b/lsp/scheme_langserver.lua index f524cc87..131dcd61 100644 --- a/lsp/scheme_langserver.lua +++ b/lsp/scheme_langserver.lua @@ -4,11 +4,9 @@ --- `scheme-langserver`, a language server protocol implementation for scheme. --- And for nvim user, please add .sls to scheme file extension list. -local cmd = { 'scheme-langserver', '~/.scheme-langserver.log', 'enable', 'disable' } - ---@type vim.lsp.Config return { - cmd = cmd, + cmd = { 'scheme-langserver', '~/.scheme-langserver.log', 'enable', 'disable' }, filetypes = { 'scheme' }, root_markers = { 'Akku.manifest', diff --git a/lsp/svelte.lua b/lsp/svelte.lua index 17f10d4c..3f9aae82 100644 --- a/lsp/svelte.lua +++ b/lsp/svelte.lua @@ -34,6 +34,7 @@ return { }) vim.api.nvim_buf_create_user_command(bufnr, 'LspMigrateToSvelte5', function() client:exec_cmd({ + title = 'Migrate Component to Svelte 5 Syntax', command = 'migrate_to_svelte_5', arguments = { vim.uri_from_bufnr(bufnr) }, }) diff --git a/lsp/svlangserver.lua b/lsp/svlangserver.lua index 957d7ac8..83fc35b9 100644 --- a/lsp/svlangserver.lua +++ b/lsp/svlangserver.lua @@ -20,8 +20,6 @@ return { includeIndexing = { '*.{v,vh,sv,svh}', '**/*.{v,vh,sv,svh}' }, }, }, - ---@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({ diff --git a/lsp/texlab.lua b/lsp/texlab.lua index 17984848..cf6a5215 100644 --- a/lsp/texlab.lua +++ b/lsp/texlab.lua @@ -164,8 +164,6 @@ return { formatterLineLength = 80, }, }, - ---@param client vim.lsp.Client - ---@param bufnr integer on_attach = function(client, bufnr) for _, cmd in ipairs({ { name = 'TexlabBuild', fn = buf_build, desc = 'Build the current buffer' }, diff --git a/lsp/tinymist.lua b/lsp/tinymist.lua index bb88e0c4..f02ff194 100644 --- a/lsp/tinymist.lua +++ b/lsp/tinymist.lua @@ -50,8 +50,6 @@ return { cmd = { 'tinymist' }, filetypes = { 'typst' }, root_markers = { '.git' }, - ---@param client vim.lsp.Client - ---@param bufnr integer on_attach = function(client, bufnr) for _, command in ipairs { 'tinymist.exportSvg', diff --git a/lsp/ts_ls.lua b/lsp/ts_ls.lua index ddea6f53..b5ce0158 100644 --- a/lsp/ts_ls.lua +++ b/lsp/ts_ls.lua @@ -61,7 +61,7 @@ return { local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } local project_root = vim.fs.root(bufnr, project_root_markers) if not project_root then - return nil + return end -- We know that the buffer is using Typescript if it has a config file @@ -75,7 +75,7 @@ return { stop = vim.fs.dirname(project_root), })[1] if not is_buffer_using_typescript then - return nil + return end on_dir(project_root) diff --git a/lsp/tsgo.lua b/lsp/tsgo.lua index a56dfcda..28cdf6b9 100644 --- a/lsp/tsgo.lua +++ b/lsp/tsgo.lua @@ -32,7 +32,7 @@ return { local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } local project_root = vim.fs.root(bufnr, project_root_markers) if not project_root then - return nil + return end -- We know that the buffer is using Typescript if it has a config file @@ -46,7 +46,7 @@ return { stop = vim.fs.dirname(project_root), })[1] if not is_buffer_using_typescript then - return nil + return end on_dir(project_root) diff --git a/lsp/vtsls.lua b/lsp/vtsls.lua index 50ed654d..c643d68f 100644 --- a/lsp/vtsls.lua +++ b/lsp/vtsls.lua @@ -84,7 +84,7 @@ return { local project_root_markers = { 'package-lock.json', 'yarn.lock', 'pnpm-lock.yaml', 'bun.lockb', 'bun.lock' } local project_root = vim.fs.root(bufnr, project_root_markers) if not project_root then - return nil + return end -- We know that the buffer is using Typescript if it has a config file @@ -98,7 +98,7 @@ return { stop = vim.fs.dirname(project_root), })[1] if not is_buffer_using_typescript then - return nil + return end on_dir(project_root) |
