Skip to content

Commit

Permalink
LuaLS#3028. Support for a long strings with leading spaces LuaLS#3034
Browse files Browse the repository at this point in the history
…(pattern is optional)
  • Loading branch information
TIMONz1535 committed Jan 9, 2025
1 parent cbe45e1 commit 4af79e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion script/core/semantic-tokens.lua
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ return function (uri, start, finish)
if start <= comm.start and comm.finish <= finish then
-- the same logic as in buildLuaDoc
local headPos = (comm.type == 'comment.short' and comm.text:match '^%-%s*[@|]()')
or (comm.type == 'comment.long' and comm.text:match '^@()')
or (comm.type == 'comment.long' and comm.text:match '^%s*@()')
if headPos then
-- absolute position of `@` symbol
local startOffset = comm.start + headPos
Expand Down
2 changes: 1 addition & 1 deletion script/parser/luadoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ end

local function buildLuaDoc(comment)
local headPos = (comment.type == 'comment.short' and comment.text:match '^%-%s*@()')
or (comment.type == 'comment.long' and comment.text:match '^@()')
or (comment.type == 'comment.long' and comment.text:match '^%s*@()')
if not headPos then
return {
type = 'doc.comment',
Expand Down

0 comments on commit 4af79e3

Please sign in to comment.