Skip to content

Commit ee4a4a4

Browse files
committed
fix(completion): update 'completionItem/resolve' to always fall back
Details: - Currently the 'completionItem/resolve' response falls back on the original LSP item only in case there was an explicit error. Which is a reasonable expectation (either error or response is not `nil`), but it seems to not be the case for some servers (and even not really a violation of the strict interpretation of the LSP specification). As 'completionItem/resolve' is a request that is intended to update an LSP completion item (used as argument), it is natural to always try to use it if the server didn't return its updated variant (for whatever reason). Resolve #2090 Resolve #1991 (probably)
1 parent 95dd9ee commit ee4a4a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/mini/completion.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,8 @@ H.info_window_lines = function(info_id)
15161516
-- Do nothing if completion item was changed
15171517
if H.info.id ~= info_id then return end
15181518

1519-
-- Still use original item if there was error during resolve
1520-
if err ~= nil then result = result or lsp_data.item end
1519+
-- Still use original item if there was no response (usually due to error)
1520+
result = result or lsp_data.item
15211521

15221522
H.info.lsp.result = result
15231523
-- - Cache resolved item to not have to send same request on revisit.

0 commit comments

Comments
 (0)