mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00:00 
			
		
		
		
	revert(lsp): compare to vim.NIL in lsp/buf.lua (#35156)
				
					
				
			revert(lsp): "compare to `vim.NIL` in `lsp/buf.lua` #35154"
This reverts commit a5c598871b.
			
			
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							a5c598871b
						
					
				
				
					commit
					a9a4c271b1
				
			@@ -723,7 +723,7 @@ function M.rename(new_name, opts)
 | 
				
			|||||||
    if client:supports_method(ms.textDocument_prepareRename) then
 | 
					    if client:supports_method(ms.textDocument_prepareRename) then
 | 
				
			||||||
      local params = util.make_position_params(win, client.offset_encoding)
 | 
					      local params = util.make_position_params(win, client.offset_encoding)
 | 
				
			||||||
      client:request(ms.textDocument_prepareRename, params, function(err, result)
 | 
					      client:request(ms.textDocument_prepareRename, params, function(err, result)
 | 
				
			||||||
        if err or result == vim.NIL then
 | 
					        if err or result == nil then
 | 
				
			||||||
          if next(clients, idx) then
 | 
					          if next(clients, idx) then
 | 
				
			||||||
            try_use_client(next(clients, idx))
 | 
					            try_use_client(next(clients, idx))
 | 
				
			||||||
          else
 | 
					          else
 | 
				
			||||||
@@ -809,11 +809,7 @@ function M.references(context, opts)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    for client_id, res in pairs(results) do
 | 
					    for client_id, res in pairs(results) do
 | 
				
			||||||
      local client = assert(lsp.get_client_by_id(client_id))
 | 
					      local client = assert(lsp.get_client_by_id(client_id))
 | 
				
			||||||
      local result = res.result
 | 
					      local items = util.locations_to_items(res.result or {}, client.offset_encoding)
 | 
				
			||||||
      if result == vim.NIL then
 | 
					 | 
				
			||||||
        result = {}
 | 
					 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
      local items = util.locations_to_items(result, client.offset_encoding)
 | 
					 | 
				
			||||||
      vim.list_extend(all_items, items)
 | 
					      vim.list_extend(all_items, items)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user