File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1739,10 +1739,16 @@ local function buildLuaDoc(comment)
17391739 local finish = result .firstFinish or result .finish
17401740 if rests then
17411741 for _ , rest in ipairs (rests ) do
1742- rest .range = comment .finish
1743- finish = rest .firstFinish or result .finish
1742+ rest .range = math.max ( comment .finish , rest . finish )
1743+ finish = rest .firstFinish or rest .finish
17441744 end
17451745 end
1746+
1747+ -- `result` can be a multiline annotation or an alias, while `doc` is the first line, so we can't parse comment
1748+ if finish >= comment .finish then
1749+ return result , rests
1750+ end
1751+
17461752 local cstart = doc :find (' %S' , finish - startOffset )
17471753 if cstart then
17481754 result .comment = {
@@ -1758,9 +1764,7 @@ local function buildLuaDoc(comment)
17581764 end
17591765 end
17601766 end
1761- end
17621767
1763- if result then
17641768 return result , rests
17651769 end
17661770
You can’t perform that action at this time.
0 commit comments