summaryrefslogtreecommitdiff
path: root/script/core/completion/completion.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/core/completion/completion.lua')
-rw-r--r--script/core/completion/completion.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index c457a14a..6edfac91 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -645,14 +645,11 @@ local function checkCommon(state, word, position, results)
for _, data in ipairs(keyWordMap) do
used[data[1]] = true
end
- if not config.get(state.uri, 'Lua.completion.workspaceWord')
- or #word >= 2 then
- results.complete = true
- end
if config.get(state.uri, 'Lua.completion.workspaceWord') and #word >= 2 then
local myHead = word:sub(1, 2)
for uri in files.eachFile() do
if #results >= 100 then
+ results.incomplete = true
break
end
if myUri == uri then
@@ -702,6 +699,7 @@ local function checkCommon(state, word, position, results)
end
for str, offset in state.lua:gmatch '([%a_][%w_]+)()' do
if #results >= 100 then
+ results.incomplete = true
break
end
if #str >= 3
@@ -716,9 +714,6 @@ local function checkCommon(state, word, position, results)
end
end
end
- if #results >= 100 then
- results.complete = false
- end
end
local function checkKeyWord(state, start, position, word, hasSpace, afterLocal, results)
@@ -1973,7 +1968,7 @@ end
---@async
local function completion(uri, position, triggerCharacter)
- local state = files.getState(uri)
+ local state = files.getLastState(uri) or files.getState(uri)
if not state then
return nil
end