File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 13
13
```
14
14
* ` NEW ` Test CLI: ` --name=<testname> ` ` -n=<testname> ` : run specify unit test
15
15
* ` FIX ` Fixed the error that the configuration file pointed to by the ` --configpath ` option was not read and loaded.
16
+ * ` FIX ` Fixed the start position of the comment first symbol in docs ` ---@param a string?Comment ` - now its ` Comment ` instead of ` omment ` .
16
17
17
18
## 3.13.5
18
19
` 2024-12-20 `
Original file line number Diff line number Diff line change @@ -1743,11 +1743,15 @@ local function buildLuaDoc(comment)
1743
1743
finish = rest .firstFinish or result .finish
1744
1744
end
1745
1745
end
1746
- local cstart = text :find (' %S' , finish - comment .start )
1747
- if cstart and cstart < comment .finish then
1746
+ -- the subtraction is the length of the skipped string, so the start position is `+ 1`
1747
+ local cpos = finish - comment .start + 1
1748
+ -- actual text start is `comment.start + 2` because of `--` for some reason
1749
+ local textOffset = 2
1750
+ local cstart = text :find (' %S' , cpos - textOffset )
1751
+ if cstart and cstart < comment .finish - textOffset then
1748
1752
result .comment = {
1749
1753
type = ' doc.tailcomment' ,
1750
- start = cstart + comment . start ,
1754
+ start = comment . start + cstart - 1 + textOffset ,
1751
1755
finish = comment .finish ,
1752
1756
parent = result ,
1753
1757
text = trimTailComment (text :sub (cstart )),
You can’t perform that action at this time.
0 commit comments