fix(lsp): require bufnr for apply_text_edits (#16444)

This commit is contained in:
Michael Lingelbach
2021-11-26 04:36:37 -05:00
committed by GitHub
parent 72d62aa6aa
commit 102e7e7929
2 changed files with 9 additions and 3 deletions

View File

@@ -325,6 +325,10 @@ end
---@param bufnr number Buffer id
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textEdit
function M.apply_text_edits(text_edits, bufnr)
validate {
text_edits = { text_edits, 't', false };
bufnr = { bufnr, 'number', false };
}
if not next(text_edits) then return end
if not api.nvim_buf_is_loaded(bufnr) then
vim.fn.bufload(bufnr)