+23
-1
lines changedFilter options
+23
-1
lines changed Original file line number Diff line number Diff line change
@@ -842,7 +842,8 @@ function M.convert_signature_help_to_markdown_lines(signature_help, ft, triggers
842
842
local active_hl
843
843
local active_signature = signature_help.activeSignature or 0
844
844
-- If the activeSignature is not inside the valid range, then clip it.
845
-
if active_signature >= #signature_help.signatures then
845
+
-- In 3.15 of the protocol, activeSignature was allowed to be negative
846
+
if active_signature >= #signature_help.signatures or active_signature < 0 then
846
847
active_signature = 0
847
848
end
848
849
local signature = signature_help.signatures[active_signature + 1]
Original file line number Diff line number Diff line change
@@ -2333,6 +2333,27 @@ describe('LSP', function()
2333
2333
end)
2334
2334
end)
2335
2335
2336
+
describe('lsp.util.convert_signature_help_to_markdown_lines', function()
2337
+
it('can handle negative activeSignature', function()
2338
+
local result = exec_lua[[
2339
+
local signature_help = {
2340
+
activeParameter = 0,
2341
+
activeSignature = -1,
2342
+
signatures = {
2343
+
{
2344
+
documentation = "",
2345
+
label = "TestEntity.TestEntity()",
2346
+
parameters = {}
2347
+
},
2348
+
}
2349
+
}
2350
+
return vim.lsp.util.convert_signature_help_to_markdown_lines(signature_help, 'cs', {','})
2351
+
]]
2352
+
local expected = {'```cs', 'TestEntity.TestEntity()', '```', ''}
2353
+
eq(expected, result)
2354
+
end)
2355
+
end)
2356
+
2336
2357
describe('lsp.util.get_effective_tabstop', function()
2337
2358
local function test_tabstop(tabsize, softtabstop)
2338
2359
exec_lua(string.format([[
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4