From 01ae5e7c385e2e4996db3ef217be8e0b30fb370b Mon Sep 17 00:00:00 2001 From: beardedsakimonkey <54521218+beardedsakimonkey@users.noreply.github.com> Date: Sat, 12 Sep 2020 09:39:52 -0700 Subject: lsp: fix lsp.buf.formatting_sync() null response (#12752) Co-authored-by: tim apple --- runtime/lua/vim/lsp/buf.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/lua') diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index 208082f241..3060776d83 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -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 -- cgit