Skip to content
Snippets Groups Projects
Commit 66b68f84 authored by 最萌小汐's avatar 最萌小汐
Browse files

only check one result

parent ee20f068
No related branches found
No related tags found
No related merge requests found
......@@ -22,10 +22,10 @@ return function (uri, callback)
end
local literal = arg1[1]
local results = ws.findUrisByRequirePath(literal)
local result = results and results[1]
if not result then
if not results or #results ~= 1 then
return
end
local result = results[1]
if not files.isLua(result) then
return
end
......
......@@ -135,3 +135,22 @@ TEST {
content = 'require "f.a"',
},
}
TEST {
{
path = 'a/init.lua',
content = '',
},
{
path = 'f/a.lua',
content = '',
},
{
path = 'b.lua',
content = 'require "a"',
},
{
path = 'c.lua',
content = 'require "f.a"',
},
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment