A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/9304ee3874fc1e0608a9902cf5b1b0ac6645ef0a below:

forward offset_encoding to apply_text_edits (#17075) · neovim/neovim@9304ee3 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+7

-5

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+7

-5

lines changed Original file line number Diff line number Diff line change

@@ -184,7 +184,7 @@ function M.formatting_sync(options, timeout_ms)

184 184 185 185

local result, err = client.request_sync('textDocument/formatting', params, timeout_ms, bufnr)

186 186

if result and result.result then

187 -

util.apply_text_edits(result.result, bufnr)

187 +

util.apply_text_edits(result.result, bufnr, client.offset_encoding)

188 188

elseif err then

189 189

vim.notify('vim.lsp.buf.formatting_sync: ' .. err, vim.log.levels.WARN)

190 190

end

@@ -228,7 +228,7 @@ function M.formatting_seq_sync(options, timeout_ms, order)

228 228

local params = util.make_formatting_params(options)

229 229

local result, err = client.request_sync("textDocument/formatting", params, timeout_ms, vim.api.nvim_get_current_buf())

230 230

if result and result.result then

231 -

util.apply_text_edits(result.result, bufnr)

231 +

util.apply_text_edits(result.result, bufnr, client.offset_encoding)

232 232

elseif err then

233 233

vim.notify(string.format("vim.lsp.buf.formatting_seq_sync: (%s) %s", client.name, err), vim.log.levels.WARN)

234 234

end

Original file line number Diff line number Diff line change

@@ -233,13 +233,15 @@ end

233 233

--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_rangeFormatting

234 234

M['textDocument/rangeFormatting'] = function(_, result, ctx, _)

235 235

if not result then return end

236 -

util.apply_text_edits(result, ctx.bufnr)

236 +

local client = vim.lsp.get_client_by_id(ctx.client_id)

237 +

util.apply_text_edits(result, ctx.bufnr, client.offset_encoding)

237 238

end

238 239 239 240

--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_formatting

240 241

M['textDocument/formatting'] = function(_, result, ctx, _)

241 242

if not result then return end

242 -

util.apply_text_edits(result, ctx.bufnr)

243 +

local client = vim.lsp.get_client_by_id(ctx.client_id)

244 +

util.apply_text_edits(result, ctx.bufnr, client.offset_encoding)

243 245

end

244 246 245 247

--see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_completion

Original file line number Diff line number Diff line change

@@ -771,7 +771,7 @@ function M.apply_workspace_edit(workspace_edit, offset_encoding)

771 771 772 772

for uri, changes in pairs(all_changes) do

773 773

local bufnr = vim.uri_to_bufnr(uri)

774 -

M.apply_text_edits(changes, bufnr)

774 +

M.apply_text_edits(changes, bufnr, offset_encoding)

775 775

end

776 776

end

777 777

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4