diff options
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/hover/description.lua | 13 | ||||
-rw-r--r-- | script/core/hover/table.lua | 12 |
2 files changed, 16 insertions, 9 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index 1f276864..5f5c50f6 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -268,15 +268,16 @@ local function getBindEnums(source, docGroup) return table.concat(chunks, '\n\n') end -local function tryDocFieldUpComment(source) +local function tryDocFieldComment(source) if source.type ~= 'doc.field' then return end - if not source.bindGroup then - return + if source.comment then + return normalizeComment(source.comment.text, guide.getUri(source)) + end + if source.bindGroup then + return getBindComment(source) end - local comment = getBindComment(source) - return comment end local function getFunctionComment(source) @@ -394,7 +395,7 @@ return function (source) source = source.parent end return tryDocOverloadToComment(source) - or tryDocFieldUpComment(source) + or tryDocFieldComment(source) or tyrDocParamComment(source) or tryDocComment(source) or tryDocClassComment(source) diff --git a/script/core/hover/table.lua b/script/core/hover/table.lua index 3a2b7c77..677fd76c 100644 --- a/script/core/hover/table.lua +++ b/script/core/hover/table.lua @@ -178,9 +178,15 @@ return function (source) return nil end - for view in vm.getInfer(source):eachView(uri) do - if view == 'string' - or (view ~= 'unknown' and view ~= 'any' and vm.isSubType(uri, view, 'string')) then + local node = vm.compileNode(source) + for n in node:eachObject() do + if n.type == 'global' and n.cate == 'type' then + if n.name == 'string' + or (n.name ~= 'unknown' and n.name ~= 'any' and vm.isSubType(uri, n.name, 'string')) then + return nil + end + elseif n.type == 'doc.type.string' + or n.type == 'string' then return nil end end |