diff options
Diffstat (limited to 'server/src/matcher')
-rw-r--r-- | server/src/matcher/hover.lua | 17 | ||||
-rw-r--r-- | server/src/matcher/vm.lua | 4 |
2 files changed, 15 insertions, 6 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua index 2de5d1fc..34137582 100644 --- a/server/src/matcher/hover.lua +++ b/server/src/matcher/hover.lua @@ -143,14 +143,23 @@ local function buildValueName(result, source) else key = '?' end + + local parentName = declarat.parentName + if parentName == '?' then + local parentType = result.parentValue and result.parentValue.type + if parentType == 'table' then + else + parentName = '*' .. parentType + end + end if source.object then - return declarat.parentName .. ':' .. key + return parentName .. ':' .. key else - if declarat.parentName then + if parentName then if declarat.index then - return declarat.parentName .. '[' .. key .. ']' + return parentName .. '[' .. key .. ']' else - return declarat.parentName .. '.' .. key + return parentName .. '.' .. key end else return key diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua index 13232b8b..8997812d 100644 --- a/server/src/matcher/vm.lua +++ b/server/src/matcher/vm.lua @@ -641,14 +641,13 @@ function mt:getSimple(simple, mode) elseif obj.index then local index = self:getIndex(obj) field = self:getField(value, index, obj) + field.parentValue = value value = self:getValue(field) if mode == 'value' or i < #simple then if obj.start then self:addInfo(field, 'get', obj) end end - field.parent = lastField - lastField = field obj.object = object obj.parentName = parentName if obj.type == 'string' then @@ -661,6 +660,7 @@ function mt:getSimple(simple, mode) else if tp == 'name' then field = self:getField(value, obj[1], obj) + field.parentValue = value value = self:getValue(field) if mode == 'value' or i < #simple then self:addInfo(field, 'get', obj) |