diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-05-25 17:01:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-05-25 17:01:53 +0800 |
commit | 556be25be00f3ec346f27d13ebddf8bd99985ef2 (patch) | |
tree | 538723140adad06bfde33c8df36e8330c224e2eb /script/vm | |
parent | adc1c1ba2f1039d36655f9042f0e16053115e88a (diff) | |
download | lua-language-server-556be25be00f3ec346f27d13ebddf8bd99985ef2.zip |
special treat `__*`
#2106
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/compiler.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index dc22f6b9..f455d6da 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1341,8 +1341,8 @@ local compilerSwitch = util.switch() hasMarkDoc = vm.bindDocs(source) end + local key = guide.getKeyName(source) if not hasMarkDoc then - local key = guide.getKeyName(source) if key then vm.compileByParentNode(source.node, key, function (src) if src.type == 'doc.field' @@ -1368,7 +1368,8 @@ local compilerSwitch = util.switch() end if source.value then - if not hasMarkDoc or source.value.type == 'table' then + if not hasMarkDoc + or (type(key) == 'string' and util.stringStartWith(key, '__')) then vm.setNode(source, vm.compileNode(source.value)) end end |