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)
1739
1739
local finish = result .firstFinish or result .finish
1740
1740
if rests then
1741
1741
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
1744
1744
end
1745
1745
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
+
1746
1752
local cstart = doc :find (' %S' , finish - startOffset )
1747
1753
if cstart then
1748
1754
result .comment = {
@@ -1758,9 +1764,7 @@ local function buildLuaDoc(comment)
1758
1764
end
1759
1765
end
1760
1766
end
1761
- end
1762
1767
1763
- if result then
1764
1768
return result , rests
1765
1769
end
1766
1770
You can’t perform that action at this time.
0 commit comments