language-server-protocol/_includes/messages/3.18/showMessage.md
2023-09-13 09:55:33 -07:00

1.1 KiB

ShowMessage Notification (⬅️)

The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface.

Notification:

  • method: 'window/showMessage'
  • params: ShowMessageParams defined as follows:
interface ShowMessageParams {
	/**
	 * The message type. See {@link MessageType}.
	 */
	type: MessageType;

	/**
	 * The actual message.
	 */
	message: string;
}

Where the type is defined as follows:

export namespace MessageType {
	/**
	 * An error message.
	 */
	export const Error = 1;
	/**
	 * A warning message.
	 */
	export const Warning = 2;
	/**
	 * An information message.
	 */
	export const Info = 3;
	/**
	 * A log message.
	 */
	export const Log = 4;
	/**
	 * A debug message.
	 *
	 * @since 3.18.0
	 */
	export const Debug = 5;
}

export type MessageType = 1 | 2 | 3 | 4 | 5;