lsp: fix lsp.buf.formatting_sync() null response (#12752)

Co-authored-by: tim apple <tim@tims-MacBook-Pro.local>
This commit is contained in:
beardedsakimonkey 2020-09-12 09:39:52 -07:00 committed by GitHub
parent f3b5531ae8
commit 01ae5e7c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,6 +142,7 @@ function M.formatting_sync(options, timeout_ms)
local result = vim.lsp.buf_request_sync(0, "textDocument/formatting", params, timeout_ms)
if not result then return end
result = result[1].result
if not result then return end
vim.lsp.util.apply_text_edits(result)
end