diff options
Diffstat (limited to 'script/vm/ref.lua')
-rw-r--r-- | script/vm/ref.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/script/vm/ref.lua b/script/vm/ref.lua index 0135d11f..247fb4db 100644 --- a/script/vm/ref.lua +++ b/script/vm/ref.lua @@ -26,6 +26,19 @@ simpleSwitch = util.switch() end end end) + : case 'doc.alias.name' + : call(function (source, pushResult) + local global = vm.getGlobal('type', source[1]) + if not global then + return + end + for _, get in ipairs(global:getGets(guide.getUri(source))) do + pushResult(get) + end + for _, set in ipairs(global:getSets(guide.getUri(source))) do + pushResult(set) + end + end) ---@async local function searchInAllFiles(suri, searcher, notify) @@ -173,6 +186,11 @@ local nodeSwitch = util.switch() : call(function (source, pushResult, defMap, fileNotify) searchField(source, pushResult, defMap, fileNotify) end) + : case 'doc.field.name' + ---@async + : call(function (source, pushResult, defMap, fileNotify) + searchField(source, pushResult, defMap, fileNotify) + end) : case 'function' : case 'doc.type.function' ---@async @@ -237,6 +255,9 @@ local function searchByDef(source, pushResult) or source.type == 'method' then source = source.parent end + if source.type == 'doc.field.name' then + source = source.parent + end defMap[source] = true if guide.isSet(source) then local defs = vm.getDefs(source) |