From ec377055d48d1bc79bbee6ad89c23ec428059f8f Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Tue, 10 Nov 2020 16:43:13 +0100 Subject: [PATCH] Fixes #612: Feature request: Server initiated "window/showTextDocument" notification --- _data/specification-3-16-toc.yml | 2 + _specifications/specification-3-16.md | 86 ++++++++++++++++++++++++++- 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/_data/specification-3-16-toc.yml b/_data/specification-3-16-toc.yml index a94e094aa..f07ff2acb 100644 --- a/_data/specification-3-16-toc.yml +++ b/_data/specification-3-16-toc.yml @@ -95,6 +95,8 @@ anchor: window_showMessage - title: showMessageRequest anchor: window_showMessageRequest + - title: showDocument + anchor: window_showDocument - title: logMessage anchor: window_logMessage - title: progress/create diff --git a/_specifications/specification-3-16.md b/_specifications/specification-3-16.md index 06f314b20..d7f6ab363 100644 --- a/_specifications/specification-3-16.md +++ b/_specifications/specification-3-16.md @@ -2231,6 +2231,89 @@ interface MessageActionItem { } ``` +#### Show Document Request (:arrow_right_hook:) + +> New in version 3.16.0 + +The show document request is sent from a server to a client to ask the client to display a particular document in the user interface. + +_Client Capability_: +* property path (optional): `window.showDocument` +* property type: `ShowDocumentClientCapabilities` defined as follows: +```typescript +/** + * Client capabilities for the show document request. + * + * @since 3.16.0 - proposed state + */ +export interface ShowDocumentClientCapabilities { + /** + * The client has support for the show document + * request. + */ + support: boolean; +} +``` + +_Request_: +* method: 'window/showDocument' +* params: `ShowDocumentParams` defined as follows: + +```typescript +/** + * Params to show a document. + * + * @since 3.16.0 - proposed state + */ +export interface ShowDocumentParams { + /** + * The document uri to show. + */ + uri: URI; + + /** + * Indicates to show the resource in an external program. + * To show for example `https://code.visualstudio.com/` + * in the default WEB browser set `external` to `true`. + */ + external?: boolean; + + /** + * An optional property to indicate whether the editor + * showing the document should take focus or not. + * Clients might ignore this property if an external + * program in started. + */ + takeFocus?: boolean; + + /** + * An optional selection range if the document is a text + * document. Clients might ignore the property if an + * external program is started or the file is not a text + * file. + */ + selection?: Range; +} +``` + +_Response_: + +* result: `ShowDocumentResult` defined as follows: +```typescript +/** + * The result of an show document request. + * + * @since 3.16.0 - proposed state + */ +export interface ShowDocumentResult { + /** + * A boolean indicating if the show was successful. + */ + success: boolean; +} +``` +* error: code and message set in case an exception happens during showing a document. + #### LogMessage Notification (:arrow_left:) The log message notification is sent from the server to the client to ask the client to log a particular message. @@ -5547,7 +5630,7 @@ _Response_: * result: `CodeLens` * error: code and message set in case an exception happens during the code lens resolve request. -#### Code Lens Refresh Request (:rightwards_arrow_with_hook:) +#### Code Lens Refresh Request (:arrow_right_hook:) > *Since version 3.16.0* @@ -7204,6 +7287,7 @@ Servers usually support different communication channels (e.g. stdio, pipes, ... * Add client capability to signale whether the client normalizes line endings. * Add support to preserve aditional attributes on `MessageActionItem`. * Add support to provide the clients locale in the initialize call. +* Add support for opening and showing a document in the client user interface. #### 3.15.0 (01/14/2020)