summaryrefslogtreecommitdiff
path: root/script/vm/field.lua
diff options
context:
space:
mode:
authorAlexCai2019 <89138532+AlexCai2019@users.noreply.github.com>2022-05-08 01:43:28 +0800
committerGitHub <noreply@github.com>2022-05-08 01:43:28 +0800
commit0fd83c4ca9f82a02becab6c304a8a7de75098507 (patch)
treebe9790d9d4823fe728c5b36e94093fe5f42b7725 /script/vm/field.lua
parent89203efad8c9b5513e05ca4d5696107924865b10 (diff)
parent67b4c574849d1667e0ecb39c51aeed8e30b43056 (diff)
downloadlua-language-server-0fd83c4ca9f82a02becab6c304a8a7de75098507.zip
Merge branch 'sumneko:master' into master
Diffstat (limited to 'script/vm/field.lua')
-rw-r--r--script/vm/field.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/script/vm/field.lua b/script/vm/field.lua
index ba7cd4c1..5de838be 100644
--- a/script/vm/field.lua
+++ b/script/vm/field.lua
@@ -15,6 +15,15 @@ local searchByNodeSwitch = util.switch()
pushResult(source)
end)
+local function searchByLocalID(source, pushResult)
+ local fields = vm.getLocalFields(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 +44,7 @@ function vm.getFields(source)
end
end
+ searchByLocalID(source, pushResult)
searchByNode(source, pushResult)
return results