Skip to content

Commit aede136

Browse files
authored
Document text document content request and update changelog (#1994)
* Document new text document content request * Update 3.18 spec
1 parent a08124e commit aede136

File tree

3 files changed

+192
-69
lines changed

3 files changed

+192
-69
lines changed

_data/specification-3-18-toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@
270270
anchor: workspace_executeCommand
271271
- title: Apply Edit
272272
anchor: workspace_applyEdit
273+
- title: Text Document Content
274+
anchor: workspace_textDocumentContent
273275
- title: Window Features
274276
anchor: windowFeatures
275277
children:

_specifications/lsp/3.18/specification.md

Lines changed: 81 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,7 @@ The language features should be computed on the [synchronized state](#textDocume
677677
{% include_relative workspace/didChangeWatchedFiles.md %}
678678
{% include_relative workspace/executeCommand.md %}
679679
{% include_relative workspace/applyEdit.md %}
680+
{% include_relative workspace/textDocumentContent.md %}
680681

681682
### <a href="#windowFeatures" name="windowFeatures" class="anchor">Window Features</a>
682683

@@ -715,110 +716,121 @@ To support the case that the editor starting a server crashes, an editor should
715716

716717
Since 3.17 there is a meta model describing the LSP protocol:
717718

718-
- [metaModel.json](../metaModel/metaModel.json): The actual meta model for the LSP 3.17 specification
719+
- [metaModel.json](../metaModel/metaModel.json): The actual meta model for the LSP 3.18 specification
719720
- [metaModel.ts](../metaModel/metaModel.ts): A TypeScript file defining the data types that make up the meta model.
720721
- [metaModel.schema.json](../metaModel/metaModel.schema.json): A JSON schema file defining the data types that make up the meta model. Can be used to generate code to read the meta model JSON file.
721722

722723
### <a href="#changeLog" name="changeLog" class="anchor">Change Log</a>
723724

724725
#### <a href="#version_3_18_0" name="version_3_18_0" class="anchor">3.18.0 (mm/dd/yyyy)</a>
725726

726-
* support for code action kind documentation.
727+
* Added inline completions support.
728+
* Added dynamic text document content support.
729+
* Added refresh support for folding ranges.
730+
* Support to format multiple ranges at once.
731+
* Support for snippets in workspace edits.
732+
* Relative Pattern support for document filters and notebook document filters.
733+
* Support for code action kind documentation.
727734
* Add support for `activeParameter` on `SignatureHelp` and `SignatureInformation` being `null`.
728-
* Add tooltip to `Command`.
735+
* Support tooltips for `Command`.
736+
* Support for meta data information on workspace edits.
737+
* Support for snippets in text document edits.
738+
* Support for debug message kind.
739+
* Client capability to enumerate properties that can be resolved for code lenses.
740+
729741

730742
#### <a href="#version_3_17_0" name="version_3_17_0" class="anchor">3.17.0 (05/10/2022)</a>
731743

732744
* Specify how clients will handle stale requests.
733-
* Add support for a completion item label details.
734-
* Add support for workspace symbol resolve request.
735-
* Add support for label details and insert text mode on completion items.
736-
* Add support for shared values on CompletionItemList.
737-
* Add support for HTML tags in Markdown.
738-
* Add support for collapsed text in folding.
739-
* Add support for trigger kinds on code action requests.
740-
* Add the following support to semantic tokens:
745+
* Added support for a completion item label details.
746+
* Added support for workspace symbol resolve request.
747+
* Added support for label details and insert text mode on completion items.
748+
* Added support for shared values on CompletionItemList.
749+
* Added support for HTML tags in Markdown.
750+
* Added support for collapsed text in folding.
751+
* Added support for trigger kinds on code action requests.
752+
* Added the following support to semantic tokens:
741753
- server cancelable
742754
- augmentation of syntax tokens
743-
* Add support to negotiate the position encoding.
744-
* Add support for relative patterns in file watchers.
745-
* Add support for type hierarchies
746-
* Add support for inline values.
747-
* Add support for inlay hints.
748-
* Add support for notebook documents.
749-
* Add support for diagnostic pull model.
755+
* Added support to negotiate the position encoding.
756+
* Added support for relative patterns in file watchers.
757+
* Added support for type hierarchies
758+
* Added support for inline values.
759+
* Added support for inlay hints.
760+
* Added support for notebook documents.
761+
* Added support for diagnostic pull model.
750762

751763
#### <a href="#version_3_16_0" name="version_3_16_0" class="anchor">3.16.0 (12/14/2020)</a>
752764

753-
* Add support for tracing.
754-
* Add semantic token support.
755-
* Add call hierarchy support.
756-
* Add client capability for resolving text edits on completion items.
757-
* Add support for client default behavior on renames.
758-
* Add support for insert and replace ranges on `CompletionItem`.
759-
* Add support for diagnostic code descriptions.
760-
* Add support for document symbol provider label.
761-
* Add support for tags on `SymbolInformation` and `DocumentSymbol`.
762-
* Add support for moniker request method.
763-
* Add support for code action `data` property.
764-
* Add support for code action `disabled` property.
765-
* Add support for code action resolve request.
766-
* Add support for diagnostic `data` property.
767-
* Add support for signature information `activeParameter` property.
768-
* Add support for `workspace/didCreateFiles` notifications and `workspace/willCreateFiles` requests.
769-
* Add support for `workspace/didRenameFiles` notifications and `workspace/willRenameFiles` requests.
770-
* Add support for `workspace/didDeleteFiles` notifications and `workspace/willDeleteFiles` requests.
771-
* Add client capability to signal whether the client normalizes line endings.
772-
* Add support to preserve additional attributes on `MessageActionItem`.
773-
* Add support to provide the clients locale in the initialize call.
774-
* Add support for opening and showing a document in the client user interface.
775-
* Add support for linked editing.
776-
* Add support for change annotations in text edits as well as in create file, rename file and delete file operations.
765+
* Added support for tracing.
766+
* Added semantic token support.
767+
* Added call hierarchy support.
768+
* Added client capability for resolving text edits on completion items.
769+
* Added support for client default behavior on renames.
770+
* Added support for insert and replace ranges on `CompletionItem`.
771+
* Added support for diagnostic code descriptions.
772+
* Added support for document symbol provider label.
773+
* Added support for tags on `SymbolInformation` and `DocumentSymbol`.
774+
* Added support for moniker request method.
775+
* Added support for code action `data` property.
776+
* Added support for code action `disabled` property.
777+
* Added support for code action resolve request.
778+
* Added support for diagnostic `data` property.
779+
* Added support for signature information `activeParameter` property.
780+
* Added support for `workspace/didCreateFiles` notifications and `workspace/willCreateFiles` requests.
781+
* Added support for `workspace/didRenameFiles` notifications and `workspace/willRenameFiles` requests.
782+
* Added support for `workspace/didDeleteFiles` notifications and `workspace/willDeleteFiles` requests.
783+
* Added client capability to signal whether the client normalizes line endings.
784+
* Added support to preserve additional attributes on `MessageActionItem`.
785+
* Added support to provide the clients locale in the initialize call.
786+
* Added support for opening and showing a document in the client user interface.
787+
* Added support for linked editing.
788+
* Added support for change annotations in text edits as well as in create file, rename file and delete file operations.
777789

778790
#### <a href="#version_3_15_0" name="version_3_15_0" class="anchor">3.15.0 (01/14/2020)</a>
779791

780-
* Add generic progress reporting support.
781-
* Add specific work done progress reporting support to requests where applicable.
782-
* Add specific partial result progress support to requests where applicable.
783-
* Add support for `textDocument/selectionRange`.
784-
* Add support for server and client information.
785-
* Add signature help context.
786-
* Add Erlang and Elixir to the list of supported programming languages
787-
* Add `version` on `PublishDiagnosticsParams`
788-
* Add `CodeAction#isPreferred` support.
789-
* Add `CompletionItem#tag` support.
790-
* Add `Diagnostic#tag` support.
791-
* Add `DocumentLink#tooltip` support.
792-
* Add `trimTrailingWhitespace`, `insertFinalNewline` and `trimFinalNewlines` to `FormattingOptions`.
792+
* Added generic progress reporting support.
793+
* Added specific work done progress reporting support to requests where applicable.
794+
* Added specific partial result progress support to requests where applicable.
795+
* Added support for `textDocument/selectionRange`.
796+
* Added support for server and client information.
797+
* Added signature help context.
798+
* Added Erlang and Elixir to the list of supported programming languages
799+
* Added `version` on `PublishDiagnosticsParams`
800+
* Added `CodeAction#isPreferred` support.
801+
* Added `CompletionItem#tag` support.
802+
* Added `Diagnostic#tag` support.
803+
* Added `DocumentLink#tooltip` support.
804+
* Added `trimTrailingWhitespace`, `insertFinalNewline` and `trimFinalNewlines` to `FormattingOptions`.
793805
* Clarified `WorkspaceSymbolParams#query` parameter.
794806

795807

796808
#### <a href="#version_3_14_0" name="version_3_14_0" class="anchor">3.14.0 (12/13/2018)</a>
797809

798-
* Add support for signature label offsets.
799-
* Add support for location links.
800-
* Add support for `textDocument/declaration` request.
810+
* Added support for signature label offsets.
811+
* Added support for location links.
812+
* Added support for `textDocument/declaration` request.
801813

802814
#### <a href="#version_3_13_0" name="version_3_13_0" class="anchor">3.13.0 (9/11/2018)</a>
803815

804-
* Add support for file and folder operations (create, rename, move) to workspace edits.
816+
* Added support for file and folder operations (create, rename, move) to workspace edits.
805817

806818
#### <a href="#version_3_12_0" name="version_3_12_0" class="anchor">3.12.0 (8/23/2018)</a>
807819

808-
* Add support for `textDocument/prepareRename` request.
820+
* Added support for `textDocument/prepareRename` request.
809821

810822
#### <a href="#version_3_11_0" name="version_3_11_0" class="anchor">3.11.0 (8/21/2018)</a>
811823

812-
* Add support for CodeActionOptions to allow a server to provide a list of code action it supports.
824+
* Added support for CodeActionOptions to allow a server to provide a list of code action it supports.
813825

814826
#### <a href="#version_3_10_0" name="version_3_10_0" class="anchor">3.10.0 (7/23/2018)</a>
815827

816-
* Add support for hierarchical document symbols as a valid response to a `textDocument/documentSymbol` request.
817-
* Add support for folding ranges as a valid response to a `textDocument/foldingRange` request.
828+
* Added support for hierarchical document symbols as a valid response to a `textDocument/documentSymbol` request.
829+
* Added support for folding ranges as a valid response to a `textDocument/foldingRange` request.
818830

819831
#### <a href="#version_3_9_0" name="version_3_9_0" class="anchor">3.9.0 (7/10/2018)</a>
820832

821-
* Add support for `preselect` property in `CompletionItem`
833+
* Added support for `preselect` property in `CompletionItem`
822834

823835
#### <a href="#version_3_8_0" name="version_3_8_0" class="anchor">3.8.0 (6/11/2018)</a>
824836

@@ -869,9 +881,9 @@ Decided to skip this version to bring the protocol version number in sync the wi
869881

870882
#### <a href="#version_3_0_0" name="version_3_0_0" class="anchor">3.0 Version</a>
871883

872-
- add support for client feature flags to support that servers can adapt to different client capabilities. An example is the new `textDocument/willSaveWaitUntil` request which not all clients might be able to support. If the feature is disabled in the client capabilities sent on the initialize request, the server can't rely on receiving the request.
873-
- add support to experiment with new features. The new `ClientCapabilities.experimental` section together with feature flags allow servers to provide experimental feature without the need of ALL clients to adopt them immediately.
884+
- Added support for client feature flags to support that servers can adapt to different client capabilities. An example is the new `textDocument/willSaveWaitUntil` request which not all clients might be able to support. If the feature is disabled in the client capabilities sent on the initialize request, the server can't rely on receiving the request.
885+
- Added support to experiment with new features. The new `ClientCapabilities.experimental` section together with feature flags allow servers to provide experimental feature without the need of ALL clients to adopt them immediately.
874886
- servers can more dynamically react to client features. Capabilities can now be registered and unregistered after the initialize request using the new `client/registerCapability` and `client/unregisterCapability`. This, for example, allows servers to react to settings or configuration changes without a restart.
875-
- add support for `textDocument/willSave` notification and `textDocument/willSaveWaitUntil` request.
876-
- add support for `textDocument/documentLink` request.
877-
- add a `rootUri` property to the initializeParams in favor of the `rootPath` property.
887+
- Added support for `textDocument/willSave` notification and `textDocument/willSaveWaitUntil` request.
888+
- Added support for `textDocument/documentLink` request.
889+
- Added a `rootUri` property to the initializeParams in favor of the `rootPath` property.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#### <a href="#workspace_textDocumentContent" name="workspace_textDocumentContent" class="anchor">Text Document Content Request (:leftwards_arrow_with_hook:)</a>
2+
3+
The `workspace/textDocumentContent` request is sent from the client to the server to dynamically fetch the content of a text document.
4+
5+
_Client Capability_:
6+
* property path (optional): `workspace.textDocumentContent`
7+
* property type: `TextDocumentContentClientCapabilities` defined as follows:
8+
9+
<div class="anchorHolder"><a href="#textDocumentContentClientCapabilities" name="textDocumentContentClientCapabilities" class="linkableAnchor"></a></div>
10+
11+
```typescript
12+
/**
13+
* Client capabilities for a text document content provider.
14+
*
15+
* @since 3.18.0
16+
*/
17+
export type TextDocumentContentClientCapabilities = {
18+
/**
19+
* Text document content provider supports dynamic registration.
20+
*/
21+
dynamicRegistration?: boolean;
22+
};
23+
```
24+
25+
_Server Capability_:
26+
* property path (optional): `workspace.textDocumentContent`
27+
* property type: `TextDocumentContentOptions` where `TextDocumentContentOptions` is defined as follows:
28+
29+
<div class="anchorHolder"><a href="#textDocumentContentOptions" name="textDocumentContentOptions" class="linkableAnchor"></a></div>
30+
31+
```typescript
32+
/**
33+
* Text document content provider options.
34+
*
35+
* @since 3.18.0
36+
*/
37+
export type TextDocumentContentOptions = {
38+
/**
39+
* The scheme for which the server provides content.
40+
*/
41+
scheme: string;
42+
};
43+
```
44+
45+
_Registration Options_: `TextDocumentContentRegistrationOptions` defined as follows:
46+
47+
<div class="anchorHolder"><a href="#textDocumentContentRegistrationOptions" name="textDocumentContentRegistrationOptions" class="linkableAnchor"></a></div>
48+
49+
```typescript
50+
/**
51+
* Text document content provider registration options.
52+
*
53+
* @since 3.18.0
54+
*/
55+
export type TextDocumentContentRegistrationOptions = TextDocumentContentOptions &
56+
StaticRegistrationOptions;
57+
```
58+
59+
_Request_:
60+
* method: 'workspace/textDocumentContent'
61+
* params: `TextDocumentContentParams` defined as follows:
62+
63+
<div class="anchorHolder"><a href="#textDocumentContentParams" name="textDocumentContentParams" class="linkableAnchor"></a></div>
64+
65+
```typescript
66+
/**
67+
* Parameters for the `workspace/textDocumentContent` request.
68+
*
69+
* @since 3.18.0
70+
*/
71+
export interface TextDocumentContentParams {
72+
/**
73+
* The uri of the text document.
74+
*/
75+
uri: DocumentUri;
76+
}
77+
```
78+
79+
_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.
81+
* error: code and message set in case an exception happens during the text document content request.
82+
83+
#### <a href="#workspace_textDocumentContentRefresh" name="workspace_textDocumentContentRefresh" class="anchor">Text Document Content Refresh Request (:arrow_right_hook:)</a>
84+
85+
The `workspace/textDocumentContent/refresh`request is sent from the server to the client to refresh the content of a specific text document.
86+
87+
_Request_:
88+
* method: 'workspace/textDocumentContent/refresh'
89+
* params: `TextDocumentContentRefreshParams` defined as follows:
90+
91+
<div class="anchorHolder"><a href="#textDocumentContentRefreshParams" name="textDocumentContentRefreshParams" class="linkableAnchor"></a></div>
92+
93+
```typescript
94+
/**
95+
* Parameters for the `workspace/textDocumentContent/refresh` request.
96+
*
97+
* @since 3.18.0
98+
*/
99+
export interface TextDocumentContentRefreshParams {
100+
/**
101+
* The uri of the text document to refresh.
102+
*/
103+
uri: DocumentUri;
104+
}
105+
```
106+
107+
_Response_:
108+
* result: `void`
109+
* error: code and message set in case an exception happens during the workspace symbol resolve request.

0 commit comments

Comments
 (0)