diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-07 11:35:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-07 11:35:27 +0800 |
commit | e8bb3d6a84ab54249347ada01740e1127147fc13 (patch) | |
tree | 84a2e621a8fb6c9739162ee7878ad3f2b62d3552 /script/provider/provider.lua | |
parent | 3238be9f9828d3728fb81e2284ac2a5c2c9b3208 (diff) | |
download | lua-language-server-e8bb3d6a84ab54249347ada01740e1127147fc13.zip |
code action: swap params
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r-- | script/provider/provider.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua index ab6c1ccb..5d7bc6c2 100644 --- a/script/provider/provider.lua +++ b/script/provider/provider.lua @@ -581,6 +581,20 @@ proto.on('textDocument/codeAction', function (params) return nil end + for _, res in ipairs(results) do + if res.edit then + for turi, changes in pairs(res.edit.changes) do + local ttext = files.getText(turi) + local tlines = files.getLines(turi) + for _, change in ipairs(changes) do + change.range = define.range(tlines, ttext, change.start, change.finish) + change.start = nil + change.finish = nil + end + end + end + end + return results end) |