mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	LSP: Feature/add workspace folders (#12638)
* First implementation of workspace folders * Add completion for current directory * Add tracking of workspace folders * Add workspace folder listing * Add checks on adding/removing workspaces * Add appropriate initialization options * Add documentation * Make workspaceFolders available wherever client is
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							2d5dd85eef
						
					
				
				
					commit
					0d83a1c43f
				
			@@ -597,7 +597,10 @@ function lsp.start_client(config)
 | 
			
		||||
      --  -- workspace folder in the user interface.
 | 
			
		||||
      --  name
 | 
			
		||||
      -- }
 | 
			
		||||
      workspaceFolders = nil;
 | 
			
		||||
      workspaceFolders = {{
 | 
			
		||||
        uri = vim.uri_from_fname(config.root_dir);
 | 
			
		||||
        name = string.format("%s", config.root_dir);
 | 
			
		||||
      }};
 | 
			
		||||
    }
 | 
			
		||||
    if config.before_init then
 | 
			
		||||
      -- TODO(ashkan) handle errors here.
 | 
			
		||||
@@ -610,6 +613,7 @@ function lsp.start_client(config)
 | 
			
		||||
      rpc.notify('initialized', {[vim.type_idx]=vim.types.dictionary})
 | 
			
		||||
      client.initialized = true
 | 
			
		||||
      uninitialized_clients[client_id] = nil
 | 
			
		||||
      client.workspaceFolders = initialize_params.workspaceFolders
 | 
			
		||||
      client.server_capabilities = assert(result.capabilities, "initialize result doesn't contain capabilities")
 | 
			
		||||
      -- These are the cleaned up capabilities we use for dynamically deciding
 | 
			
		||||
      -- when to send certain events to clients.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user