vscode-languageserver-protocol 3.17.0-next.12 → 3.17.0-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,24 +101,26 @@ export declare namespace Proposed {
101
101
  const InlineValuesRefreshRequest: typeof iv.InlineValuesRefreshRequest;
102
102
  type $NotebookDocumentClientCapabilities = nb.$NotebookDocumentClientCapabilities;
103
103
  type NotebookDocumentSyncClientCapabilities = nb.NotebookDocumentSyncClientCapabilities;
104
- type $NotebookDocumentServerCapabilities = nb.$NotebookDocumentServerCapabilities;
104
+ type $NotebookDocumentSyncServerCapabilities = nb.$NotebookDocumentSyncServerCapabilities;
105
105
  type NotebookCellKind = nb.NotebookCellKind;
106
106
  const NotebookCellKind: typeof nb.NotebookCellKind;
107
107
  type NotebookCell = nb.NotebookCell;
108
108
  const NotebookCell: typeof nb.NotebookCell;
109
- type NotebookCellChange = nb.NotebookCellChange;
109
+ type NotebookCellArrayChange = nb.NotebookCellArrayChange;
110
110
  type NotebookDocument = nb.NotebookDocument;
111
111
  const NotebookDocument: typeof nb.NotebookDocument;
112
112
  type NotebookDocumentChangeEvent = nb.NotebookDocumentChangeEvent;
113
113
  type NotebookDocumentIdentifier = nb.NotebookDocumentIdentifier;
114
114
  type VersionedNotebookDocumentIdentifier = nb.VersionedNotebookDocumentIdentifier;
115
- type NotebookDocumentOptions = nb.NotebookDocumentOptions;
116
- type NotebookDocumentRegistrationOptions = nb.NotebookDocumentRegistrationOptions;
115
+ type NotebookDocumentSyncOptions = nb.NotebookDocumentSyncOptions;
116
+ type NotebookDocumentSyncRegistrationOptions = nb.NotebookDocumentSyncRegistrationOptions;
117
117
  const NotebookDocumentSyncRegistrationType: typeof nb.NotebookDocumentSyncRegistrationType;
118
118
  type DidOpenNotebookDocumentParams = nb.DidOpenNotebookDocumentParams;
119
119
  const DidOpenNotebookDocumentNotification: typeof nb.DidOpenNotebookDocumentNotification;
120
120
  type DidChangeNotebookDocumentParams = nb.DidChangeNotebookDocumentParams;
121
121
  const DidChangeNotebookDocumentNotification: typeof nb.DidChangeNotebookDocumentNotification;
122
+ type DidSaveNotebookDocumentParams = nb.DidSaveNotebookDocumentParams;
123
+ const DidSaveNotebookDocumentNotification: typeof nb.DidSaveNotebookDocumentNotification;
122
124
  type DidCloseNotebookDocumentParams = nb.DidCloseNotebookDocumentParams;
123
125
  const DidCloseNotebookDocumentNotification: typeof nb.DidCloseNotebookDocumentNotification;
124
126
  }
package/lib/common/api.js CHANGED
@@ -93,6 +93,7 @@ var Proposed;
93
93
  Proposed.NotebookDocumentSyncRegistrationType = nb.NotebookDocumentSyncRegistrationType;
94
94
  Proposed.DidOpenNotebookDocumentNotification = nb.DidOpenNotebookDocumentNotification;
95
95
  Proposed.DidChangeNotebookDocumentNotification = nb.DidChangeNotebookDocumentNotification;
96
+ Proposed.DidSaveNotebookDocumentNotification = nb.DidSaveNotebookDocumentNotification;
96
97
  Proposed.DidCloseNotebookDocumentNotification = nb.DidCloseNotebookDocumentNotification;
97
98
  })(Proposed = exports.Proposed || (exports.Proposed = {}));
98
99
  //# sourceMappingURL=api.js.map
