diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-26 21:28:33 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-26 21:28:33 +0800 |
commit | 32f85a5757c6fca2529e287a58d358da54a422e4 (patch) | |
tree | 2291611aed343480e51fde73a84eee6eaaf71736 /script/vm | |
parent | eb0735fd4cb9530dfa6534d7424d08155e4fb619 (diff) | |
download | lua-language-server-32f85a5757c6fca2529e287a58d358da54a422e4.zip |
fix #1092
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/compiler.lua | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 2b63e868..75620d19 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -575,6 +575,11 @@ local function bindDocs(source) vm.setNode(source, vm.compileNode(ast)) return true end + if doc.type == 'doc.overload' then + if not isParam then + vm.setNode(source, vm.compileNode(doc)) + end + end end return false end @@ -886,18 +891,6 @@ local function compileLocal(source) vm.compileNode(source.parent) end - if source.bindDocs then - local isParam = source.parent.type == 'funcargs' - or source.parent.type == 'in' - for _, doc in ipairs(source.bindDocs) do - if doc.type == 'doc.overload' then - if not isParam then - vm.setNode(source, vm.compileNode(doc)) - end - end - end - end - vm.getNode(source):setData('hasDefined', hasMarkDoc or hasMarkParam or hasMarkValue) end |