mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	fix(lsp): only auto-detach lsp.config clients #33834
Problem:
enable() routine detaches clients even if they were manually started
and not managed by vim.lsp.config.
Solution:
Skip clients that aren't managed by vim.lsp.config.
(cherry picked from commit 91e116f3a6)
			
			
This commit is contained in:
		
				
					committed by
					
						
						github-actions[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							3b3cf1d7ef
						
					
				
				
					commit
					47686a1454
				
			@@ -529,7 +529,7 @@ local function lsp_enable_callback(bufnr)
 | 
			
		||||
  -- Stop any clients that no longer apply to this buffer.
 | 
			
		||||
  local clients = lsp.get_clients({ bufnr = bufnr, _uninitialized = true })
 | 
			
		||||
  for _, client in ipairs(clients) do
 | 
			
		||||
    if not can_start(bufnr, client.name, lsp.config[client.name]) then
 | 
			
		||||
    if lsp.config[client.name] and not can_start(bufnr, client.name, lsp.config[client.name]) then
 | 
			
		||||
      lsp.buf_detach_client(bufnr, client.id)
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user