@@ -5,7 +5,7 @@ import { PartialResultParams, StaticRegistrationOptions, WorkDoneProgressParams,
5
5
  /**
6
6
  * @since 3.17.0 - proposed state
7
7
  */
8
- export interface DiagnosticClientCapabilities {
8
+ export declare type DiagnosticClientCapabilities = {
9
9
  /**
10
10
  * Whether implementation supports dynamic registration. If this is set to `true`
11
11
  * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
@@ -16,18 +16,18 @@ export interface DiagnosticClientCapabilities {
16
16
  * Whether the clients supports related documents for document diagnostic pulls.
17
17
  */
18
18
  relatedDocumentSupport?: boolean;
19
- }
20
- export interface $DiagnosticClientCapabilities {
19
+ };
20
+ export declare type $DiagnosticClientCapabilities = {
21
21
  textDocument?: TextDocumentClientCapabilities & {
22
22
  diagnostic?: DiagnosticClientCapabilities;
23
23
  };
24
- }
24
+ };
25
25
  /**
26
26
  * Diagnostic options.
27
27
  *
28
28
  * @since 3.17.0 - proposed state
29
29
  */
30
- export interface DiagnosticOptions extends WorkDoneProgressOptions {
30
+ export declare type DiagnosticOptions = WorkDoneProgressOptions & {
31
31
  /**
32
32
  * An optional identifier under which the diagnostics are
33
33
  * managed by the client.
@@ -44,25 +44,24 @@ export interface DiagnosticOptions extends WorkDoneProgressOptions {
44
44
  * The server provides support for workspace diagnostics as well.
45
45
  */
46
46
  workspaceDiagnostics: boolean;
47
- }
47
+ };
48
48
  /**
49
49
  * Diagnostic registration options.
50
50
  *
51
51
  * @since 3.17.0 - proposed state
52
52
  */
53
- export interface DiagnosticRegistrationOptions extends TextDocumentRegistrationOptions, DiagnosticOptions, StaticRegistrationOptions {
54
- }
55
- export interface $DiagnosticServerCapabilities {
53
+ export declare type DiagnosticRegistrationOptions = TextDocumentRegistrationOptions & DiagnosticOptions & StaticRegistrationOptions;
54
+ export declare type $DiagnosticServerCapabilities = {
56
55
  diagnosticProvider?: DiagnosticOptions;
57
- }
56
+ };
58
57
  /**
59
58
  * Cancellation data returned from a diagnostic request.
60
59
  *
61
60
  * @since 3.17.0 - proposed state
62
61
  */
63
- export interface DiagnosticServerCancellationData {
62
+ export declare type DiagnosticServerCancellationData = {
64
63
  retriggerRequest: boolean;
65
- }
64
+ };
66
65
  /**
67
66
  * @since 3.17.0 - proposed state
68
67
  */
@@ -74,7 +73,7 @@ export declare namespace DiagnosticServerCancellationData {
74
73
  *
75
74
  * @since 3.17.0 - proposed state
76
75
  */
77
- export interface DocumentDiagnosticParams extends WorkDoneProgressParams, PartialResultParams {
76
+ export declare type DocumentDiagnosticParams = WorkDoneProgressParams & PartialResultParams & {
78
77
  /**
79
78
  * The text document.
80
79
  */
@@ -87,7 +86,7 @@ export interface DocumentDiagnosticParams extends WorkDoneProgressParams, Partia
87
86
  * The result id of a previous response if provided.
88
87
  */
89
88
  previousResultId?: string;
90
- }
89
+ };
91
90
  /**
92
91
  * The document diagnostic report kinds.
93
92
  *
@@ -110,7 +109,7 @@ export declare enum DocumentDiagnosticReportKind {
110
109
  *
111
110
  * @since 3.17.0 - proposed state
112
111
  */
113
- export interface FullDocumentDiagnosticReport {
112
+ export declare type FullDocumentDiagnosticReport = {
114
113
  /**
115
114
  * A full document diagnostic report.
116
115
  */
@@ -125,13 +124,13 @@ export interface FullDocumentDiagnosticReport {
125
124
  * The actual items.
126
125
  */
127
126
  items: Diagnostic[];
128
- }
127
+ };
129
128
  /**
130
129
  * A full diagnostic report with a set of related documents.
131
130
  *
132
131
  * @since 3.17.0 - proposed state
133
132
  */
134
- export interface RelatedFullDocumentDiagnosticReport extends FullDocumentDiagnosticReport {
133
+ export declare type RelatedFullDocumentDiagnosticReport = FullDocumentDiagnosticReport & {
135
134
  /**
136
135
  * Diagnostics of related documents. This information is useful
137
136
  * in programming languages where code in a file A can generate
@@ -144,14 +143,14 @@ export interface RelatedFullDocumentDiagnosticReport extends FullDocumentDiagnos
144
143
  relatedDocuments?: {
145
144
  [uri: string /** DocumentUri */]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
146
145
  };
147
- }
146
+ };
148
147
  /**
149
148
  * A diagnostic report indicating that the last returned
150
149
  * report is still accurate.
151
150
  *
152
151
  * @since 3.17.0 - proposed state
153
152
  */
154
- export interface UnchangedDocumentDiagnosticReport {
153
+ export declare type UnchangedDocumentDiagnosticReport = {
155
154
  /**
156
155
  * A document diagnostic report indicating
157
156
  * no changes to the last result. A server can
@@ -164,13 +163,13 @@ export interface UnchangedDocumentDiagnosticReport {
164
163
  * diagnostic request for the same document.
165
164
  */
166
165
  resultId: string;
167
- }
166
+ };
168
167
  /**
169
168
  * An unchanged diagnostic report with a set of related documents.
170
169
  *
171
170
  * @since 3.17.0 - proposed state
172
171
  */
173
- export interface RelatedUnchangedDocumentDiagnosticReport extends UnchangedDocumentDiagnosticReport {
172
+ export declare type RelatedUnchangedDocumentDiagnosticReport = UnchangedDocumentDiagnosticReport & {
174
173
  /**
175
174
  * Diagnostics of related documents. This information is useful
176
175
  * in programming languages where code in a file A can generate
@@ -183,7 +182,7 @@ export interface RelatedUnchangedDocumentDiagnosticReport extends UnchangedDocum
183
182
  relatedDocuments?: {
184
183
  [uri: string /** DocumentUri */]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
185
184
  };
186
- }
185
+ };
187
186
  /**
188
187
  * The result of a document diagnostic pull request. A report can
189
188
  * either be a full report containing all diagnostics for the
@@ -199,11 +198,11 @@ export declare type DocumentDiagnosticReport = RelatedFullDocumentDiagnosticRepo
199
198
  *
200
199
  * @since 3.17.0 - proposed state
201
200
  */
202
- export interface DocumentDiagnosticReportPartialResult {
201
+ export declare type DocumentDiagnosticReportPartialResult = {
203
202
  relatedDocuments: {
204
203
  [uri: string /** DocumentUri */]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
205
204
  };
206
- }
205
+ };
207
206
  /**
208
207
  * The document diagnostic request definition.
209
208
  *
@@ -236,7 +235,7 @@ export declare type PreviousResultId = {
236
235
  *
237
236
  * @since 3.17.0 - proposed state
238
237
  */
