summaryrefslogtreecommitdiff
path: root/script-beta/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-08 18:21:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-08 18:21:27 +0800
commit9aa78df23915920738da936698cda56c7c883288 (patch)
treed95c331b2fbf6945d2b4abac0fd61c9295941975 /script-beta/provider
parent7a2ef1c1a699417ce7998bc088c68fc652d745af (diff)
downloadlua-language-server-9aa78df23915920738da936698cda56c7c883288.zip
字符串枚举值的自动完成
Diffstat (limited to 'script-beta/provider')
-rw-r--r--script-beta/provider/provider.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/script-beta/provider/provider.lua b/script-beta/provider/provider.lua
index 6916ff96..8a8bcef6 100644
--- a/script-beta/provider/provider.lua
+++ b/script-beta/provider/provider.lua
@@ -328,6 +328,15 @@ proto.on('textDocument/completion', function (params)
sortText = ('%04d'):format(i),
insertText = res.insertText,
insertTextFormat = res.insertTextFormat,
+ textEdit = res.textEdit and {
+ range = define.range(
+ lines,
+ text,
+ res.textEdit.start,
+ res.textEdit.finish
+ ),
+ newText = res.textEdit.newText,
+ },
documentation = res.description and {
value = res.description,
kind = 'markdown',