summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-12 13:54:28 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-12 13:54:28 +0800
commit2048a535657992ff5573c692541cf10b9146f3bd (patch)
tree9672d3a61b56ff2475b3abfd7490fb3328b5e30f /server/src/core
parent3e71bf6a712cc008e95caa2a3c38aa41b700d95d (diff)
downloadlua-language-server-2048a535657992ff5573c692541cf10b9146f3bd.zip
修正bug
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/completion.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua
index f5444e67..eab35ea0 100644
--- a/server/src/core/completion.lua
+++ b/server/src/core/completion.lua
@@ -338,6 +338,9 @@ local function searchInRequire(vm, select, source, callback)
return
end
local list = vm.lsp.workspace:matchPath(vm.uri, source[1])
+ if not list then
+ return
+ end
for _, str in ipairs(list) do
callback(str, nil, CompletionItemKind.File, {
textEdit = {
@@ -420,6 +423,9 @@ local function searchAllWords(vm, source, word, callback)
if word == '' then
return
end
+ if source.type == 'string' then
+ return
+ end
for _, src in ipairs(vm.sources) do
if src.type == 'name'
and matchKey(word, src[1])