diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-23 14:13:05 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-23 14:13:05 +0800 |
commit | 5c0f9c4672b564da6d54ac8649afe199e4d7b1d7 (patch) | |
tree | e3162f4c66c83fec20ab14a6060e333f29241b27 /script/vm | |
parent | 420812ce4e77ff4143437b2893dd77fc729c7622 (diff) | |
download | lua-language-server-5c0f9c4672b564da6d54ac8649afe199e4d7b1d7.zip |
revert `field drop nil`
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/compiler.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 70a4ea92..e3c08cb9 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -1388,7 +1388,7 @@ local compilerSwitch = util.switch() local uri = guide.getUri(source) local value = vm.getTableValue(uri, vm.compileNode(source.node), key) if value then - vm.setNode(source, value):removeOptional() + vm.setNode(source, value) end for k in key:eachObject() do if k.type == 'global' and k.cate == 'type' then @@ -1396,7 +1396,7 @@ local compilerSwitch = util.switch() vm.compileByParentNode(source.node, k, false, function (src) vm.setNode(source, vm.compileNode(src)) if src.value then - vm.setNode(source, vm.compileNode(src.value)):removeOptional() + vm.setNode(source, vm.compileNode(src.value)) end end) end @@ -1406,7 +1406,7 @@ local compilerSwitch = util.switch() vm.compileByParentNode(source.node, key, false, function (src) vm.setNode(source, vm.compileNode(src)) if src.value then - vm.setNode(source, vm.compileNode(src.value)):removeOptional() + vm.setNode(source, vm.compileNode(src.value)) end end) end @@ -1420,7 +1420,7 @@ local compilerSwitch = util.switch() vm.compileByParentNode(source.node, key, false, function (src) if src.type == 'doc.type.field' or src.type == 'doc.field' then - vm.setNode(source, vm.compileNode(src)):removeOptional() + vm.setNode(source, vm.compileNode(src)) end end) end) @@ -1450,13 +1450,13 @@ local compilerSwitch = util.switch() if src.type == 'doc.field' or src.type == 'doc.type.field' then hasMarkDoc = true - vm.setNode(source, vm.compileNode(src)):removeOptional() + vm.setNode(source, vm.compileNode(src)) end end) end if not hasMarkDoc and source.value then - vm.setNode(source, vm.compileNode(source.value)):removeOptional() + vm.setNode(source, vm.compileNode(source.value)) end end) |