diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-21 16:44:21 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-21 16:44:21 +0800 |
commit | bc0ab7b1fa924076a549cdcaaf3e90a6ef67600f (patch) | |
tree | 6c93154af1822b87d02915bdcdb028fec48338f9 /server/src/method | |
parent | 70da60a80f2d00c235560f235d3f5ded703dfe4e (diff) | |
download | lua-language-server-bc0ab7b1fa924076a549cdcaaf3e90a6ef67600f.zip |
hover在外部完成格式化
Diffstat (limited to 'server/src/method')
-rw-r--r-- | server/src/method/textDocument/hover.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/server/src/method/textDocument/hover.lua b/server/src/method/textDocument/hover.lua index cf6c4aa4..3048d4f8 100644 --- a/server/src/method/textDocument/hover.lua +++ b/server/src/method/textDocument/hover.lua @@ -14,11 +14,21 @@ return function (lsp, params) return nil end - local text = matcher.hover(result, source, lsp) - if not text then + local results = matcher.hover(result, source, lsp) + if not results then return nil end + local text = ([[ +```lua +%s +``` +%s +```lua +%s +``` +]]):format(results[1], results[2], results[3] or '') + local response = { contents = { value = text, |