239
- export interface WorkspaceDiagnosticParams extends WorkDoneProgressParams, PartialResultParams {
238
+ export declare type WorkspaceDiagnosticParams = WorkDoneProgressParams & PartialResultParams & {
240
239
  /**
241
240
  * The additional identifier provided during registration.
242
241
  */
@@ -246,13 +245,13 @@ export interface WorkspaceDiagnosticParams extends WorkDoneProgressParams, Parti
246
245
  * previous result ids.
247
246
  */
248
247
  previousResultIds: PreviousResultId[];
249
- }
248
+ };
250
249
  /**
251
250
  * A full document diagnostic report for a workspace diagnostic result.
252
251
  *
253
252
  * @since 3.17.0 - proposed state
254
253
  */
255
- export interface WorkspaceFullDocumentDiagnosticReport extends FullDocumentDiagnosticReport {
254
+ export declare type WorkspaceFullDocumentDiagnosticReport = FullDocumentDiagnosticReport & {
256
255
  /**
257
256
  * The URI for which diagnostic information is reported.
258
257
  */
@@ -262,13 +261,13 @@ export interface WorkspaceFullDocumentDiagnosticReport extends FullDocumentDiagn
262
261
  * If the document is not marked as open `null` can be provided.
263
262
  */
264
263
  version: integer | null;
265
- }
264
+ };
266
265
  /**
267
266
  * An unchanged document diagnostic report for a workspace diagnostic result.
268
267
  *
269
268
  * @since 3.17.0 - proposed state
270
269
  */
271
- export interface WorkspaceUnchangedDocumentDiagnosticReport extends UnchangedDocumentDiagnosticReport {
270
+ export declare type WorkspaceUnchangedDocumentDiagnosticReport = UnchangedDocumentDiagnosticReport & {
272
271
  /**
273
272
  * The URI for which diagnostic information is reported.
274
273
  */
@@ -278,7 +277,7 @@ export interface WorkspaceUnchangedDocumentDiagnosticReport extends UnchangedDoc
278
277
  * If the document is not marked as open `null` can be provided.
279
278
  */
280
279
  version: integer | null;
281
- }
280
+ };
282
281
  /**
283
282
  * A workspace diagnostic document report.
284
283
  *
@@ -290,17 +289,17 @@ export declare type WorkspaceDocumentDiagnosticReport = WorkspaceFullDocumentDia
290
289
  *
291
290
  * @since 3.17.0 - proposed state
292
291
  */
293
- export interface WorkspaceDiagnosticReport {
292
+ export declare type WorkspaceDiagnosticReport = {
294
293
  items: WorkspaceDocumentDiagnosticReport[];
295
- }
294
+ };
296
295
  /**
297
296
  * A partial result for a workspace diagnostic report.
298
297
  *
299
298
  * @since 3.17.0 - proposed state
300
299
  */
301
- export interface WorkspaceDiagnosticReportPartialResult {
300
+ export declare type WorkspaceDiagnosticReportPartialResult = {
302
301
  items: WorkspaceDocumentDiagnosticReport[];
303
- }
302
+ };
304
303
  /**
305
304
  * The workspace diagnostic request definition.
306
305
  *
@@ -7,18 +7,18 @@ import { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRegistr
7
7
  *
8
8
  * @since 3.17.0 - proposed state
9
9
  */
10
- export interface InlineValuesClientCapabilities {
10
+ export declare type InlineValuesClientCapabilities = {
11
11
  /**
12
12
  * Whether implementation supports dynamic registration for inline value providers.
13
13
  */
14
14
  dynamicRegistration?: boolean;
15
- }
15
+ };
16
16
  /**
17
17
  * Client workspace capabilities specific to inline values.
18
18
  *
19
19
  * @since 3.17.0 - proposed state
20
20
  */
21
- export interface InlineValuesWorkspaceClientCapabilities {
21
+ export declare type InlineValuesWorkspaceClientCapabilities = {
22
22
  /**
23
23
  * Whether the client implementation supports a refresh request sent from the
24
24
  * server to the client.
@@ -29,27 +29,25 @@ export interface InlineValuesWorkspaceClientCapabilities {
29
29
  * change that requires such a calculation.
30
30
  */
31
31
  refreshSupport?: boolean;
32
- }
32
+ };
33
33
  /**
34
34
  * Inline values options used during static registration.
35
35
  *
36
36
  * @since 3.17.0 - proposed state
37
37
  */
38
- export interface InlineValuesOptions extends WorkDoneProgressOptions {
39
- }
38
+ export declare type InlineValuesOptions = WorkDoneProgressOptions;
40
39
  /**
41
40
  * Inline value options used during static or dynamic registration.
42
41
  *
43
42
  * @since 3.17.0 - proposed state
44
43
  */
45
- export interface InlineValuesRegistrationOptions extends InlineValuesOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions {
46
- }
44
+ export declare type InlineValuesRegistrationOptions = InlineValuesOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
47
45
  /**
48
46
  * A parameter literal used in inline values requests.
49
47
  *
50
48
  * @since 3.17.0 - proposed state
51
49
  */
