aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Lillis <will.lillis24@gmail.com>2025-03-11 10:22:20 -0400
committerGitHub <noreply@github.com>2025-03-11 07:22:20 -0700
commitdc1888fcfbba1f969ddc01100c466057dccbb58f (patch)
treeb4452e986eb8555b9c5a3172d3b06e349559abcd
parent8b5a0a00c8cfe776c4227862c3fb32a07d154663 (diff)
downloadrneovim-dc1888fcfbba1f969ddc01100c466057dccbb58f.tar.gz
rneovim-dc1888fcfbba1f969ddc01100c466057dccbb58f.tar.bz2
rneovim-dc1888fcfbba1f969ddc01100c466057dccbb58f.zip
refactor(lsp): rename `on_publish_diagnostics` parameter #32776
* fix(lsp): rename `on_publish_diagnostics` parameter: result->params * fix(colors): specify local var type to address lint failure
-rw-r--r--runtime/colors/vim.lua2
-rw-r--r--runtime/doc/lsp.txt4
-rw-r--r--runtime/lua/vim/lsp/diagnostic.lua6
3 files changed, 6 insertions, 6 deletions
diff --git a/runtime/colors/vim.lua b/runtime/colors/vim.lua
index dd59e5075d..f10cdedee0 100644
--- a/runtime/colors/vim.lua
+++ b/runtime/colors/vim.lua
@@ -17,7 +17,7 @@ local hi = function(name, val)
val.force = true
-- Make sure that `cterm` attribute is not populated from `gui`
- val.cterm = val.cterm or {}
+ val.cterm = val.cterm or {} ---@type vim.api.keyset.highlight
-- Define global highlight
vim.api.nvim_set_hl(0, name, val)
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index fd0df42fe4..f13a17cbef 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -1750,13 +1750,13 @@ on_diagnostic({error}, {result}, {ctx})
• {ctx} (`lsp.HandlerContext`)
*vim.lsp.diagnostic.on_publish_diagnostics()*
-on_publish_diagnostics({_}, {result}, {ctx})
+on_publish_diagnostics({_}, {params}, {ctx})
|lsp-handler| for the method "textDocument/publishDiagnostics"
See |vim.diagnostic.config()| for configuration options.
Parameters: ~
- • {result} (`lsp.PublishDiagnosticsParams`)
+ • {params} (`lsp.PublishDiagnosticsParams`)
• {ctx} (`lsp.HandlerContext`)
diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua
index fe24928a69..20c3882d23 100644
--- a/runtime/lua/vim/lsp/diagnostic.lua
+++ b/runtime/lua/vim/lsp/diagnostic.lua
@@ -237,10 +237,10 @@ end
--- See |vim.diagnostic.config()| for configuration options.
---
---@param _ lsp.ResponseError?
----@param result lsp.PublishDiagnosticsParams
+---@param params lsp.PublishDiagnosticsParams
---@param ctx lsp.HandlerContext
-function M.on_publish_diagnostics(_, result, ctx)
- handle_diagnostics(result.uri, ctx.client_id, result.diagnostics, false)
+function M.on_publish_diagnostics(_, params, ctx)
+ handle_diagnostics(params.uri, ctx.client_id, params.diagnostics, false)
end
--- |lsp-handler| for the method "textDocument/diagnostic"