diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-02-24 20:48:37 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-02-24 20:48:37 +0800 |
commit | 7995a21dc8af8696c77a07a7da7f0a218bea9c62 (patch) | |
tree | fa58b3c3cff3ea16e19d49733216cc813eb49e2b /script/vm | |
parent | b6961992f21751f0948a5dc5e933b0da2cd11dc6 (diff) | |
download | lua-language-server-7995a21dc8af8696c77a07a7da7f0a218bea9c62.zip |
update
Diffstat (limited to 'script/vm')
-rw-r--r-- | script/vm/getDef.lua | 9 | ||||
-rw-r--r-- | script/vm/node/compiler.lua | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/script/vm/getDef.lua b/script/vm/getDef.lua index 82fa84eb..3652012b 100644 --- a/script/vm/getDef.lua +++ b/script/vm/getDef.lua @@ -90,11 +90,12 @@ local searchFieldMap = util.switch() end) : getMap() -local nodeMap;nodeMap = util.switch() +local searchByNode +local nodeMap = util.switch() : case 'field' + : case 'method' : call(function (source, pushResult) - local parent = source.parent - nodeMap[parent.type](parent, pushResult) + searchByNode(source.parent, pushResult) end) : case 'getfield' : case 'setfield' @@ -150,7 +151,7 @@ end ---@param source parser.object ---@param pushResult fun(src: parser.object) -local function searchByNode(source, pushResult) +function searchByNode(source, pushResult) local node = nodeMap[source.type] if node then node(source, pushResult) diff --git a/script/vm/node/compiler.lua b/script/vm/node/compiler.lua index 24b8a5dd..3a51fc4c 100644 --- a/script/vm/node/compiler.lua +++ b/script/vm/node/compiler.lua @@ -146,6 +146,9 @@ local compilerMap = util.switch() end end end + if source.dummy then + m.setNode(source, m.compileNode(source.method.node)) + end end) : case 'getlocal' : call(function (source) |