diff options
author | Maria José Solano <majosolano99@gmail.com> | 2024-10-15 02:36:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-15 02:36:04 -0700 |
commit | e0a5c3bb581752569df4490b48cb54e7c1ab0613 (patch) | |
tree | 97e6936d443d2cb7f4da14a04a285ac16034f1dd /test | |
parent | 74a161477266b3c131076ac572c5d4b577593ec4 (diff) | |
download | rneovim-e0a5c3bb581752569df4490b48cb54e7c1ab0613.tar.gz rneovim-e0a5c3bb581752569df4490b48cb54e7c1ab0613.tar.bz2 rneovim-e0a5c3bb581752569df4490b48cb54e7c1ab0613.zip |
fix(lsp): handle multiline signature help labels #30460
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index 9956fdf628..0ab384a032 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -3519,6 +3519,30 @@ describe('LSP', function() local expected = { '```cs', 'TestEntity.TestEntity()', '```', 'some doc' } eq(expected, result) end) + + it('highlights active parameters in multiline signature labels', function() + local _, hl = exec_lua(function() + local signature_help = { + activeSignature = 0, + signatures = { + { + activeParameter = 1, + label = 'fn bar(\n _: void,\n _: void,\n) void', + parameters = { + { label = '_: void' }, + { label = '_: void' }, + }, + }, + }, + } + return vim.lsp.util.convert_signature_help_to_markdown_lines(signature_help, 'zig', { '(' }) + end) + -- Note that although the higlight positions below are 0-indexed, the 2nd parameter + -- corresponds to the 3rd line because the first line is the ``` from the + -- Markdown block. + local expected = { 3, 4, 3, 11 } + eq(expected, hl) + end) end) describe('lsp.util.get_effective_tabstop', function() |