52
- export interface InlineValuesParams extends WorkDoneProgressParams {
50
+ export declare type InlineValuesParams = WorkDoneProgressParams & {
53
51
  /**
54
52
  * The text document.
55
53
  */
@@ -63,7 +61,7 @@ export interface InlineValuesParams extends WorkDoneProgressParams {
63
61
  * requested.
64
62
  */
65
63
  context: InlineValuesContext;
66
- }
64
+ };
67
65
  /**
68
66
  * A request to provide inline values in a document. The request's parameter is of
69
67
  * type [InlineValuesParams](#InlineValuesParams), the response is of type
@@ -1,12 +1,12 @@
1
- import { URI, integer, DocumentUri, uinteger } from 'vscode-languageserver-types';
1
+ import { URI, integer, DocumentUri, uinteger, LSPObject, TextDocumentItem, TextDocumentIdentifier, VersionedTextDocumentIdentifier } from 'vscode-languageserver-types';
2
2
  import { ProtocolNotificationType, RegistrationType } from './messages';
3
- import { StaticRegistrationOptions, NotebookDocumentFilter } from './protocol';
3
+ import { StaticRegistrationOptions, NotebookDocumentFilter, TextDocumentContentChangeEvent } from './protocol';
4
4
  /**
5
5
  * Notebook specific client capabilities.
6
6
  *
7
7
  * @since 3.17.0 - proposed state
8
8
  */
9
- export interface NotebookDocumentSyncClientCapabilities {
9
+ export declare type NotebookDocumentSyncClientCapabilities = {
10
10
  /**
11
11
  * Whether implementation supports dynamic registration. If this is
12
12
  * set to `true` the client supports the new
@@ -14,12 +14,21 @@ export interface NotebookDocumentSyncClientCapabilities {
14
14
  * return value for the corresponding server capability as well.
15
15
  */
16
16
  dynamicRegistration?: boolean;
17
- }
18
- export interface $NotebookDocumentClientCapabilities {
17
+ /**
18
+ * The client supports sending execution summary data per cell.
19
+ */
20
+ executionSummarySupport?: boolean;
21
+ /**
22
+ * The client has support for notebook controllers and might
23
+ * send `DidSelectNotebookController` notifications.
24
+ */
25
+ notebookControllerSupport?: boolean;
26
+ };
27
+ export declare type $NotebookDocumentClientCapabilities = {
19
28
  notebookDocument?: {
20
29
  synchronization: NotebookDocumentSyncClientCapabilities;
21
30
  };
22
- }
31
+ };
23
32
  /**
24
33
  * A notebook cell kind.
25
34
  *
@@ -37,58 +46,64 @@ export declare namespace NotebookCellKind {
37
46
  function is(value: any): value is NotebookCellKind;
38
47
  }
39
48
  export declare type NotebookCellKind = 1 | 2;
49
+ export declare type ExecutionSummary = {
50
+ /**
51
+ * A strict monotonically increasing value
52
+ * indicating the execution order of a cell
53
+ * inside a notebook.
54
+ */
55
+ executionOrder: uinteger;
56
+ /**
57
+ * Whether the execution was successful or
58
+ * not if known by the client.
59
+ */
60
+ success?: boolean;
61
+ };
62
+ export declare namespace ExecutionSummary {
63
+ function create(executionOrder: number, success?: boolean): ExecutionSummary;
64
+ function is(value: any): value is ExecutionSummary;
65
+ function equals(one: ExecutionSummary | undefined, other: ExecutionSummary | undefined): boolean;
66
+ }
40
67
  /**
41
68
  * A notebook cell.
42
69
  *
70
+ * A cell's document URI must be unique across ALL notebook
71
+ * cells and can therefore be used to uniquely identify a
72
+ * notebook cell or the cell's text document.
73
+ *
43
74
  * @since 3.17.0 - proposed state
44
75
  */
