diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-04-08 11:36:34 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-04-08 11:36:34 +0800 |
commit | b30fb29123c55052268e33d585c1b3bfbb91e5ce (patch) | |
tree | 8a14f7af1c82d514c26e7efa9a1de85288572bc2 /script/core/completion.lua | |
parent | 65cc77a8f6dfe7bfaac51cc6245f0de9efbac72a (diff) | |
download | lua-language-server-b30fb29123c55052268e33d585c1b3bfbb91e5ce.zip |
use textEdit when label has symbol
Diffstat (limited to 'script/core/completion.lua')
-rw-r--r-- | script/core/completion.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua index a8a881a7..7db106d6 100644 --- a/script/core/completion.lua +++ b/script/core/completion.lua @@ -1519,6 +1519,11 @@ local function tryLuaDocBySource(ast, offset, source, results) results[#results+1] = { label = doc[1], kind = define.CompletionItemKind.Class, + textEdit = doc[1]:find '[^%w_]' and { + start = source.start, + finish = offset, + newText = doc[1], + }, } end end @@ -1532,6 +1537,11 @@ local function tryLuaDocBySource(ast, offset, source, results) results[#results+1] = { label = doc[1], kind = define.CompletionItemKind.Class, + textEdit = doc[1]:find '[^%w_]' and { + start = source.start, + finish = offset, + newText = doc[1], + }, } end end |