summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-07 11:35:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-07 11:35:27 +0800
commite8bb3d6a84ab54249347ada01740e1127147fc13 (patch)
tree84a2e621a8fb6c9739162ee7878ad3f2b62d3552 /script/provider
parent3238be9f9828d3728fb81e2284ac2a5c2c9b3208 (diff)
downloadlua-language-server-e8bb3d6a84ab54249347ada01740e1127147fc13.zip
code action: swap params
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/provider.lua14
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)