diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/core/hover/label.lua | 3 | ||||
-rw-r--r-- | script/core/infer.lua | 5 | ||||
-rw-r--r-- | script/core/noder.lua | 3 | ||||
-rw-r--r-- | script/parser/luadoc.lua | 2 | ||||
-rw-r--r-- | script/parser/newparser.lua | 16 |
5 files changed, 16 insertions, 13 deletions
diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua index a29cf672..3322e0d3 100644 --- a/script/core/hover/label.lua +++ b/script/core/hover/label.lua @@ -50,8 +50,7 @@ local function asValue(source, title) local literal = infer.searchAndViewLiterals(source) local cont if not infer.hasType(source, 'string') - and not type:find('%[%]$') - and not type:find('%w%<') then + and not type:find('%[%]$') then if #vm.getRefs(source, '*') > 0 or infer.hasType(source, 'table') then cont = buildTable(source) diff --git a/script/core/infer.lua b/script/core/infer.lua index d6784c67..2915f7f5 100644 --- a/script/core/infer.lua +++ b/script/core/infer.lua @@ -371,9 +371,10 @@ function m.getDocName(doc) return nodeName .. '[]' end if doc.type == 'doc.type.table' then - local key = m.viewDocName(doc.tkey) or '?' + local node = m.viewDocName(doc.node) or '?' + local key = m.viewDocName(doc.tkey) or '?' local value = m.viewDocName(doc.tvalue) or '?' - return ('table<%s, %s>'):format(key, value) + return ('%s<%s, %s>'):format(node, key, value) end if doc.type == 'doc.type.function' then return m.viewDocFunction(doc) diff --git a/script/core/noder.lua b/script/core/noder.lua index 927f3c6d..f364f458 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -905,6 +905,9 @@ compileNodeMap = util.switch() end) : case 'doc.type.table' : call(function (noders, id, source) + if source.node then + pushForward(noders, id, getID(source.node), INFO_CLASS_TO_EXNTENDS) + end if source.tkey then local keyID = id .. TABLE_KEY pushForward(noders, keyID, getID(source.tkey)) diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 4a431e68..56da32f2 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -324,7 +324,7 @@ local function parseTypeUnitTable(parent, node) end nextSymbolOrError('>') - node.parent = result; + node.parent = result result.finish = getFinish() result.tkey = key result.tvalue = value diff --git a/script/parser/newparser.lua b/script/parser/newparser.lua index ee2c5e62..8469b68d 100644 --- a/script/parser/newparser.lua +++ b/script/parser/newparser.lua @@ -374,6 +374,12 @@ local function fastForwardToken(offset) or myOffset >= offset then break end + local token = Tokens[Index + 1] + if NLMap[token] then + Line = Line + 1 + LineOffset = Tokens[Index] + #token + State.lines[Line] = LineOffset + end Index = Index + 2 end end @@ -390,14 +396,8 @@ local function resolveLongString(finishMark) local stringResult = ssub(Lua, start, finishOffset - 1) local lastLN = stringResult:find '[\r\n][^\r\n]*$' if lastLN then - local result, count = stringResult - : gsub('\r\n', '\n') - : gsub('[\r\n]', '\n') - LineOffset = lastLN + start - for i = Line + 1, Line + count do - State.lines[i] = LineOffset - end - Line = Line + count + local result = stringResult + : gsub('\r\n?', '\n') stringResult = result end fastForwardToken(finishOffset + #finishMark) |