commit cc15ba212c7992c3f3aae8b90962862572b21e83
parent a9f578b7a5edbca9aa01548f37341c2b97b57cda
Author: Maria José Solano <majosolano99@gmail.com>
Date: Sun, 18 Feb 2024 14:52:16 -0800
refactor(lsp): typings for protocol constants
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
@@ -1,6 +1,6 @@
--- Protocol for the Microsoft Language Server Protocol (mslsp)
+--- @diagnostic disable: duplicate-doc-alias
-local protocol = {}
+-- Protocol for the Microsoft Language Server Protocol (mslsp)
--[=[
---@private
@@ -20,7 +20,7 @@ function transform_schema_to_table()
end
--]=]
-local constants = {
+local protocol = {
--- @enum lsp.DiagnosticSeverity
DiagnosticSeverity = {
-- Reports an error.
@@ -313,7 +313,7 @@ local constants = {
},
}
-for k, v in pairs(constants) do
+for k, v in pairs(protocol) do
local tbl = vim.deepcopy(v, true)
vim.tbl_add_reverse_lookup(tbl)
protocol[k] = tbl
@@ -723,7 +723,7 @@ function protocol.make_client_capabilities()
codeActionLiteralSupport = {
codeActionKind = {
valueSet = (function()
- local res = vim.tbl_values(constants.CodeActionKind)
+ local res = vim.tbl_values(protocol.CodeActionKind)
table.sort(res)
return res
end)(),