45
- export interface NotebookCell {
76
+ export declare type NotebookCell = {
46
77
  /**
47
78
  * The cell's kind
48
79
  */
49
80
  kind: NotebookCellKind;
50
81
  /**
51
- * The cell's text represented as a text document.
52
- * The document's content is synced using the
53
- * existing text document sync notifications.
82
+ * The URI of the cell's text document
83
+ * content.
54
84
  */
55
85
  document: DocumentUri;
56
- }
57
- export declare namespace NotebookCell {
58
- function create(kind: NotebookCellKind, document: DocumentUri): NotebookCell;
59
- function is(value: any): value is NotebookCell;
60
- function equal(one: NotebookCell, two: NotebookCell): boolean;
61
- }
62
- /**
63
- * A change describing how to move a `NotebookCell`
64
- * array from state S' to S''.
65
- *
66
- * @since 3.17.0 - proposed state
67
- */
68
- export interface NotebookCellChange {
69
86
  /**
70
- * The start oftest of the cell that changed.
87
+ * Additional metadata stored with the cell.
71
88
  */
72
- start: uinteger;
89
+ metadata?: LSPObject;
73
90
  /**
74
- * The deleted cells
91
+ * Additional execution summary information
92
+ * if supported by the client.
75
93
  */
76
- deleteCount: uinteger;
77
- /**
78
- * The new cells, if any
79
- */
80
- cells?: NotebookCell[];
81
- }
82
- export declare namespace NotebookCellChange {
83
- function is(value: any): value is NotebookCellChange;
84
- function create(start: uinteger, deleteCount: uinteger, cells?: NotebookCell[]): NotebookCellChange;
94
+ executionSummary?: ExecutionSummary;
95
+ };
96
+ export declare namespace NotebookCell {
97
+ function create(kind: NotebookCellKind, document: DocumentUri): NotebookCell;
98
+ function is(value: any): value is NotebookCell;
99
+ function diff(one: NotebookCell, two: NotebookCell): Set<keyof NotebookCell>;
85
100
  }
86
101
  /**
87
102
  * A notebook document.
88
103
  *
89
104
  * @since 3.17.0 - proposed state
90
105
  */
91
- export interface NotebookDocument {
106
+ export declare type NotebookDocument = {
92
107
  /**
93
108
  * The notebook document's uri.
94
109
  */
@@ -102,11 +117,16 @@ export interface NotebookDocument {
102
117
  * change, including undo/redo).
103
118
  */
104
119
  version: integer;
120
+ /**
121
+ * Additional metadata stored with the notebook
122
+ * document.
123
+ */
124
+ metadata?: LSPObject;
105
125
  /**
106
126
  * The cells of a notebook.
107
127
  */
108
128
  cells: NotebookCell[];
109
- }
129
+ };
110
130
  export declare namespace NotebookDocument {
111
131
  function create(uri: URI, notebookType: string, version: integer, cells: NotebookCell[]): NotebookDocument;
112
132
  function is(value: any): value is NotebookDocument;
@@ -116,18 +136,18 @@ export declare namespace NotebookDocument {
116
136
  *
117
137
  * @since 3.17.0 - proposed state
118
138
  */
119
- export interface NotebookDocumentIdentifier {
139
+ export declare type NotebookDocumentIdentifier = {
120
140
  /**
121
141
  * The notebook document's uri.
122
142
  */
123
143
  uri: URI;
124
- }
144
+ };
125
145
  /**
126
146
  * A versioned notebook document identifier.
127
147
  *
128
148
  * @since 3.17.0 - proposed state
129
149
  */
130
- export interface VersionedNotebookDocumentIdentifier {
150
+ export declare type VersionedNotebookDocumentIdentifier = {
131
151
  /**
132
152
  * The version number of this notebook document.
133
153
  */
@@ -136,12 +156,12 @@ export interface VersionedNotebookDocumentIdentifier {
136
156
  * The notebook document's uri.
137
157
  */
138
158
  uri: URI;
139
- }
159
+ };
140
160
  /**
141
161
  * Options specific to a notebook plus its cells
142
162
  * to be synced to the server.
143
163
  *
144
- * If a selector provider a notebook document
164
+ * If a selector provide a notebook document
145
165
  * filter but no cell selector all cells of a
146
166
  * matching notebook document will be synced.
147
167
  *
@@ -152,8 +172,11 @@ export interface VersionedNotebookDocumentIdentifier {
152
172
  *
153
173
  * @since 3.17.0 - proposed state
154
174
  */
155
- export declare type NotebookDocumentOptions = {
156
- notebookDocumentSelector?: ({
175
+ export declare type NotebookDocumentSyncOptions = {
176
+ /**
177
+ * The notebook document to be synced
178
+ */
179
+ notebookDocumentSelector: ({
157
180
  /** The notebook documents to be synced */
158
181
  notebookDocumentFilter: NotebookDocumentFilter;
159
182
  /** The cells of the matching notebook to be synced */
@@ -168,31 +191,53 @@ export declare type NotebookDocumentOptions = {
168
191
  language: string;
169
192
  }[];
170
193
  })[];
194
+ /**
195
+ * Determines how the notebook is synchronized.
196
+ *
197
+ * If set to 'notebook' the notebook document,
198
+ * its meta data, cell structure and the cell's
199
+ * text documents are synchronized.
200
+ *
201
+ * If set to 'cellContent' only the cell content
202
+ * is synchronized using the available
203
+ * `textDocument/did*` notifications.
204
+ */
205
+ mode: 'notebook' | 'cellContent';
206
+ /**
207
+ * Whether save notification should be forwarded to
208
+ * the server. Will only be honored if mode === `notebook`.
209
+ */
210
+ save?: boolean;
171
211
  };
172
- export interface $NotebookDocumentServerCapabilities {
173
- notebookDocumentSync?: NotebookDocumentOptions | NotebookDocumentRegistrationOptions;
174
- }
175
212
  /**
176
213
  * Registration options specific to a notebook.
177
214
  *
178
215
  * @since 3.17.0 - proposed state
179
216
  */
180
- export declare type NotebookDocumentRegistrationOptions = NotebookDocumentOptions & StaticRegistrationOptions;
217
+ export declare type NotebookDocumentSyncRegistrationOptions = NotebookDocumentSyncOptions & StaticRegistrationOptions;
218
+ export interface $NotebookDocumentSyncServerCapabilities {
219
+ notebookDocumentSync?: NotebookDocumentSyncOptions | NotebookDocumentSyncRegistrationOptions;
220
+ }
181
221
  export declare namespace NotebookDocumentSyncRegistrationType {
182
222
  const method: 'notebookDocument/sync';
183
- const type: RegistrationType<NotebookDocumentRegistrationOptions>;
223
+ const type: RegistrationType<NotebookDocumentSyncRegistrationOptions>;
184
224
  }
185
225
  /**
186
226
  * The params sent in a open notebook document notification.
187
227
  *
188
228
  * @since 3.17.0 - proposed state
189
229
  */
190
- export interface DidOpenNotebookDocumentParams {
230
+ export declare type DidOpenNotebookDocumentParams = {
191
231
  /**
192
232
  * The notebook document that got opened.
193
233
  */
194
234
  notebookDocument: NotebookDocument;
195
- }
235
+ /**
236
+ * The text documents that represent the content
237
+ * of a notebook cell.
238
+ */
239
+ cellTextDocuments: TextDocumentItem[];
240
+ };
196
241
  /**
197
242
  * A notification sent when a notebook opens.
198
243
  *
@@ -202,13 +247,87 @@ export declare namespace DidOpenNotebookDocumentNotification {
202
247
  const method: 'notebookDocument/didOpen';
203
248
  const type: ProtocolNotificationType<DidOpenNotebookDocumentParams, void>;
204
249
  }
205
- export interface NotebookDocumentChangeEvent {
206
- cells: NotebookCellChange;
250
+ /**
251
+ * A change describing how to move a `NotebookCell`
252
+ * array from state S to S'.
253
+ *
254
+ * @since 3.17.0 - proposed state
255
+ */
256
+ export declare type NotebookCellArrayChange = {
257
+ /**
258
+ * The start oftest of the cell that changed.
259
+ */
260
+ start: uinteger;
261
+ /**
262
+ * The deleted cells
263
+ */
264
+ deleteCount: uinteger;
265
+ /**
266
+ * The new cells, if any
267
+ */
268
+ cells?: NotebookCell[];
269
+ };
270
+ export declare namespace NotebookCellArrayChange {
271
+ function is(value: any): value is NotebookCellArrayChange;
272
+ function create(start: uinteger, deleteCount: uinteger, cells?: NotebookCell[]): NotebookCellArrayChange;
207
273
  }
208
- export interface DidChangeNotebookDocumentParams {
274
+ /**
275
+ * A change event for a notebook document.
276
+ *
277
+ * @since 3.17.0 - proposed state
278
+ */
279
+ export declare type NotebookDocumentChangeEvent = {
280
+ /**
281
+ * The changed meta data if any.
282
+ */
283
+ metadata?: LSPObject;
284
+ /**
285
+ * Changes to cells
286
+ */
287
+ cells?: {
288
+ /**
289
+ * Changes to the cell structure to add or
290
+ * remove cells.
291
+ */
292
+ structure?: {
293
+ /**
294
+ * The change to the cell array.
295
+ */
296
+ array: NotebookCellArrayChange;
297
+ /**
298
+ * Additional opened cell text documents.
299
+ */
300
+ didOpen?: TextDocumentItem[];
301
+ /**
302
+ * Additional closed cell text documents.
303
+ */
304
+ didClose?: TextDocumentIdentifier[];
305
+ };
306
+ /**
307
+ * Changes to notebook cells properties like its
308
+ * kind, execution summary or metadata.
309
+ */
310
+ data?: NotebookCell[];
311
+ /**
312
+ * Changes to the text content of notebook cells.
313
+ */
314
+ textContent?: {
315
+ document: VersionedTextDocumentIdentifier;
316
+ changes: TextDocumentContentChangeEvent[];
317
+ }[];
318
+ };
319
+ };
320
+ /**
321
+ * The params sent in a change notebook document notification.
322
+ *
323
+ * @since 3.17.0 - proposed state
324
+ */
325
+ export declare type DidChangeNotebookDocumentParams = {
209
326
  /**
210
327
  * The notebook document that did change. The version number points
211
- * to the version after all provided changes have been applied.
328
+ * to the version after all provided changes have been applied. If
329
+ * only the text document content of a cell changes the notebook version
330
+ * doesn't necessarily have to change.
212
331
  */
213
332
  notebookDocument: VersionedNotebookDocumentIdentifier;
214
333
  /**
@@ -226,23 +345,48 @@ export interface DidChangeNotebookDocumentParams {
226
345
  * - apply the `NotebookChangeEvent`s in a single notification in the order
227
346
  * you receive them.
228
347
  */
229
- changes: NotebookDocumentChangeEvent[];
230
- }
348
+ change: NotebookDocumentChangeEvent;
349
+ };
231
350
  export declare namespace DidChangeNotebookDocumentNotification {
232
351
  const method: 'notebookDocument/didChange';
233
352
  const type: ProtocolNotificationType<DidChangeNotebookDocumentParams, void>;
234
353
  }
235
354
  /**
236
- * The params sent in a close notebook document notification.
355
+ * The params sent in a save notebook document notification.
237
356
  *
238
357
  * @since 3.17.0 - proposed state
239
358
  */
240
- export interface DidCloseNotebookDocumentParams {
359
+ export declare type DidSaveNotebookDocumentParams = {
241
360
  /**
242
- * The notebook document that got opened.
361
+ * The notebook document that got saved.
243
362
  */
244
363
  notebookDocument: NotebookDocumentIdentifier;
364
+ };
365
+ /**
366
+ * A notification sent when a notebook document is saved.
367
+ *
368
+ * @since 3.17.0 - proposed state
369
+ */
370
+ export declare namespace DidSaveNotebookDocumentNotification {
371
+ const method: 'notebookDocument/didSave';
372
+ const type: ProtocolNotificationType<DidSaveNotebookDocumentParams, void>;
245
373
  }
374
+ /**
375
+ * The params sent in a close notebook document notification.
376
+ *
377
+ * @since 3.17.0 - proposed state
378
+ */
379
+ export declare type DidCloseNotebookDocumentParams = {
380
+ /**
381
+ * The notebook document that got closed.
382
+ */
383
+ notebookDocument: NotebookDocumentIdentifier;
384
+ /**
385
+ * The text documents that represent the content
386
+ * of a notebook cell that got closed.
387
+ */
388
+ cellTextDocuments: TextDocumentIdentifier[];
389
+ };
246
390
  /**
247
391
  * A notification sent when a notebook closes.
248
392
  *
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License. See License.txt in the project root for license information.
5
5
  * ------------------------------------------------------------------------------------------ */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DidCloseNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCellChange = exports.NotebookCell = exports.NotebookCellKind = void 0;
7
+ exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = void 0;
8
8
  const vscode_languageserver_types_1 = require("vscode-languageserver-types");
9
9
  const Is = require("./utils/is");
10
10
  const messages_1 = require("./messages");
@@ -28,6 +28,32 @@ var NotebookCellKind;
28
28
  }
29
29
  NotebookCellKind.is = is;
30
30
  })(NotebookCellKind = exports.NotebookCellKind || (exports.NotebookCellKind = {}));
31
+ var ExecutionSummary;
32
+ (function (ExecutionSummary) {
33
+ function create(executionOrder, success) {
34
+ const result = { executionOrder };
35
+ if (success === true || success === false) {
36
+ result.success = success;
37
+ }
38
+ return result;
39
+ }
40
+ ExecutionSummary.create = create;
41
+ function is(value) {
42
+ const candidate = value;
43
+ return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.executionOrder) && (candidate.success === undefined || Is.boolean(candidate.success));
44
+ }
45
+ ExecutionSummary.is = is;
46
+ function equals(one, other) {
47
+ if (one === other) {
48
+ return true;
49
+ }
50
+ if (one === null || one === undefined || other === null || other === undefined) {
51
+ return false;
52
+ }
53
+ return one.executionOrder === other.executionOrder && one.success === other.success;
54
+ }
55
+ ExecutionSummary.equals = equals;
56
+ })(ExecutionSummary = exports.ExecutionSummary || (exports.ExecutionSummary = {}));
31
57
  var NotebookCell;
32
58
  (function (NotebookCell) {
33
59
  function create(kind, document) {
@@ -36,30 +62,79 @@ var NotebookCell;
36
62
  NotebookCell.create = create;
37
63
  function is(value) {
38
64
  const candidate = value;
39
- return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document);
65
+ return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) &&
66
+ (candidate.metadata === undefined || Is.objectLiteral(candidate.metadata));
40
67
  }
41
68
  NotebookCell.is = is;
42
- function equal(one, two) {
43
- return one.kind === two.kind && one.document === two.document;
44
- }
45
- NotebookCell.equal = equal;
46
- })(NotebookCell = exports.NotebookCell || (exports.NotebookCell = {}));
47
- var NotebookCellChange;
48
- (function (NotebookCellChange) {
49
- function is(value) {
50
- const candidate = value;
51
- return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));
52
- }
53
- NotebookCellChange.is = is;
54
- function create(start, deleteCount, cells) {
55
- const result = { start, deleteCount };
56
- if (cells !== undefined) {
57
- result.cells = cells;
69
+ function diff(one, two) {
70
+ const result = new Set();
71
+ if (one.document !== two.document) {
72
+ result.add('document');
73
+ }
74
+ if (one.kind !== two.kind) {
75
+ result.add('kind');
76
+ }
77
+ if (one.executionSummary !== two.executionSummary) {
78
+ result.add('executionSummary');
79
+ }
80
+ if ((one.metadata !== undefined || two.metadata !== undefined) && !equalsMetadata(one.metadata, two.metadata)) {
81
+ result.add('metadata');
82
+ }
83
+ if ((one.executionSummary !== undefined || two.executionSummary !== undefined) && !ExecutionSummary.equals(one.executionSummary, two.executionSummary)) {
84
+ result.add('executionSummary');
58
85
  }
59
86
  return result;
60
87
  }
61
- NotebookCellChange.create = create;
62
- })(NotebookCellChange = exports.NotebookCellChange || (exports.NotebookCellChange = {}));
88
+ NotebookCell.diff = diff;
89
+ function equalsMetadata(one, other) {
90
+ if (one === other) {
91
+ return true;
92
+ }
93
+ if (one === null || one === undefined || other === null || other === undefined) {
94
+ return false;
95
+ }
96
+ if (typeof one !== typeof other) {
97
+ return false;
98
+ }
99
+ if (typeof one !== 'object') {
100
+ return false;
101
+ }
102
+ const oneArray = Array.isArray(one);
103
+ const otherArray = Array.isArray(other);
104
+ if (oneArray !== otherArray) {
105
+ return false;
106
+ }
107
+ if (oneArray && otherArray) {
108
+ if (one.length !== other.length) {
109
+ return false;
110
+ }
111
+ for (let i = 0; i < one.length; i++) {
112
+ if (!equalsMetadata(one[i], other[i])) {
113
+ return false;
114
+ }
115
+ }
116
+ }
117
+ if (Is.objectLiteral(one) && Is.objectLiteral(other)) {
118
+ const oneKeys = Object.keys(one);
119
+ const otherKeys = Object.keys(other);
120
+ if (oneKeys.length !== otherKeys.length) {
121
+ return false;
122
+ }
123
+ oneKeys.sort();
124
+ otherKeys.sort();
125
+ if (!equalsMetadata(oneKeys, otherKeys)) {
126
+ return false;
127
+ }
128
+ for (let i = 0; i < oneKeys.length; i++) {
129
+ const prop = oneKeys[i];
130
+ if (!equalsMetadata(one[prop], other[prop])) {
131
+ return false;
132
+ }
133
+ }
134
+ }
135
+ return true;
136
+ }
137
+ })(NotebookCell = exports.NotebookCell || (exports.NotebookCell = {}));
63
138
  var NotebookDocument;
64
139
  (function (NotebookDocument) {
65
140
  function create(uri, notebookType, version, cells) {
@@ -87,11 +162,37 @@ var DidOpenNotebookDocumentNotification;
87
162
  DidOpenNotebookDocumentNotification.method = 'notebookDocument/didOpen';
88
163
  DidOpenNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenNotebookDocumentNotification.method);
89
164
  })(DidOpenNotebookDocumentNotification = exports.DidOpenNotebookDocumentNotification || (exports.DidOpenNotebookDocumentNotification = {}));
165
+ var NotebookCellArrayChange;
166
+ (function (NotebookCellArrayChange) {
167
+ function is(value) {
168
+ const candidate = value;
169
+ return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));
170
+ }
171
+ NotebookCellArrayChange.is = is;
172
+ function create(start, deleteCount, cells) {
173
+ const result = { start, deleteCount };
174
+ if (cells !== undefined) {
175
+ result.cells = cells;
176
+ }
177
+ return result;
178
+ }
179
+ NotebookCellArrayChange.create = create;
180
+ })(NotebookCellArrayChange = exports.NotebookCellArrayChange || (exports.NotebookCellArrayChange = {}));
90
181
  var DidChangeNotebookDocumentNotification;
