summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-18 21:37:41 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-18 21:37:41 +0800
commit907bbbe0925e49f7b347cb81c20159f20dd98854 (patch)
treefd4210478cc77de8efc02b3783f48960e4ab7243 /script/provider
parent5e36ce84e925f9c6e8eeeb3f9406b68dc6feaba6 (diff)
downloadlua-language-server-907bbbe0925e49f7b347cb81c20159f20dd98854.zip
cleanup markdown
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/markdown.lua4
-rw-r--r--script/provider/provider.lua8
2 files changed, 8 insertions, 4 deletions
diff --git a/script/provider/markdown.lua b/script/provider/markdown.lua
index c5765571..5e564a40 100644
--- a/script/provider/markdown.lua
+++ b/script/provider/markdown.lua
@@ -4,6 +4,10 @@ mt.__name = 'markdown'
mt._splitLine = false
+function mt:__tostring()
+ return self:string()
+end
+
local function checkSplitLine(self)
if not self._splitLine then
return
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index c416e748..aebf733e 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -445,7 +445,7 @@ proto.on('textDocument/completion', function (params)
return t
end)(),
documentation = res.description and {
- value = res.description,
+ value = tostring(res.description),
kind = 'markdown',
},
}
@@ -455,7 +455,7 @@ proto.on('textDocument/completion', function (params)
if resolved then
item.detail = resolved.detail
item.documentation = resolved.description and {
- value = resolved.description,
+ value = tostring(resolved.description),
kind = 'markdown',
}
end
@@ -491,7 +491,7 @@ proto.on('completionItem/resolve', function (item)
end
item.detail = resolved.detail or item.detail
item.documentation = resolved.description and {
- value = resolved.description,
+ value = tostring(resolved.description),
kind = 'markdown',
} or item.documentation
item.additionalTextEdits = resolved.additionalTextEdits and (function ()
@@ -545,7 +545,7 @@ proto.on('textDocument/signatureHelp', function (params)
parameters = parameters,
activeParameter = result.index - 1,
documentation = result.description and {
- value = result.description,
+ value = tostring(result.description),
kind = 'markdown',
},
}