Skip to content

Commit 4af79e3

Browse files
committed
#3028. Support for a long strings with leading spaces #3034 (pattern is optional)
1 parent cbe45e1 commit 4af79e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

script/core/semantic-tokens.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ return function (uri, start, finish)
904904
if start <= comm.start and comm.finish <= finish then
905905
-- the same logic as in buildLuaDoc
906906
local headPos = (comm.type == 'comment.short' and comm.text:match '^%-%s*[@|]()')
907-
or (comm.type == 'comment.long' and comm.text:match '^@()')
907+
or (comm.type == 'comment.long' and comm.text:match '^%s*@()')
908908
if headPos then
909909
-- absolute position of `@` symbol
910910
local startOffset = comm.start + headPos

script/parser/luadoc.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ end
17141714

17151715
local function buildLuaDoc(comment)
17161716
local headPos = (comment.type == 'comment.short' and comment.text:match '^%-%s*@()')
1717-
or (comment.type == 'comment.long' and comment.text:match '^@()')
1717+
or (comment.type == 'comment.long' and comment.text:match '^%s*@()')
17181718
if not headPos then
17191719
return {
17201720
type = 'doc.comment',

0 commit comments

Comments
 (0)