Show Document 请求
新版本 3.16.0
请求从服务器发送到客户端,要求客户端在用户界面中显示 URI 引用的特定资源。
客户端能力(Client capability):
- 属性路径:
window.showDocument
- 属性类型:
ShowDocumentClientCapabilities
, 定义如下:
/**
* Client capabilities for the show document request.
*
* @since 3.16.0
*/
export interface ShowDocumentClientCapabilities {
/**
* The client has support for the show document
* request.
*/
support: boolean;
}
请求(Request):
- method: "window/showDocument"
- params:
ShowDocumentParams
, 定义如下:
/**
* Params to show a resource.
*
* @since 3.16.0
*/
export interface ShowDocumentParams {
/**
* The 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 is 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
, 定义如下:
/**
* The result of an show document request.
*
* @since 3.16.0
*/
export interface ShowDocumentResult {
/**
* A boolean indicating if the show was successful.
*/
success: boolean;
}
- error:
code
和message
,以防在请求期间发生异常。