summaryrefslogtreecommitdiff
path: root/server/src/core/references.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/core/references.lua')
-rw-r--r--server/src/core/references.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/server/src/core/references.lua b/server/src/core/references.lua
index 10d8b2df..33b38fec 100644
--- a/server/src/core/references.lua
+++ b/server/src/core/references.lua
@@ -1,13 +1,13 @@
local findSource = require 'core.find_source'
local function parseResult(vm, source, declarat, callback)
+ local isGlobal
if source:bindLabel() then
source:bindLabel():eachInfo(function (info, src)
if (declarat and info.type == 'set') or info.type == 'get' then
callback(src)
end
end)
- return
end
if source:bindLocal() then
local loc = source:bindLocal()
@@ -22,7 +22,6 @@ local function parseResult(vm, source, declarat, callback)
callback(src)
end
end)
- return
end
if source:bindFunction() then
if declarat then
@@ -40,6 +39,9 @@ local function parseResult(vm, source, declarat, callback)
callback(src)
end
end)
+ if source:bindValue():isGlobal() then
+ isGlobal = true
+ end
end
local parent = source:get 'parent'
if parent then
@@ -51,6 +53,13 @@ local function parseResult(vm, source, declarat, callback)
end
end)
end
+ --local emmy = source:getEmmy()
+ --if emmy then
+ -- if emmy.type == 'emmy.class' or emmy.type == 'emmy.type' --then
+--
+ -- end
+ --end
+ return isGlobal
end
return function (vm, pos, declarat)
@@ -60,7 +69,7 @@ return function (vm, pos, declarat)
end
local positions = {}
local mark = {}
- parseResult(vm, source, declarat, function (src)
+ local isGlobal = parseResult(vm, source, declarat, function (src)
if mark[src] then
return
end
@@ -78,5 +87,5 @@ return function (vm, pos, declarat)
uri,
}
end)
- return positions
+ return positions, isGlobal
end