mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	fix(lsp): consistent use of vim.notify/logging with unsupported methods
				
					
				
			This commit is contained in:
		| @@ -872,7 +872,7 @@ local hierarchy_methods = { | |||||||
| local function hierarchy(method) | local function hierarchy(method) | ||||||
|   local kind = hierarchy_methods[method] |   local kind = hierarchy_methods[method] | ||||||
|   if not kind then |   if not kind then | ||||||
|     error('unsupported method ' .. method) |     vim.notify(lsp._unsupported_method(method), vim.log.levels.WARN) | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   local prepare_method = kind == 'type' and ms.textDocument_prepareTypeHierarchy |   local prepare_method = kind == 'type' and ms.textDocument_prepareTypeHierarchy | ||||||
| @@ -1275,9 +1275,7 @@ function M.code_action(opts) | |||||||
|   local win = api.nvim_get_current_win() |   local win = api.nvim_get_current_win() | ||||||
|   local clients = lsp.get_clients({ bufnr = bufnr, method = ms.textDocument_codeAction }) |   local clients = lsp.get_clients({ bufnr = bufnr, method = ms.textDocument_codeAction }) | ||||||
|   if not next(clients) then |   if not next(clients) then | ||||||
|     if next(lsp.get_clients({ bufnr = bufnr })) then |  | ||||||
|     vim.notify(lsp._unsupported_method(ms.textDocument_codeAction), vim.log.levels.WARN) |     vim.notify(lsp._unsupported_method(ms.textDocument_codeAction), vim.log.levels.WARN) | ||||||
|     end |  | ||||||
|     return |     return | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Maria José Solano
					Maria José Solano