summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-24 11:56:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-24 11:56:07 +0800
commit91a09a1f08cbafe60212b13f5c62fa64f0d5ec4d (patch)
treed61bf2e4eaa15cc7be21f5ba61210f034612d3b0
parentccc724254cce1b0a8577424051735f9b722bd6f2 (diff)
downloadlua-language-server-91a09a1f08cbafe60212b13f5c62fa64f0d5ec4d.zip
description
-rw-r--r--script/core/completion/postfix.lua4
-rw-r--r--script/provider/markdown.lua4
2 files changed, 7 insertions, 1 deletions
diff --git a/script/core/completion/postfix.lua b/script/core/completion/postfix.lua
index ee4df4b4..71d3c616 100644
--- a/script/core/completion/postfix.lua
+++ b/script/core/completion/postfix.lua
@@ -3,6 +3,7 @@ local lookback = require 'core.look-backward'
local matchKey = require 'core.matchkey'
local subString = require 'core.substring'
local define = require 'proto.define'
+local markdown = require 'provider.markdown'
local actions = {}
@@ -79,6 +80,9 @@ local function checkPostFix(state, word, wordPosition, position, results)
results[#results+1] = {
label = action.key,
kind = define.CompletionItemKind.Event,
+ description= markdown()
+ : add('lua', newText)
+ : string(),
textEdit = {
start = wordPosition + 1,
finish = position,
diff --git a/script/provider/markdown.lua b/script/provider/markdown.lua
index 213c417d..6b7d24c8 100644
--- a/script/provider/markdown.lua
+++ b/script/provider/markdown.lua
@@ -13,7 +13,7 @@ end
---@param text string|markdown
function mt:add(language, text)
if not text then
- return
+ return self
end
self._cacheResult = nil
if type(text) == 'table' then
@@ -29,6 +29,7 @@ function mt:add(language, text)
text = text,
}
end
+ return self
end
function mt:splitLine()
@@ -36,6 +37,7 @@ function mt:splitLine()
self[#self+1] = {
type = 'splitline',
}
+ return self
end
function mt:string()