mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00:00 
			
		
		
		
	refactor(diagnostic): make display handlers generic (#16137)
Rather than treating virtual_text, signs, and underline specially, introduce the concept of generic "handlers", of which those three are simply the defaults bundled with Nvim. Handlers are called in `vim.diagnostic.show()` and `vim.diagnostic.hide()` and are used to handle how diagnostics are displayed.
This commit is contained in:
		@@ -146,7 +146,8 @@ local _client_namespaces = {}
 | 
			
		||||
function M.get_namespace(client_id)
 | 
			
		||||
  vim.validate { client_id = { client_id, 'n' } }
 | 
			
		||||
  if not _client_namespaces[client_id] then
 | 
			
		||||
    local name = string.format("vim.lsp.client-%d", client_id)
 | 
			
		||||
    local client = vim.lsp.get_client_by_id(client_id)
 | 
			
		||||
    local name = string.format("vim.lsp.%s.%d", client.name, client_id)
 | 
			
		||||
    _client_namespaces[client_id] = vim.api.nvim_create_namespace(name)
 | 
			
		||||
  end
 | 
			
		||||
  return _client_namespaces[client_id]
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user