neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 33b77eb728a1f07926ba19c4f09fd20e806de363
parent a27756cc2463139343aa3c214ad20908d42f67a6
Author: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Date:   Thu, 11 Aug 2022 19:21:57 +0200

fix(lsp): handle nil client in onexit callback (#19722)

Follow up to https://github.com/neovim/neovim/pull/19658
Diffstat:
Mruntime/lua/vim/lsp.lua | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua @@ -690,7 +690,7 @@ end --- Default handler for the 'textDocument/didOpen' LSP notification. --- ---@param bufnr number Number of the buffer, or 0 for current ----@param client Client object +---@param client table Client object local function text_document_did_open_handler(bufnr, client) changetracking.init(client, bufnr) if not vim.tbl_get(client.server_capabilities, 'textDocumentSync', 'openClose') then @@ -1148,7 +1148,11 @@ function lsp.start_client(config) active_clients[client_id] = nil uninitialized_clients[client_id] = nil - changetracking.reset(client) + -- Client can be absent if executable starts, but initialize fails + -- init/attach won't have happened + if client then + changetracking.reset(client) + end if code ~= 0 or (signal ~= 0 and signal ~= 15) then local msg = string.format('Client %s quit with exit code %s and signal %s', client_id, code, signal)