summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/completion.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index 2204c369..83f684f3 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -30,6 +30,12 @@ local CompletionItemKind = {
TypeParameter = 25,
}
+local KEYS = {'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', 'return', 'then', 'true', 'until', 'while', 'toclose'}
+local KEYMAP = {}
+for _, k in ipairs(KEYS) do
+ KEYMAP[k] = true
+end
+
local function matchKey(me, other)
if me == other then
return true
@@ -223,6 +229,9 @@ local function searchFields(vm, source, word, callback)
if map[k] then
return
end
+ if KEYMAP[k] then
+ return
+ end
if info.type ~= 'set child' and info.type ~= 'get child' then
return
end
@@ -244,6 +253,9 @@ local function searchFields(vm, source, word, callback)
if map[k] then
return
end
+ if KEYMAP[k] then
+ return
+ end
if not v:getLib() then
return
end
@@ -292,7 +304,6 @@ local function searchCloseGlobal(vm, source, word, callback)
end)
end
-local KEYS = {'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', 'goto', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', 'return', 'then', 'true', 'until', 'while', 'toclose'}
local function searchKeyWords(vm, source, word, callback)
for _, key in ipairs(KEYS) do
if matchKey(word, key) then