summaryrefslogtreecommitdiff
path: root/script/client.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/client.lua')
-rw-r--r--script/client.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/script/client.lua b/script/client.lua
index c22b59ab..e77eaaae 100644
--- a/script/client.lua
+++ b/script/client.lua
@@ -4,6 +4,7 @@ local lang = require 'language'
local proto = require 'proto'
local define = require 'proto.define'
local config = require 'config'
+local converter = require 'proto.converter'
local m = {}
@@ -215,15 +216,15 @@ function m.setConfig(changes, onlyMemory)
end
end
----@alias textEdit {start: integer, finish: integer, text: string}
+---@alias textEditor {start: integer, finish: integer, text: string}
---@param uri uri
----@param edits textEdit[]
+---@param edits textEditor[]
function m.editText(uri, edits)
local files = require 'files'
local textEdits = {}
for i, edit in ipairs(edits) do
- textEdits[i] = define.textEdit(files.range(uri, edit.start, edit.finish), edit.text)
+ textEdits[i] = converter.textEdit(converter.packRange(uri, edit.start, edit.finish), edit.text)
end
proto.request('workspace/applyEdit', {
edit = {