summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-05-25 01:37:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-05-25 01:37:30 +0800
commitf94bfa5aa70d959b170df1c932dd96e36e8d35a5 (patch)
tree3cdbc3c9b34b74d06e40c71e2ea24317a07630a3 /script/core
parent119356b81ec3d505464171abd35ca3d91e25b8c1 (diff)
downloadlua-language-server-f94bfa5aa70d959b170df1c932dd96e36e8d35a5.zip
`ACTION_MARK_ASYNC` add spaces
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',
}
}
}