diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-19 01:08:44 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-19 01:08:44 +0800 |
commit | e36ca2b3e0629a8f67b4b2af34e938f66661e788 (patch) | |
tree | b15683169147dc7b27884139cf700989e027c128 /script/vm/field.lua | |
parent | 8a2cab337274c92913c2f60c57e756c10ac72d72 (diff) | |
download | lua-language-server-e36ca2b3e0629a8f67b4b2af34e938f66661e788.zip |
fix #1051
Diffstat (limited to 'script/vm/field.lua')
-rw-r--r-- | script/vm/field.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/script/vm/field.lua b/script/vm/field.lua index ba7cd4c1..614dc89b 100644 --- a/script/vm/field.lua +++ b/script/vm/field.lua @@ -2,6 +2,7 @@ local vm = require 'vm.vm' local util = require 'utility' local guide = require 'parser.guide' +local localID = require 'vm.local-id' local searchByNodeSwitch = util.switch() : case 'global' @@ -15,6 +16,15 @@ local searchByNodeSwitch = util.switch() pushResult(source) end) +local function searchByLocalID(source, pushResult) + local fields = localID.getFields(source) + if fields then + for _, field in ipairs(fields) do + pushResult(field) + end + end +end + local function searchByNode(source, pushResult) local uri = guide.getUri(source) vm.compileByParentNode(source, nil, true, function (field) @@ -35,6 +45,7 @@ function vm.getFields(source) end end + searchByLocalID(source, pushResult) searchByNode(source, pushResult) return results |