Link Search Menu Expand Document

General

Initialize Request

  • The initialize request is sent as the first request from the client to the server.
  • Until the server has responded to the initialize request with an InitializeResult, the client must not send any additional requests or notifications to the server
  • The initialize request may only be sent once.
interface InitializeParams extends WorkDoneProgressParams {
	/**
	 * The process Id of the parent process that started
	 * the server. Is null if the process has not been started by another process.
	 * If the parent process is not alive then the server should exit (see exit notification) its process.
	 */
	processId: number | null;

	/**
	 * Information about the client
	 *
	 * @since 3.15.0
	 */
	clientInfo?: {
		/**
		 * The name of the client as defined by the client.
		 */
		name: string;

		/**
		 * The client's version as defined by the client.
		 */
		version?: string;
	};

	/**
	 * The rootPath of the workspace. Is null
	 * if no folder is open.
	 *
	 * @deprecated in favour of rootUri.
	 */
	rootPath?: string | null;

	/**
	 * The rootUri of the workspace. Is null if no
	 * folder is open. If both `rootPath` and `rootUri` are set
	 * `rootUri` wins.
	 */
	rootUri: DocumentUri | null;

	/**
	 * User provided initialization options.
	 */
	initializationOptions?: any;

	/**
	 * The capabilities provided by the client (editor or tool)
	 */
	capabilities: ClientCapabilities;

	/**
	 * The initial trace setting. If omitted trace is disabled ('off').
	 */
	trace?: 'off' | 'messages' | 'verbose';

	/**
	 * The workspace folders configured in the client when the server starts.
	 * This property is only available if the client supports workspace folders.
	 * It can be `null` if the client supports workspace folders but none are
	 * configured.
	 *
	 * @since 3.6.0
	 */
	workspaceFolders?: WorkspaceFolder[] | null;
}

Workspaces

workspaceFolders

  • https://microsoft.github.io/language-server-protocol/specification#workspace_workspaceFolders

  • The protocol up to now assumes one root folder which is announced to the server by the rootUri property of the InitializeParams

  • If the client supports workspace folders and announces them via the corresponding workspaceFolders client capability, the InitializeParamsl contain an additional property workspaceFolders with the configured workspace folders when the server starts.

  • The workspace/workspaceFolders request is sent from the server to the client to fetch the current open list of workspace folders. Returns null in the response if only a single file is open in the tool. Returns an empty array if a workspace is open but no folders are configured.

DidChangeConfiguration

  • A notification sent from the client to the server to signal the change of configuration settings.
interface DidChangeConfigurationParams {
	/**
	 * The actual changed settings
	 */
	settings: any;
}

Configuration Request

  • The workspace/configuration request is sent from the server to the client to fetch configuration settings from the client
  • can fetch several configuration settings in one roundtrip
  • order of the returned configuration settings correspond to the order of the passed ConfigurationItems

Copyright © 2020 Thence LLC