Server starts but does not know project root or capabilities — how do they handshake?
Per Wikipedia: “Initialization is the initialize/initialized exchange where client sends rootUri and capabilities and server returns its capabilities.”
Handshake like phone call — client says who it is and what language it speaks, server says what help it can offer.
- Client sends initialize with root and caps
- Server responds with serverCapabilities
- Client sends initialized notification
- Server starts workspace indexing
- Features become available
- Root from root_markers
- Capabilities negotiation prevents unsupported calls
- Once per attachment
vim.lsp.enable('lua_ls') # triggers initialize- Built from: LSP Configuration — config feeds init
- Built from: LSP Root Markers — root sent in init
- Builds into: LSP Diagnostics — diagnostics after init
- Related: LSP Server — server initializes
- Init before root detected — server indexes wrong dir
- Advertising caps server lacks — client calls missing method