summaryrefslogtreecommitdiff
path: root/server-beta/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/core')
-rw-r--r--server-beta/src/core/definition.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/server-beta/src/core/definition.lua b/server-beta/src/core/definition.lua
index 6f6689b4..fd01072e 100644
--- a/server-beta/src/core/definition.lua
+++ b/server-beta/src/core/definition.lua
@@ -37,22 +37,24 @@ function m.aslocal(state, ast, source)
end
end
-function m.assetglobal(state, ast, source)
+function m.globals(state, ast, source)
local name = source[1]
- guide.eachSourceOf(ast.root, 'setglobal', function (src)
- if src[1] == name then
+ guide.eachGloabl(ast.root, function (src, gname)
+ if name ~= gname then
+ return
+ end
+ if src.type == 'setglobal' or src.type == 'setfield' then
state.callback(src, ast.uri)
end
end)
end
+function m.assetglobal(state, ast, source)
+ m.globals(state, ast, source)
+end
+
function m.asgetglobal(state, ast, source)
- local name = source[1]
- guide.eachSourceOf(ast.root, 'setglobal', function (src)
- if src[1] == name then
- state.callback(src, ast.uri)
- end
- end)
+ m.globals(state, ast, source)
end
return function (ast, text, offset)