summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-19 16:16:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-19 16:16:59 +0800
commitbed0c4911969b521fa3c15158df273c7e6106882 (patch)
tree027d3c032c4c2d210d015fe8bc45c4133ac925b3 /script
parent9ab7ed96dbb2218199a0370872146fe5c1fa14e1 (diff)
downloadlua-language-server-bed0c4911969b521fa3c15158df273c7e6106882.zip
continuous completion handles `textEdit.finish`
Diffstat (limited to 'script')
-rw-r--r--script/core/completion.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index a8500b09..8b1cbcf2 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -1709,6 +1709,7 @@ local function makeCache(uri, offset, results)
cache.results = results
cache.offset = offset
cache.word = word:lower()
+ cache.length = #word
end
local function getCache(uri, offset)
@@ -1725,6 +1726,14 @@ local function getCache(uri, offset)
return nil
end
+ local ext = #word - cache.length
+ cache.length = #word
+ for _, result in ipairs(cache.results) do
+ if result.textEdit then
+ result.textEdit.finish = result.textEdit.finish + ext
+ end
+ end
+
if cache.results.enableCommon then
local results = cache.results
for i = #results, 1, -1 do