-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document text document content request and update changelog (#1994)
* Document new text document content request * Update 3.18 spec
- Loading branch information
Showing
3 changed files
with
192 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
_specifications/lsp/3.18/workspace/textDocumentContent.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
#### <a href="#workspace_textDocumentContent" name="workspace_textDocumentContent" class="anchor">Text Document Content Request (:leftwards_arrow_with_hook:)</a> | ||
|
||
The `workspace/textDocumentContent` request is sent from the client to the server to dynamically fetch the content of a text document. | ||
|
||
_Client Capability_: | ||
* property path (optional): `workspace.textDocumentContent` | ||
* property type: `TextDocumentContentClientCapabilities` defined as follows: | ||
|
||
<div class="anchorHolder"><a href="#textDocumentContentClientCapabilities" name="textDocumentContentClientCapabilities" class="linkableAnchor"></a></div> | ||
|
||
```typescript | ||
/** | ||
* Client capabilities for a text document content provider. | ||
* | ||
* @since 3.18.0 | ||
*/ | ||
export type TextDocumentContentClientCapabilities = { | ||
/** | ||
* Text document content provider supports dynamic registration. | ||
*/ | ||
dynamicRegistration?: boolean; | ||
}; | ||
``` | ||
|
||
_Server Capability_: | ||
* property path (optional): `workspace.textDocumentContent` | ||
* property type: `TextDocumentContentOptions` where `TextDocumentContentOptions` is defined as follows: | ||
|
||
<div class="anchorHolder"><a href="#textDocumentContentOptions" name="textDocumentContentOptions" class="linkableAnchor"></a></div> | ||
|
||
```typescript | ||
/** | ||
* Text document content provider options. | ||
* | ||
* @since 3.18.0 | ||
*/ | ||
export type TextDocumentContentOptions = { | ||
/** | ||
* The scheme for which the server provides content. | ||
*/ | ||
scheme: string; | ||
}; | ||
``` | ||
|
||
_Registration Options_: `TextDocumentContentRegistrationOptions` defined as follows: | ||
|
||
<div class="anchorHolder"><a href="#textDocumentContentRegistrationOptions" name="textDocumentContentRegistrationOptions" class="linkableAnchor"></a></div> | ||
|
||
```typescript | ||
/** | ||
* Text document content provider registration options. | ||
* | ||
* @since 3.18.0 | ||
*/ | ||
export type TextDocumentContentRegistrationOptions = TextDocumentContentOptions & | ||
StaticRegistrationOptions; | ||
``` | ||
|
||
_Request_: | ||
* method: 'workspace/textDocumentContent' | ||
* params: `TextDocumentContentParams` defined as follows: | ||
|
||
<div class="anchorHolder"><a href="#textDocumentContentParams" name="textDocumentContentParams" class="linkableAnchor"></a></div> | ||
|
||
```typescript | ||
/** | ||
* Parameters for the `workspace/textDocumentContent` request. | ||
* | ||
* @since 3.18.0 | ||
*/ | ||
export interface TextDocumentContentParams { | ||
/** | ||
* The uri of the text document. | ||
*/ | ||
uri: DocumentUri; | ||
} | ||
``` | ||
|
||
_Response_: | ||
* result: `string`. The content of the text document. Please note, that the content of any subsequent open notifications for the text document might differ from the returned content due to whitespace and line ending normalizations done on the client. | ||
* error: code and message set in case an exception happens during the text document content request. | ||
|
||
#### <a href="#workspace_textDocumentContentRefresh" name="workspace_textDocumentContentRefresh" class="anchor">Text Document Content Refresh Request (:arrow_right_hook:)</a> | ||
|
||
The `workspace/textDocumentContent/refresh`request is sent from the server to the client to refresh the content of a specific text document. | ||
|
||
_Request_: | ||
* method: 'workspace/textDocumentContent/refresh' | ||
* params: `TextDocumentContentRefreshParams` defined as follows: | ||
|
||
<div class="anchorHolder"><a href="#textDocumentContentRefreshParams" name="textDocumentContentRefreshParams" class="linkableAnchor"></a></div> | ||
|
||
```typescript | ||
/** | ||
* Parameters for the `workspace/textDocumentContent/refresh` request. | ||
* | ||
* @since 3.18.0 | ||
*/ | ||
export interface TextDocumentContentRefreshParams { | ||
/** | ||
* The uri of the text document to refresh. | ||
*/ | ||
uri: DocumentUri; | ||
} | ||
``` | ||
|
||
_Response_: | ||
* result: `void` | ||
* error: code and message set in case an exception happens during the workspace symbol resolve request. |