diff options
Diffstat (limited to 'script/vm/def.lua')
-rw-r--r-- | script/vm/def.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/script/vm/def.lua b/script/vm/def.lua index b66e8fda..83e92686 100644 --- a/script/vm/def.lua +++ b/script/vm/def.lua @@ -2,8 +2,6 @@ local vm = require 'vm.vm' local util = require 'utility' local guide = require 'parser.guide' -local localID = require 'vm.local-id' -local globalMgr = require 'vm.global-manager' local simpleSwitch @@ -79,6 +77,13 @@ simpleSwitch = util.switch() pushResult(source.node) end end) + : case 'doc.cast.name' + : call(function (source, pushResult) + local loc = guide.getLocal(source, source[1], source.start) + if loc then + pushResult(loc) + end + end) local searchFieldSwitch = util.switch() : case 'table' @@ -97,7 +102,7 @@ local searchFieldSwitch = util.switch() ---@param key string : call(function (suri, obj, key, pushResult) if obj.cate == 'variable' then - local newGlobal = globalMgr.getGlobal('variable', obj.name, key) + local newGlobal = vm.getGlobal('variable', obj.name, key) if newGlobal then for _, set in ipairs(newGlobal:getSets(suri)) do pushResult(set) @@ -110,7 +115,7 @@ local searchFieldSwitch = util.switch() end) : case 'local' : call(function (suri, obj, key, pushResult) - local sources = localID.getSources(obj, key) + local sources = vm.getLocalSources(obj, key) if sources then for _, src in ipairs(sources) do if guide.isSet(src) then @@ -189,7 +194,7 @@ end ---@param source parser.object ---@param pushResult fun(src: parser.object) local function searchByLocalID(source, pushResult) - local idSources = localID.getSources(source) + local idSources = vm.getLocalSources(source) if not idSources then return end |