commit 443bbfd59e2818aeee72d2ed77af1cb24617e46f
parent a5f4ba74472f965953f0d3e45704c93b95f9b9a7
Author: Chris Kipp <ckipp@pm.me>
Date: Thu, 12 Jan 2023 15:51:19 +0100
docs(lsp): fix type annotation on convert_input_to_markdown_lines (#21772)
This small changes just ensures that if you're using `convert_input_to_markdown_lines`
without `contents` you don't get a warning (when using something like neodev) that
there is an expected second param, since it can be nil.
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
@@ -1508,8 +1508,8 @@ convert_input_to_markdown_lines({input}, {contents})
Parameters: ~
• {input} (`MarkedString` | `MarkedString[]` | `MarkupContent`)
- • {contents} (table, optional, default `{}`) List of strings to extend
- with converted lines
+ • {contents} (table|nil) List of strings to extend with converted
+ lines. Defaults to {}.
Return: ~
{contents}, extended with lines of converted markdown.
diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
@@ -856,7 +856,7 @@ end
--- `textDocument/signatureHelp`, and potentially others.
---
---@param input (`MarkedString` | `MarkedString[]` | `MarkupContent`)
----@param contents (table, optional, default `{}`) List of strings to extend with converted lines
+---@param contents (table|nil) List of strings to extend with converted lines. Defaults to {}.
---@returns {contents}, extended with lines of converted markdown.
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_hover
function M.convert_input_to_markdown_lines(input, contents)