91
182
  (function (DidChangeNotebookDocumentNotification) {
92
183
  DidChangeNotebookDocumentNotification.method = 'notebookDocument/didChange';
93
184
  DidChangeNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeNotebookDocumentNotification.method);
94
185
  })(DidChangeNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification || (exports.DidChangeNotebookDocumentNotification = {}));
186
+ /**
187
+ * A notification sent when a notebook document is saved.
188
+ *
189
+ * @since 3.17.0 - proposed state
190
+ */
191
+ var DidSaveNotebookDocumentNotification;
192
+ (function (DidSaveNotebookDocumentNotification) {
193
+ DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave';
194
+ DidSaveNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method);
195
+ })(DidSaveNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification || (exports.DidSaveNotebookDocumentNotification = {}));
95
196
  /**
96
197
  * A notification sent when a notebook closes.
97
198
  *
@@ -5,35 +5,32 @@ import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumen
5
5
  /**
6
6
  * @since 3.17.0 - proposed state
7
7
  */
8
- export interface TypeHierarchyClientCapabilities {
8
+ export declare type TypeHierarchyClientCapabilities = {
9
9
  /**
10
10
  * Whether implementation supports dynamic registration. If this is set to `true`
11
11
  * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
12
12
  * return value for the corresponding server capability as well.
13
13
  */
14
14
  dynamicRegistration?: boolean;
15
- }
15
+ };
16
16
  /**
17
17
  * Type hierarchy options used during static registration.
18
18
  *
19
19
  * @since 3.17.0 - proposed state
20
20
  */
