Skip to content

Commit 9fa031a

Browse files
committed
fix runtime errors
1 parent 8f9d4b2 commit 9fa031a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

script/core/definition.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ return function (uri, offset)
134134
local defs = vm.getDefs(source)
135135

136136
for _, src in ipairs(defs) do
137+
if src.type == 'global' then
138+
goto CONTINUE
139+
end
137140
local root = guide.getRoot(src)
138141
if not root then
139142
goto CONTINUE

script/core/hover/init.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ local function getHover(source)
5858
else
5959
addHover(source, true, oop)
6060
for _, def in ipairs(vm.getDefs(source)) do
61+
if def.type == 'global' then
62+
goto CONTINUE
63+
end
6164
if guide.isOOP(def) then
6265
oop = true
6366
end
@@ -67,6 +70,7 @@ local function getHover(source)
6770
isFunction = true
6871
end
6972
addHover(def, isFunction, oop)
73+
::CONTINUE::
7074
end
7175
end
7276

0 commit comments

Comments
 (0)