diff options
author | uhziel <uhziel@gmail.com> | 2020-12-14 11:10:03 +0800 |
---|---|---|
committer | uhziel <uhziel@gmail.com> | 2020-12-14 11:10:03 +0800 |
commit | f05b8a9b522989e83f28ce0511d5468d7300b40d (patch) | |
tree | 56b515671335acb8fc63709529deda255497a47c /script/parser | |
parent | cbacf3202f6162073aad1433ef0197b7b16f79bc (diff) | |
parent | 035f4393ab98b0de30650af94375d9c5e2fe07c1 (diff) | |
download | lua-language-server-f05b8a9b522989e83f28ce0511d5468d7300b40d.zip |
合并 master 中的提交
Diffstat (limited to 'script/parser')
-rw-r--r-- | script/parser/guide.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua index fcf96aa2..5fcfc0f3 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -1405,9 +1405,14 @@ function m.checkSameSimpleInValueOfSetMetaTable(status, func, start, queue) end function m.checkSameSimpleInValueOfCallMetaTable(status, call, start, queue) + if status.crossMetaTableMark then + return + end + status.crossMetaTableMark = true if call.type == 'call' then m.checkSameSimpleInValueOfSetMetaTable(status, call.node, start, queue) end + status.crossMetaTableMark = false end function m.checkSameSimpleInSpecialBranch(status, obj, start, queue) @@ -2945,17 +2950,17 @@ local function getDocAliasExtends(status, typeUnit) return nil end -local function getDocTypeUnitName(status, unit) +function m.getDocTypeUnitName(status, unit) local typeName if unit.type == 'doc.type.name' then typeName = unit[1] elseif unit.type == 'doc.type.function' then typeName = 'function' elseif unit.type == 'doc.type.array' then - typeName = getDocTypeUnitName(status, unit.node) .. '[]' + typeName = m.getDocTypeUnitName(status, unit.node) .. '[]' elseif unit.type == 'doc.type.generic' then typeName = ('%s<%s, %s>'):format( - getDocTypeUnitName(status, unit.node), + m.getDocTypeUnitName(status, unit.node), m.viewInferType(m.getDocTypeNames(status, unit.key)), m.viewInferType(m.getDocTypeNames(status, unit.value)) ) @@ -2979,7 +2984,7 @@ function m.getDocTypeNames(status, doc) results[#results+1] = res end else - local typeName = getDocTypeUnitName(status, unit) + local typeName = m.getDocTypeUnitName(status, unit) results[#results+1] = { type = typeName, source = unit, |