summaryrefslogtreecommitdiff
path: root/script/core/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-12-15 11:42:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-12-15 11:42:11 +0800
commit3417d0696d8a0c2847c20af6235165221d2a70fd (patch)
treeaa52f47c0e08fc9dace3652af520de42606a251f /script/core/completion
parent90861b509d62c59ee32212ee2dda2d2fb4f04ff1 (diff)
downloadlua-language-server-3417d0696d8a0c2847c20af6235165221d2a70fd.zip
`FIX` completion: incorrect cache
Diffstat (limited to 'script/core/completion')
-rw-r--r--script/core/completion/completion.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index cb2ce8dd..efd62fb6 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -1945,6 +1945,7 @@ local function makeCache(uri, position, results)
cache.position= position
cache.word = word:lower()
cache.length = #word
+ cache.uri = uri
end
local function isValidCache(word, result)
@@ -1969,6 +1970,9 @@ local function getCache(uri, position)
if not cache.results then
return nil
end
+ if cache.uri ~= uri then
+ return nil
+ end
local text = files.getText(uri)
local state = files.getState(uri)
local word = lookBackward.findWord(text, guide.positionToOffset(state, position))