summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-28 21:39:29 +0800
committersumneko <sumneko@hotmail.com>2019-04-28 21:39:29 +0800
commitc33348a12256d6f8cff17960f037d9615c002276 (patch)
treed7447d4ab8f45ac5ae4edf6b47bd4a436c00605d /server/src/core
parent2793fe8003d10c5d7db54a63f3e6140ce305fb92 (diff)
downloadlua-language-server-c33348a12256d6f8cff17960f037d9615c002276.zip
修正关键字有时捕获不到的bug
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/completion.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index 8659901f..c8147f9e 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -761,13 +761,16 @@ end
local function getSource(vm, pos, text, filter)
local word = findWord(pos, text)
- local source = findSource(vm, pos, filter)
+ local source = keywordSource(vm, word, pos)
+ if source then
+ return source, pos, word
+ end
+ source = findSource(vm, pos, filter)
if source then
return source, pos, word
end
pos = findStartPos(pos, text)
- source = findSource(vm, pos, filter)
- or keywordSource(vm, word, pos)
+ source = findSource(vm, pos, filter)
return source, pos, word
end