summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script-beta/parser/guide.lua3
-rw-r--r--script-beta/provider/diagnostic.lua1
-rw-r--r--test-beta/references/init.lua2
3 files changed, 5 insertions, 1 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 787926a3..ab842337 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1378,6 +1378,9 @@ function m.checkSameSimpleAsReturn(status, ref, start, queue)
end
-- TODO 这里的开销非常大
do return end
+ if ref.parent.parent.type ~= 'main' then
+ return
+ end
local newStatus = m.status(status)
m.searchRefsAsFunctionReturn(newStatus, ref, 'ref')
for _, res in ipairs(newStatus.results) do
diff --git a/script-beta/provider/diagnostic.lua b/script-beta/provider/diagnostic.lua
index 5285642a..1b4bab02 100644
--- a/script-beta/provider/diagnostic.lua
+++ b/script-beta/provider/diagnostic.lua
@@ -212,6 +212,7 @@ end
function m.start()
m._start = true
+
m.diagnosticsAll()
end
diff --git a/test-beta/references/init.lua b/test-beta/references/init.lua
index 11a5928b..3573da55 100644
--- a/test-beta/references/init.lua
+++ b/test-beta/references/init.lua
@@ -150,7 +150,7 @@ local <?x?>
local function f()
return <!x!>
end
-local <!y!> = f()
+local y = f()
]]
TEST [[