Skip to content

Commit f94bfa5

Browse files
committed
ACTION_MARK_ASYNC add spaces
1 parent 119356b commit f94bfa5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

script/core/code-action.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ local function solveAwaitInSync(uri, diag, results)
333333
end
334334
local row = guide.rowColOf(parentFunction.start)
335335
local pos = guide.positionOf(row, 0)
336+
local offset = guide.positionToOffset(state, pos + 1)
337+
local space = state.lua:match('[ \t]*', offset)
336338
results[#results+1] = {
337339
title = lang.script.ACTION_MARK_ASYNC,
338340
kind = 'quickfix',
@@ -342,7 +344,7 @@ local function solveAwaitInSync(uri, diag, results)
342344
{
343345
start = pos,
344346
finish = pos,
345-
newText = '---@async\n',
347+
newText = space .. '---@async\n',
346348
}
347349
}
348350
}

0 commit comments

Comments
 (0)