aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp_spec.lua
diff options
context:
space:
mode:
authorChristoph Hasse <hassec@users.noreply.github.com>2023-07-25 08:40:13 -0400
committerGitHub <noreply@github.com>2023-07-25 05:40:13 -0700
commit20c331915f4e317c615c7cfea469a9baedd2e4f7 (patch)
tree630a1a0b66f62efd97588296023d432173644062 /test/functional/plugin/lsp_spec.lua
parent898384ac6900aa5cb8ef84d53ad586ecf424a25c (diff)
downloadrneovim-20c331915f4e317c615c7cfea469a9baedd2e4f7.tar.gz
rneovim-20c331915f4e317c615c7cfea469a9baedd2e4f7.tar.bz2
rneovim-20c331915f4e317c615c7cfea469a9baedd2e4f7.zip
fix(lsp): SignatureHelp docstring is not escaped #16702
Problem: Nvim LSP client always treats signature.documentation as markdown, even if the server returns a plain string. Per https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#signatureInformation in a SignatureInformation response, the documentation field can be either "string" or "MarkupContent". Solution: If signature.documentation is a string, treat it as "plaintext". Closes #16563
Diffstat (limited to 'test/functional/plugin/lsp_spec.lua')
-rw-r--r--test/functional/plugin/lsp_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua
index 9a777e2742..7e34946d95 100644
--- a/test/functional/plugin/lsp_spec.lua
+++ b/test/functional/plugin/lsp_spec.lua
@@ -3006,7 +3006,7 @@ describe('LSP', function()
activeSignature = -1,
signatures = {
{
- documentation = "",
+ documentation = "some doc",
label = "TestEntity.TestEntity()",
parameters = {}
},
@@ -3014,7 +3014,7 @@ describe('LSP', function()
}
return vim.lsp.util.convert_signature_help_to_markdown_lines(signature_help, 'cs', {','})
]]
- local expected = {'```cs', 'TestEntity.TestEntity()', '```', ''}
+ local expected = {'```cs', 'TestEntity.TestEntity()', '```', '<text>', 'some doc', '</text>'}
eq(expected, result)
end)
end)