Skip to main content

Posts

Showing posts with the label Lua

Fixing 'Client 1 quit with exit code 1' in Neovim Lua LSP Setup

  The error message   Client 1 quit with exit code 1   is the Neovim equivalent of a "Check Engine" light. It tells you something catastrophic happened during the Language Server Protocol (LSP) initialization, but it offers zero context on   what   failed. This usually occurs in two scenarios: Orphaned Execution:  The language server binary exists but crashed immediately due to missing arguments or environmental issues (e.g., wrong Node version). Root Resolution Failure:  The LSP cannot determine the workspace root (e.g., missing  .git  or  package.json ), causing it to detach and terminate the process immediately. Below is a rigorous approach to diagnosing and fixing this in your  init.lua  using  nvim-lspconfig . The Anatomy of the Crash Under the hood,  nvim-lspconfig  uses  vim.loop.spawn  (libuv) to create a child process for the language server. When you trigger  setup({}) , Neovim attempts t...

Fixing 'No Diagnostics' Errors in Neovim 0.11 Lua Configs

  You just updated to Neovim 0.11 (Nightly/Pre-release), ran   :LspInfo   to confirm your language server is attached, and verified that the process is running. Yet, your editor gutter is empty. There are no red 'E' icons, no virtual text, and no underlines, even on code that is intentionally broken. This regression is not an LSP failure; it is a configuration mismatch caused by breaking changes in how Neovim 0.11 handles diagnostic rendering and legacy sign definitions. The Root Cause: Deprecation of Legacy Sign Definitions In versions prior to 0.10/0.11, Neovim relied heavily on a legacy Vimscript bridge ( vim.fn.sign_define ) to determine which icons to display in the sign column (gutter). Users typically looped through a table of icons and registered  DiagnosticSignError ,  DiagnosticSignWarn , etc. Neovim 0.11 has shifted the diagnostic rendering subsystem to be fully declarative within the Lua  vim.diagnostic  API. Decoupling:  The internal ...