summaryrefslogtreecommitdiff
path: root/script-beta/core/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-10 21:55:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-10 21:55:52 +0800
commitf49a70c5a28ef163ffaf8fdc17dd0dbe3816c4e2 (patch)
treef42dda2981bf7c0e015949d0e3fb0ef1b433b542 /script-beta/core/completion.lua
parent147486a480a7ce5b56361751166f997def5f9b5b (diff)
downloadlua-language-server-f49a70c5a28ef163ffaf8fdc17dd0dbe3816c4e2.zip
修正bug
Diffstat (limited to 'script-beta/core/completion.lua')
-rw-r--r--script-beta/core/completion.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index f5ba1563..13b5998e 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -259,6 +259,7 @@ local keyWordMap = {
{'and'},
{'break'},
{'do', function (ast, text, start, results)
+ --local stop = guide.eachSourceContain()
if config.config.completion.keywordSnippet then
guide.eachSourceContain()
results[#results+1] = {
@@ -342,7 +343,10 @@ local function checkKeyWord(ast, text, start, word, results)
}
local func = data[2]
if func then
- func(ast, text, start, results)
+ local stop = func(ast, text, start, results)
+ if stop then
+ return true
+ end
end
end
end
@@ -359,10 +363,13 @@ local function tryWord(ast, text, offset, results)
if parent then
checkField(word, start, parent, oop, results)
else
+ local stop = checkKeyWord(ast, text, start, word, results)
+ if stop then
+ return
+ end
checkLocal(ast, word, start, results)
local env = guide.getLocal(ast.ast, '_ENV', start)
checkField(word, start, env, false, results)
- checkKeyWord(ast, text, start, word, results)
end
end
checkCommon(word, text, results)