-
Notifications
You must be signed in to change notification settings - Fork 799
/
didSave.md
61 lines (47 loc) · 1.88 KB
/
didSave.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#### <a href="#textDocument_didSave" name="textDocument_didSave" class="anchor">DidSaveTextDocument Notification (:arrow_right:)</a>
The document save notification is sent from the client to the server when the document was saved in the client.
_Client Capability_:
* property name (optional): `textDocument.synchronization.didSave`
* property type: `boolean`
The capability indicates that the client supports `textDocument/didSave` notifications.
_Server Capability_:
* property name (optional): `textDocumentSync.save`
* property type: `boolean | SaveOptions` where `SaveOptions` is defined as follows:
<div class="anchorHolder"><a href="#saveOptions" name="saveOptions" class="linkableAnchor"></a></div>
```typescript
export interface SaveOptions {
/**
* The client is supposed to include the content on save.
*/
includeText?: boolean;
}
```
The capability indicates that the server is interested in `textDocument/didSave` notifications.
_Registration Options_: `TextDocumentSaveRegistrationOptions` defined as follows:
<div class="anchorHolder"><a href="#textDocumentSaveRegistrationOptions" name="textDocumentSaveRegistrationOptions" class="linkableAnchor"></a></div>
```typescript
export interface TextDocumentSaveRegistrationOptions
extends TextDocumentRegistrationOptions {
/**
* The client is supposed to include the content on save.
*/
includeText?: boolean;
}
```
_Notification_:
* method: `textDocument/didSave`
* params: `DidSaveTextDocumentParams` defined as follows:
<div class="anchorHolder"><a href="#didSaveTextDocumentParams" name="didSaveTextDocumentParams" class="linkableAnchor"></a></div>
```typescript
interface DidSaveTextDocumentParams {
/**
* The document that was saved.
*/
textDocument: TextDocumentIdentifier;
/**
* Optional the content when saved. Depends on the includeText value
* when the save notification was requested.
*/
text?: string;
}
```