summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
Diffstat (limited to 'script/core')
-rw-r--r--script/core/code-action.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/core/code-action.lua b/script/core/code-action.lua
index 6bba0a82..29c63a41 100644
--- a/script/core/code-action.lua
+++ b/script/core/code-action.lua
@@ -333,6 +333,8 @@ local function solveAwaitInSync(uri, diag, results)
end
local row = guide.rowColOf(parentFunction.start)
local pos = guide.positionOf(row, 0)
+ local offset = guide.positionToOffset(state, pos + 1)
+ local space = state.lua:match('[ \t]*', offset)
results[#results+1] = {
title = lang.script.ACTION_MARK_ASYNC,
kind = 'quickfix',
@@ -342,7 +344,7 @@ local function solveAwaitInSync(uri, diag, results)
{
start = pos,
finish = pos,
- newText = '---@async\n',
+ newText = space .. '---@async\n',
}
}
}