diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-02-19 16:16:59 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-02-19 16:16:59 +0800 |
commit | bed0c4911969b521fa3c15158df273c7e6106882 (patch) | |
tree | 027d3c032c4c2d210d015fe8bc45c4133ac925b3 /script | |
parent | 9ab7ed96dbb2218199a0370872146fe5c1fa14e1 (diff) | |
download | lua-language-server-bed0c4911969b521fa3c15158df273c7e6106882.zip |
continuous completion handles `textEdit.finish`
Diffstat (limited to 'script')
-rw-r--r-- | script/core/completion.lua | 9 |
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 |