21
- export interface TypeHierarchyOptions extends WorkDoneProgressOptions {
22
- }
21
+ export declare type TypeHierarchyOptions = WorkDoneProgressOptions;
23
22
  /**
24
23
  * Type hierarchy options used during static or dynamic registration.
25
24
  *
26
25
  * @since 3.17.0 - proposed state
27
26
  */
28
- export interface TypeHierarchyRegistrationOptions extends TextDocumentRegistrationOptions, TypeHierarchyOptions, StaticRegistrationOptions {
29
- }
27
+ export declare type TypeHierarchyRegistrationOptions = TextDocumentRegistrationOptions & TypeHierarchyOptions & StaticRegistrationOptions;
30
28
  /**
31
29
  * The parameter of a `textDocument/prepareTypeHierarchy` request.
32
30
  *
33
31
  * @since 3.17.0 - proposed state
34
32
  */
35
- export interface TypeHierarchyPrepareParams extends TextDocumentPositionParams, WorkDoneProgressParams {
36
- }
33
+ export declare type TypeHierarchyPrepareParams = TextDocumentPositionParams & WorkDoneProgressParams;
37
34
  /**
38
35
  * A request to result a `TypeHierarchyItem` in a document at a given position.
39
36
  * Can be used as an input to a subtypes or supertypes type hierarchy.
@@ -50,9 +47,9 @@ export declare namespace TypeHierarchyPrepareRequest {
50
47
  *
51
48
  * @since 3.17.0 - proposed state
52
49
  */
