From cc15ba212c7992c3f3aae8b90962862572b21e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maria=20Jos=C3=A9=20Solano?= Date: Sun, 18 Feb 2024 14:52:16 -0800 Subject: [PATCH] refactor(lsp): typings for protocol constants --- runtime/lua/vim/lsp/protocol.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 35eb0305d7..82e8c4a7de 100644 --- 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)(),