diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-05-25 01:37:30 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-05-25 01:37:30 +0800 |
commit | f94bfa5aa70d959b170df1c932dd96e36e8d35a5 (patch) | |
tree | 3cdbc3c9b34b74d06e40c71e2ea24317a07630a3 /script/core | |
parent | 119356b81ec3d505464171abd35ca3d91e25b8c1 (diff) | |
download | lua-language-server-f94bfa5aa70d959b170df1c932dd96e36e8d35a5.zip |
`ACTION_MARK_ASYNC` add spaces
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/code-action.lua | 4 |
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', } } } |