summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-23 17:07:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-23 17:07:24 +0800
commit66b68f8453d98dbb3197926e0ad96764a4513ca2 (patch)
treefb88fef20b52adf114627ffae52873514b906ec3 /script
parentee20f068952aa4586e2976234aafd68d27190ec2 (diff)
downloadlua-language-server-66b68f8453d98dbb3197926e0ad96764a4513ca2.zip
only check one result
Diffstat (limited to 'script')
-rw-r--r--script/core/diagnostics/different-requires.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/script/core/diagnostics/different-requires.lua b/script/core/diagnostics/different-requires.lua
index 5b86d8de..909342f4 100644
--- a/script/core/diagnostics/different-requires.lua
+++ b/script/core/diagnostics/different-requires.lua
@@ -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