diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-11-22 13:31:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-11-22 13:31:30 +0800 |
commit | 9313b06d5c6558dca5d0ece8967c84fbab12543c (patch) | |
tree | f3588643c441ed3bcf0b35c79a4f47e0c8b5531c /script | |
parent | 65566ae751f77fabdd5b7d8aa985c3529d3800df (diff) | |
parent | 3db634a3a2e48a97772065e7e9da4d29a07a8098 (diff) | |
download | lua-language-server-9313b06d5c6558dca5d0ece8967c84fbab12543c.zip |
Merge branch 'bugfix'
Diffstat (limited to 'script')
-rw-r--r-- | script/core/noder.lua | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua index 374d2c9b..26f2592c 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -150,11 +150,23 @@ local function getFieldEventName(field) if not docFunc or docFunc.type ~= 'doc.type.function' then return nil end - local firstArg = docFunc.args and #docFunc.args == 2 and docFunc.args[1] + local firstArg = docFunc.args and docFunc.args[1] if not firstArg then return nil end - local secondArg = docFunc.args[2] + local secondArg + if firstArg.name[1] == 'self' then + firstArg = docFunc.args[2] + if not firstArg then + return nil + end + secondArg = docFunc.args[3] + else + secondArg = docFunc.args[2] + end + if not secondArg then + return + end local firstType = firstArg.extends if not firstType then return nil @@ -799,8 +811,10 @@ local function compileCallParam(noders, call, sourceID) if not nodeID then return end + local methodIndex = 0 if node.type == 'getmethod' then fixIndex = fixIndex + 1 + methodIndex = 1 end local eventNodeID for firstIndex, callArg in ipairs(call.args) do @@ -820,7 +834,7 @@ local function compileCallParam(noders, call, sourceID) local paramID = sformat('%s%s%s%s%s' , nodeID , PARAM_INDEX - , firstIndex + , firstIndex + methodIndex , PARAM_INDEX , secondIndex ) @@ -829,7 +843,7 @@ local function compileCallParam(noders, call, sourceID) local eventParamID = sformat('%s%s%s%s%s' , eventNodeID , PARAM_INDEX - , firstIndex + , firstIndex + methodIndex , PARAM_INDEX , secondIndex ) |