From 29c72cdf4a4913c152f037865cb28c78a8930340 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Mon, 25 Nov 2024 11:48:11 -0600 Subject: fix(lsp): retrigger diagnostics request on server cancellation (#31345) Co-authored-by: Jesse --- runtime/lua/vim/lsp/protocol.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua/vim/lsp/protocol.lua') diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 7db48b0c06..3d29dad90a 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -174,6 +174,7 @@ local constants = { -- Defined by the protocol. RequestCancelled = -32800, ContentModified = -32801, + ServerCancelled = -32802, }, -- Describes the content type that a client supports in various -- cgit From a1e313ded6e4c46c58012639e5c0c6d0b009d52a Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Fri, 29 Nov 2024 20:40:32 +0800 Subject: feat(lsp): support `textDocument/foldingRange` (#31311) * refactor(shared): extract `vim._list_insert` and `vim._list_remove` * feat(lsp): add `vim.lsp.foldexpr()` * docs(lsp): add a todo for state management * feat(lsp): add `vim.lsp.folding_range.foldclose()` * feat(lsp): schedule `foldclose()` if the buffer is not up-to-date * feat(lsp): add `vim.lsp.foldtext()` * feat(lsp): support multiple folding range providers * refactor(lsp): expose all folding related functions under `vim.lsp.*` * perf(lsp): add `lsp.MultiHandler` for do `foldupdate()` only once --- runtime/lua/vim/lsp/protocol.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime/lua/vim/lsp/protocol.lua') diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 3d29dad90a..cfd47d8f7c 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -440,6 +440,13 @@ function protocol.make_client_capabilities() properties = { 'command' }, }, }, + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + foldingRange = { + collapsedText = true, + }, + }, formatting = { dynamicRegistration = true, }, -- cgit From 6aa42e8f92bd8bea49b7b2accfe4ab67a5344e41 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Fri, 24 Jan 2025 13:01:25 +0000 Subject: fix: resolve all remaining LuaLS diagnostics --- runtime/lua/vim/lsp/protocol.lua | 7 ------- 1 file changed, 7 deletions(-) (limited to 'runtime/lua/vim/lsp/protocol.lua') diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index cfd47d8f7c..fbfd0cd6b0 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -15,7 +15,6 @@ local sysname = vim.uv.os_uname().sysname --- @class vim.lsp.protocol.constants --- @nodoc local constants = { - --- @enum lsp.DiagnosticSeverity DiagnosticSeverity = { -- Reports an error. Error = 1, @@ -27,7 +26,6 @@ local constants = { Hint = 4, }, - --- @enum lsp.DiagnosticTag DiagnosticTag = { -- Unused or unnecessary code Unnecessary = 1, @@ -35,7 +33,6 @@ local constants = { Deprecated = 2, }, - ---@enum lsp.MessageType MessageType = { -- An error message. Error = 1, @@ -50,7 +47,6 @@ local constants = { }, -- The file event type. - ---@enum lsp.FileChangeType FileChangeType = { -- The file got created. Created = 1, @@ -149,7 +145,6 @@ local constants = { }, -- Represents reasons why a text document is saved. - ---@enum lsp.TextDocumentSaveReason TextDocumentSaveReason = { -- Manually triggered, e.g. by the user pressing save, by starting debugging, -- or by an API call. @@ -246,7 +241,6 @@ local constants = { -- Defines whether the insert text in a completion item should be interpreted as -- plain text or a snippet. - --- @enum lsp.InsertTextFormat InsertTextFormat = { -- The primary text to be inserted is treated as a plain string. PlainText = 1, @@ -305,7 +299,6 @@ local constants = { SourceOrganizeImports = 'source.organizeImports', }, -- The reason why code actions were requested. - ---@enum lsp.CodeActionTriggerKind CodeActionTriggerKind = { -- Code actions were explicitly requested by the user or by an extension. Invoked = 1, -- cgit