diff options
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/hover/label.lua | 2 | ||||
-rw-r--r-- | script-beta/core/hover/name.lua | 21 |
2 files changed, 21 insertions, 2 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua index 7533d3f1..67faefe6 100644 --- a/script-beta/core/hover/label.lua +++ b/script-beta/core/hover/label.lua @@ -20,7 +20,7 @@ local function asFunction(source, oop) end local function asDocFunction(source) - local name = '' + local name = buildName(source) local arg = buildArg(source) local rtn = buildReturn(source) local lines = {} diff --git a/script-beta/core/hover/name.lua b/script-beta/core/hover/name.lua index a1c40771..c30cf554 100644 --- a/script-beta/core/hover/name.lua +++ b/script-beta/core/hover/name.lua @@ -1,6 +1,8 @@ local guide = require 'parser.guide' local vm = require 'vm' +local buildName + local function asLocal(source) local name = guide.getName(source) if not source.attrs then @@ -67,7 +69,21 @@ local function asLibrary(source, oop) end end -local function buildName(source, oop) +local function asDocFunction(source) + local doc = guide.getParentType(source, 'doc.type') + if not doc or not doc.bindSources then + return '' + end + for _, src in ipairs(doc.bindSources) do + local name = buildName(src) + if name ~= '' then + return name + end + end + return '' +end + +function buildName(source, oop) if oop == nil then oop = source.type == 'setmethod' or source.type == 'getmethod' @@ -97,6 +113,9 @@ local function buildName(source, oop) if source.type == 'tablefield' then return asTableField(source) or '' end + if source.type == 'doc.type.function' then + return asDocFunction(source) + end local parent = source.parent if parent then return buildName(parent, oop) |