summaryrefslogtreecommitdiff
path: root/script/core/completion.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-07-08 19:51:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-07-08 19:51:10 +0800
commitae3a20cfd5ea89919326a6499c5a3c93fdfe2120 (patch)
treeb4b337b82bda3a14f300ab30862efd12b6e10650 /script/core/completion.lua
parent5354d8c339ddb6487f3c0ec1b240eb3e93d19585 (diff)
downloadlua-language-server-ae3a20cfd5ea89919326a6499c5a3c93fdfe2120.zip
fix #187
Diffstat (limited to 'script/core/completion.lua')
-rw-r--r--script/core/completion.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index d0301d3a..5af72de0 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -8,6 +8,7 @@ local matchKey = require 'core.matchKey'
local parser = require 'parser'
local lang = require 'language'
local snippet = require 'core.snippet'
+local uric = require 'uri'
local State
local CompletionItemKind = {
@@ -674,11 +675,11 @@ local function searchInRequire(vm, source, callback)
if not vm.lsp then
return
end
- local ws = vm.lsp:findWorkspaceFor(vm.uri)
- if not ws then
+ if source.type ~= 'string' then
return
end
- if source.type ~= 'string' then
+ local ws = vm.lsp:findWorkspaceFor(vm.uri)
+ if not ws then
return
end
local list, map = ws:matchPath(vm.uri, source[1])