summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-06 15:15:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-06 15:15:07 +0800
commiteeb24f394050578dd575e6c9035230c0d51b2672 (patch)
treea7a3ce473fb7fdf0a05ca89e34b8dbe4fd6cb40c /script
parent48c53a36c6bad6662aabc8af98fb58d54ad9a498 (diff)
downloadlua-language-server-eeb24f394050578dd575e6c9035230c0d51b2672.zip
fix #1288
Diffstat (limited to 'script')
-rw-r--r--script/vm/compiler.lua24
1 files changed, 9 insertions, 15 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index cb54b054..67ca3b41 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -336,7 +336,6 @@ function vm.getClassFields(suri, object, key, ref, pushResult)
-- check local field and global field
if not hasFounded[key] and set.bindSources then
for _, src in ipairs(set.bindSources) do
- local skipSetLocal
if src.value and src.value.type == 'table' then
searchFieldSwitch('table', suri, src.value, key, ref, function (field)
local fieldKey = guide.getKeyName(field)
@@ -345,25 +344,20 @@ function vm.getClassFields(suri, object, key, ref, pushResult)
and guide.isSet(field) then
hasFounded[fieldKey] = true
pushResult(field, true)
- if src.type == 'local' then
- skipSetLocal = true
- end
end
end
end)
end
- if not skipSetLocal then
- searchFieldSwitch(src.type, suri, src, key, ref, function (field)
- local fieldKey = guide.getKeyName(field)
- if fieldKey then
- if not searchedFields[fieldKey]
- and guide.isSet(field) then
- hasFounded[fieldKey] = true
- pushResult(field, true)
- end
+ searchFieldSwitch(src.type, suri, src, key, ref, function (field)
+ local fieldKey = guide.getKeyName(field)
+ if fieldKey and not hasFounded[fieldKey] then
+ if not searchedFields[fieldKey]
+ and guide.isSet(field) then
+ hasFounded[fieldKey] = true
+ pushResult(field, true)
end
- end)
- end
+ end
+ end)
end
end
-- look into extends(if field not found)