summaryrefslogtreecommitdiff
path: root/script/parser
diff options
context:
space:
mode:
authoruhziel <uhziel@gmail.com>2020-12-14 11:10:03 +0800
committeruhziel <uhziel@gmail.com>2020-12-14 11:10:03 +0800
commitf05b8a9b522989e83f28ce0511d5468d7300b40d (patch)
tree56b515671335acb8fc63709529deda255497a47c /script/parser
parentcbacf3202f6162073aad1433ef0197b7b16f79bc (diff)
parent035f4393ab98b0de30650af94375d9c5e2fe07c1 (diff)
downloadlua-language-server-f05b8a9b522989e83f28ce0511d5468d7300b40d.zip
合并 master 中的提交
Diffstat (limited to 'script/parser')
-rw-r--r--script/parser/guide.lua13
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,