53
- export interface TypeHierarchySupertypesParams extends WorkDoneProgressParams, PartialResultParams {
50
+ export declare type TypeHierarchySupertypesParams = WorkDoneProgressParams & PartialResultParams & {
54
51
  item: TypeHierarchyItem;
55
- }
52
+ };
56
53
  /**
57
54
  * A request to resolve the supertypes for a given `TypeHierarchyItem`.
58
55
  *
@@ -68,9 +65,9 @@ export declare namespace TypeHierarchySupertypesRequest {
68
65
  *
69
66
  * @since 3.17.0 - proposed state
70
67
  */
71
- export interface TypeHierarchySubtypesParams extends WorkDoneProgressParams, PartialResultParams {
68
+ export declare type TypeHierarchySubtypesParams = WorkDoneProgressParams & PartialResultParams & {
72
69
  item: TypeHierarchyItem;
73
- }
70
+ };
74
71
  /**
75
72
  * A request to resolve the subtypes for a given `TypeHierarchyItem`.
76
73
  *
@@ -129,6 +129,19 @@ export declare type NotebookCellTextDocumentFilter = {
129
129
  * notebook cell document.
130
130
  */
131
131
  cellLanguage?: string;
132
+ } | {
133
+ /**
134
+ * A filter that matches against the notebook
135
+ * containing the notebook cell.
136
+ */
137
+ notebookDocument?: NotebookDocumentFilter;
138
+ /**
139
+ * A language id like `python`.
140
+ *
141
+ * Will be matched against the language id of the
142
+ * notebook cell document.
143
+ */
144
+ cellLanguage: string;
132
145
  };
133
146
  /**
134
147
  * The NotebookCellTextDocumentFilter namespace provides helper functions to work with
@@ -97,7 +97,7 @@ var NotebookCellTextDocumentFilter;
97
97
  (function (NotebookCellTextDocumentFilter) {
98
98
  function is(value) {
99
99
  const candidate = value;
100
- return Is.objectLiteral(candidate) && NotebookDocumentFilter.is(candidate.notebookDocument) && (candidate.cellLanguage === undefined || Is.string(candidate.cellLanguage));
100
+ return Is.objectLiteral(candidate) && (NotebookDocumentFilter.is(candidate.notebookDocument) || Is.string(candidate.cellLanguage));
101
101
  }
102
102
  NotebookCellTextDocumentFilter.is = is;
103
103
  })(NotebookCellTextDocumentFilter = exports.NotebookCellTextDocumentFilter || (exports.NotebookCellTextDocumentFilter = {}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vscode-languageserver-protocol",
3
3
  "description": "VSCode Language Server Protocol implementation",
4
- "version": "3.17.0-next.12",
4
+ "version": "3.17.0-next.15",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "typings": "./lib/common/api.d.ts",
20
20
  "dependencies": {
21
- "vscode-jsonrpc": "8.0.0-next.5",
22
- "vscode-languageserver-types": "3.17.0-next.6"
21
+ "vscode-jsonrpc": "8.0.0-next.7",
22
+ "vscode-languageserver-types": "3.17.0-next.8"
23
23
  },
24
24
  "scripts": {
25
25
  "prepublishOnly": "git clean -xfd . && npm install && npm run clean && npm run compile && npm test",