mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(lsp): add assertion for explicit bufnr in apply_text_edits (#27614)
Assert that the buffer number passed to apply_text_edits is fully resolved (not 0 or null). Pass the known buffer number to apply_text_edits from lsp.formatexpr().
This commit is contained in:
@ -1280,7 +1280,7 @@ function lsp.formatexpr(opts)
|
||||
local response =
|
||||
client.request_sync(ms.textDocument_rangeFormatting, params, timeout_ms, bufnr)
|
||||
if response and response.result then
|
||||
lsp.util.apply_text_edits(response.result, 0, client.offset_encoding)
|
||||
lsp.util.apply_text_edits(response.result, bufnr, client.offset_encoding)
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user