Skip to content

Commit 50e8d65

Browse files
authored
Add TextDocumentContentResult (#1997)
1 parent 5b5820f commit 50e8d65

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

_specifications/lsp/3.18/workspace/textDocumentContent.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#### <a href="#workspace_textDocumentContent" name="workspace_textDocumentContent" class="anchor">Text Document Content Request (:leftwards_arrow_with_hook:)</a>
22

3-
The `workspace/textDocumentContent` request is sent from the client to the server to dynamically fetch the content of a text document.
3+
The `workspace/textDocumentContent` request is sent from the client to the server to dynamically fetch the content of a text document. Clients should treat the content returned from this requests as readonly.
44

55
_Client Capability_:
66
* property path (optional): `workspace.textDocumentContent`
@@ -77,7 +77,29 @@ export interface TextDocumentContentParams {
7777
```
7878

7979
_Response_:
80-
* 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.
80+
* result: `TextDocumentContentResult` defined as follows:
81+
82+
<div class="anchorHolder"><a href="#textDocumentContentResult" name="textDocumentContentResult" class="linkableAnchor"></a></div>
83+
84+
```typescript
85+
/**
86+
* Result of the `workspace/textDocumentContent` request.
87+
*
88+
* @since 3.18.0
89+
* @proposed
90+
*/
91+
export interface TextDocumentContentResult {
92+
/**
93+
* The text content of the text document. Please note, that the content of
94+
* any subsequent open notifications for the text document might differ
95+
* from the returned content due to whitespace and line ending
96+
* normalizations done on the client
97+
*/
98+
text: string;
99+
}
100+
```
101+
102+
The content of the text document. .
81103
* error: code and message set in case an exception happens during the text document content request.
82104

83105
#### <a href="#workspace_textDocumentContentRefresh" name="workspace_textDocumentContentRefresh" class="anchor">Text Document Content Refresh Request (:arrow_right_hook:)</a>

0 commit comments

Comments
 (0)