vscode-languageserver-protocol 3.17.0-next.2 → 3.17.0-next.20

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.
Files changed (47) hide show
  1. package/lib/browser/main.js +1 -1
  2. package/lib/common/api.d.ts +31 -10
  3. package/lib/common/api.js +32 -7
  4. package/lib/common/connection.d.ts +45 -21
  5. package/lib/common/connection.js +1 -1
  6. package/lib/common/messages.js +0 -3
  7. package/lib/common/protocol.$.d.ts +8 -0
  8. package/lib/common/protocol.$.js +19 -0
  9. package/lib/common/protocol.callHierarchy.d.ts +1 -1
  10. package/lib/common/protocol.callHierarchy.js +1 -1
  11. package/lib/common/protocol.colorProvider.d.ts +1 -1
  12. package/lib/common/protocol.configuration.d.ts +5 -17
  13. package/lib/common/protocol.configuration.js +1 -0
  14. package/lib/common/protocol.d.ts +488 -70
  15. package/lib/common/protocol.declaration.d.ts +3 -3
  16. package/lib/common/protocol.declaration.js +2 -2
  17. package/lib/common/protocol.diagnostic.d.ts +364 -0
  18. package/lib/common/protocol.diagnostic.js +77 -0
  19. package/lib/common/protocol.fileOperations.d.ts +1 -1
  20. package/lib/common/protocol.foldingRange.d.ts +43 -27
  21. package/lib/common/protocol.foldingRange.js +1 -19
  22. package/lib/common/protocol.implementation.d.ts +3 -3
  23. package/lib/common/protocol.implementation.js +2 -2
  24. package/lib/common/protocol.inlayHint.d.ts +115 -0
  25. package/lib/common/protocol.inlayHint.js +44 -0
  26. package/lib/common/protocol.inlineValue.d.ts +91 -0
  27. package/lib/common/protocol.inlineValue.js +31 -0
  28. package/lib/common/protocol.js +137 -18
  29. package/lib/common/protocol.linkedEditingRange.d.ts +2 -2
  30. package/lib/common/protocol.moniker.d.ts +13 -11
  31. package/lib/common/protocol.moniker.js +8 -8
  32. package/lib/common/protocol.notebook.d.ts +402 -0
  33. package/lib/common/protocol.notebook.js +210 -0
  34. package/lib/common/protocol.progress.d.ts +2 -14
  35. package/lib/common/protocol.progress.js +4 -2
  36. package/lib/common/protocol.selectionRange.d.ts +2 -2
  37. package/lib/common/protocol.semanticTokens.d.ts +27 -2
  38. package/lib/common/protocol.typeDefinition.d.ts +2 -2
  39. package/lib/common/protocol.typeHierarchy.d.ts +89 -0
  40. package/lib/common/protocol.typeHierarchy.js +43 -0
  41. package/lib/common/{protocol.workspaceFolders.d.ts → protocol.workspaceFolder.d.ts} +11 -41
  42. package/lib/common/{protocol.workspaceFolders.js → protocol.workspaceFolder.js} +1 -1
  43. package/lib/node/main.js +1 -1
  44. package/metaModel.schema.json +705 -0
  45. package/package.json +4 -4
  46. package/lib/common/proposed.diagnostic.d.ts +0 -46
  47. package/lib/common/proposed.diagnostic.js +0 -23
@@ -1,7 +1,7 @@
1
1
  import { RequestHandler } from 'vscode-jsonrpc';
2
2
  import { Declaration, DeclarationLink, Location, LocationLink } from 'vscode-languageserver-types';
3
3
  import { ProtocolRequestType } from './messages';
4
- import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
4
+ import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
5
5
  /**
6
6
  * @since 3.14.0
7
7
  */
@@ -25,13 +25,13 @@ export interface DeclarationParams extends TextDocumentPositionParams, WorkDoneP
25
25
  }
26
26
  /**
27
27
  * A request to resolve the type definition locations of a symbol at a given text
28
- * document position. The request's parameter is of type [TextDocumentPositioParams]
28
+ * document position. The request's parameter is of type [TextDocumentPositionParams]
29
29
  * (#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)
30
30
  * or a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves
31
31
  * to such.
32
32
  */
33
33
  export declare namespace DeclarationRequest {
34
34
  const method: 'textDocument/declaration';
35
- const type: ProtocolRequestType<DeclarationParams, Location | Location[] | LocationLink[] | null, Location[] | LocationLink[], void, DeclarationRegistrationOptions>;
35
+ const type: ProtocolRequestType<DeclarationParams, Declaration | LocationLink[] | null, Location[] | LocationLink[], void, DeclarationRegistrationOptions>;
36
36
  type HandlerSignature = RequestHandler<DeclarationParams, Declaration | DeclarationLink[] | null, void>;
37
37
  }
@@ -6,11 +6,11 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.DeclarationRequest = void 0;
8
8
  const messages_1 = require("./messages");
9
- // @ts-ignore: to avoid inlining LocatioLink as dynamic import
9
+ // @ts-ignore: to avoid inlining LocationLink as dynamic import
10
10
  let __noDynamicImport;
11
11
  /**
12
12
  * A request to resolve the type definition locations of a symbol at a given text
13
- * document position. The request's parameter is of type [TextDocumentPositioParams]
13
+ * document position. The request's parameter is of type [TextDocumentPositionParams]
14
14
  * (#TextDocumentPositionParams) the response is of type [Declaration](#Declaration)
15
15
  * or a typed array of [DeclarationLink](#DeclarationLink) or a Thenable that resolves
16
16
  * to such.
@@ -0,0 +1,364 @@
1
+ import { RequestHandler0, RequestHandler, ProgressType } from 'vscode-jsonrpc';
2
+ import { TextDocumentIdentifier, Diagnostic, DocumentUri, integer } from 'vscode-languageserver-types';
3
+ import { ProtocolRequestType0, ProtocolRequestType } from './messages';
4
+ import type { PartialResultParams, StaticRegistrationOptions, WorkDoneProgressParams, TextDocumentRegistrationOptions, WorkDoneProgressOptions } from './protocol';
5
+ /**
6
+ * Client capabilities specific to diagnostic pull requests.
7
+ *
8
+ * @since 3.17.0
9
+ * @proposed
10
+ */
11
+ export declare type DiagnosticClientCapabilities = {
12
+ /**
13
+ * Whether implementation supports dynamic registration. If this is set to `true`
14
+ * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
15
+ * return value for the corresponding server capability as well.
16
+ */
17
+ dynamicRegistration?: boolean;
18
+ /**
19
+ * Whether the clients supports related documents for document diagnostic pulls.
20
+ */
21
+ relatedDocumentSupport?: boolean;
22
+ };
23
+ /**
24
+ * Workspace client capabilities specific to diagnostic pull requests.
25
+ *
26
+ * @since 3.17.0
27
+ * @proposed
28
+ */
29
+ export declare type DiagnosticWorkspaceClientCapabilities = {
30
+ /**
31
+ * Whether the client implementation supports a refresh request sent from
32
+ * the server to the client.
33
+ *
34
+ * Note that this event is global and will force the client to refresh all
35
+ * pulled diagnostics currently shown. It should be used with absolute care and
36
+ * is useful for situation where a server for example detects a project wide
37
+ * change that requires such a calculation.
38
+ */
39
+ refreshSupport?: boolean;
40
+ };
41
+ /**
42
+ * Diagnostic options.
43
+ *
44
+ * @since 3.17.0
45
+ * @proposed
46
+ */
47
+ export declare type DiagnosticOptions = WorkDoneProgressOptions & {
48
+ /**
49
+ * An optional identifier under which the diagnostics are
50
+ * managed by the client.
51
+ */
52
+ identifier?: string;
53
+ /**
54
+ * Whether the language has inter file dependencies meaning that
55
+ * editing code in one file can result in a different diagnostic
56
+ * set in another file. Inter file dependencies are common for
57
+ * most programming languages and typically uncommon for linters.
58
+ */
59
+ interFileDependencies: boolean;
60
+ /**
61
+ * The server provides support for workspace diagnostics as well.
62
+ */
63
+ workspaceDiagnostics: boolean;
64
+ };
65
+ /**
66
+ * Diagnostic registration options.
67
+ *
68
+ * @since 3.17.0
69
+ * @proposed
70
+ */
71
+ export declare type DiagnosticRegistrationOptions = TextDocumentRegistrationOptions & DiagnosticOptions & StaticRegistrationOptions;
72
+ export declare type $DiagnosticServerCapabilities = {
73
+ diagnosticProvider?: DiagnosticOptions;
74
+ };
75
+ /**
76
+ * Cancellation data returned from a diagnostic request.
77
+ *
78
+ * @since 3.17.0
79
+ * @proposed
80
+ */
81
+ export declare type DiagnosticServerCancellationData = {
82
+ retriggerRequest: boolean;
83
+ };
84
+ /**
85
+ * @since 3.17.0
86
+ * @proposed
87
+ */
88
+ export declare namespace DiagnosticServerCancellationData {
89
+ function is(value: any): value is DiagnosticServerCancellationData;
90
+ }
91
+ /**
92
+ * Parameters of the document diagnostic request.
93
+ *
94
+ * @since 3.17.0
95
+ * @proposed
96
+ */
97
+ export declare type DocumentDiagnosticParams = WorkDoneProgressParams & PartialResultParams & {
98
+ /**
99
+ * The text document.
100
+ */
101
+ textDocument: TextDocumentIdentifier;
102
+ /**
103
+ * The additional identifier provided during registration.
104
+ */
105
+ identifier?: string;
106
+ /**
107
+ * The result id of a previous response if provided.
108
+ */
109
+ previousResultId?: string;
110
+ };
111
+ /**
112
+ * The document diagnostic report kinds.
113
+ *
114
+ * @since 3.17.0
115
+ * @proposed
116
+ */
117
+ export declare namespace DocumentDiagnosticReportKind {
118
+ /**
119
+ * A diagnostic report with a full
120
+ * set of problems.
121
+ */
122
+ const Full = "full";
123
+ /**
124
+ * A report indicating that the last
125
+ * returned report is still accurate.
126
+ */
127
+ const Unchanged = "unchanged";
128
+ }
129
+ export declare type DocumentDiagnosticReportKind = 'full' | 'unchanged';
130
+ /**
131
+ * A diagnostic report with a full set of problems.
132
+ *
133
+ * @since 3.17.0
134
+ * @proposed
135
+ */
136
+ export declare type FullDocumentDiagnosticReport = {
137
+ /**
138
+ * A full document diagnostic report.
139
+ */
140
+ kind: typeof DocumentDiagnosticReportKind.Full;
141
+ /**
142
+ * An optional result id. If provided it will
143
+ * be sent on the next diagnostic request for the
144
+ * same document.
145
+ */
146
+ resultId?: string;
147
+ /**
148
+ * The actual items.
149
+ */
150
+ items: Diagnostic[];
151
+ };
152
+ /**
153
+ * A full diagnostic report with a set of related documents.
154
+ *
155
+ * @since 3.17.0
156
+ * @proposed
157
+ */
158
+ export declare type RelatedFullDocumentDiagnosticReport = FullDocumentDiagnosticReport & {
159
+ /**
160
+ * Diagnostics of related documents. This information is useful
161
+ * in programming languages where code in a file A can generate
162
+ * diagnostics in a file B which A depends on. An example of
163
+ * such a language is C/C++ where marco definitions in a file
164
+ * a.cpp and result in errors in a header file b.hpp.
165
+ *
166
+ * @since 3.17.0
167
+ * @proposed
168
+ */
169
+ relatedDocuments?: {
170
+ [uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
171
+ };
172
+ };
173
+ /**
174
+ * A diagnostic report indicating that the last returned
175
+ * report is still accurate.
176
+ *
177
+ * @since 3.17.0
178
+ * @proposed
179
+ */
180
+ export declare type UnchangedDocumentDiagnosticReport = {
181
+ /**
182
+ * A document diagnostic report indicating
183
+ * no changes to the last result. A server can
184
+ * only return `unchanged` if result ids are
185
+ * provided.
186
+ */
187
+ kind: typeof DocumentDiagnosticReportKind.Unchanged;
188
+ /**
189
+ * A result id which will be sent on the next
190
+ * diagnostic request for the same document.
191
+ */
192
+ resultId: string;
193
+ };
194
+ /**
195
+ * An unchanged diagnostic report with a set of related documents.
196
+ *
197
+ * @since 3.17.0
198
+ * @proposed
199
+ */
200
+ export declare type RelatedUnchangedDocumentDiagnosticReport = UnchangedDocumentDiagnosticReport & {
201
+ /**
202
+ * Diagnostics of related documents. This information is useful
203
+ * in programming languages where code in a file A can generate
204
+ * diagnostics in a file B which A depends on. An example of
205
+ * such a language is C/C++ where marco definitions in a file
206
+ * a.cpp and result in errors in a header file b.hpp.
207
+ *
208
+ * @since 3.17.0
209
+ * @proposed
210
+ */
211
+ relatedDocuments?: {
212
+ [uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
213
+ };
214
+ };
215
+ /**
216
+ * The result of a document diagnostic pull request. A report can
217
+ * either be a full report containing all diagnostics for the
218
+ * requested document or a unchanged report indicating that nothing
219
+ * has changed in terms of diagnostics in comparison to the last
220
+ * pull request.
221
+ *
222
+ * @since 3.17.0
223
+ * @proposed
224
+ */
225
+ export declare type DocumentDiagnosticReport = RelatedFullDocumentDiagnosticReport | RelatedUnchangedDocumentDiagnosticReport;
226
+ /**
227
+ * A partial result for a document diagnostic report.
228
+ *
229
+ * @since 3.17.0
230
+ * @proposed
231
+ */
232
+ export declare type DocumentDiagnosticReportPartialResult = {
233
+ relatedDocuments: {
234
+ [uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
235
+ };
236
+ };
237
+ /**
238
+ * The document diagnostic request definition.
239
+ *
240
+ * @since 3.17.0
241
+ * @proposed
242
+ */
243
+ export declare namespace DocumentDiagnosticRequest {
244
+ const method: 'textDocument/diagnostic';
245
+ const type: ProtocolRequestType<DocumentDiagnosticParams, DocumentDiagnosticReport, DocumentDiagnosticReportPartialResult, DiagnosticServerCancellationData, DiagnosticRegistrationOptions>;
246
+ const partialResult: ProgressType<DocumentDiagnosticReportPartialResult>;
247
+ type HandlerSignature = RequestHandler<DocumentDiagnosticParams, DocumentDiagnosticReport, void>;
248
+ }
249
+ /**
250
+ * A previous result id in a workspace pull request.
251
+ *
252
+ * @since 3.17.0
253
+ * @proposed
254
+ */
255
+ export declare type PreviousResultId = {
256
+ /**
257
+ * The URI for which the client knowns a
258
+ * result id.
259
+ */
260
+ uri: DocumentUri;
261
+ /**
262
+ * The value of the previous result id.
263
+ */
264
+ value: string;
265
+ };
266
+ /**
267
+ * Parameters of the workspace diagnostic request.
268
+ *
269
+ * @since 3.17.0
270
+ * @proposed
271
+ */
272
+ export declare type WorkspaceDiagnosticParams = WorkDoneProgressParams & PartialResultParams & {
273
+ /**
274
+ * The additional identifier provided during registration.
275
+ */
276
+ identifier?: string;
277
+ /**
278
+ * The currently known diagnostic reports with their
279
+ * previous result ids.
280
+ */
281
+ previousResultIds: PreviousResultId[];
282
+ };
283
+ /**
284
+ * A full document diagnostic report for a workspace diagnostic result.
285
+ *
286
+ * @since 3.17.0
287
+ * @proposed
288
+ */
289
+ export declare type WorkspaceFullDocumentDiagnosticReport = FullDocumentDiagnosticReport & {
290
+ /**
291
+ * The URI for which diagnostic information is reported.
292
+ */
293
+ uri: DocumentUri;
294
+ /**
295
+ * The version number for which the diagnostics are reported.
296
+ * If the document is not marked as open `null` can be provided.
297
+ */
298
+ version: integer | null;
299
+ };
300
+ /**
301
+ * An unchanged document diagnostic report for a workspace diagnostic result.
302
+ *
303
+ * @since 3.17.0
304
+ * @proposed
305
+ */
306
+ export declare type WorkspaceUnchangedDocumentDiagnosticReport = UnchangedDocumentDiagnosticReport & {
307
+ /**
308
+ * The URI for which diagnostic information is reported.
309
+ */
310
+ uri: DocumentUri;
311
+ /**
312
+ * The version number for which the diagnostics are reported.
313
+ * If the document is not marked as open `null` can be provided.
314
+ */
315
+ version: integer | null;
316
+ };
317
+ /**
318
+ * A workspace diagnostic document report.
319
+ *
320
+ * @since 3.17.0
321
+ * @proposed
322
+ */
323
+ export declare type WorkspaceDocumentDiagnosticReport = WorkspaceFullDocumentDiagnosticReport | WorkspaceUnchangedDocumentDiagnosticReport;
324
+ /**
325
+ * A workspace diagnostic report.
326
+ *
327
+ * @since 3.17.0
328
+ * @proposed
329
+ */
330
+ export declare type WorkspaceDiagnosticReport = {
331
+ items: WorkspaceDocumentDiagnosticReport[];
332
+ };
333
+ /**
334
+ * A partial result for a workspace diagnostic report.
335
+ *
336
+ * @since 3.17.0
337
+ * @proposed
338
+ */
339
+ export declare type WorkspaceDiagnosticReportPartialResult = {
340
+ items: WorkspaceDocumentDiagnosticReport[];
341
+ };
342
+ /**
343
+ * The workspace diagnostic request definition.
344
+ *
345
+ * @since 3.17.0
346
+ * @proposed
347
+ */
348
+ export declare namespace WorkspaceDiagnosticRequest {
349
+ const method: 'workspace/diagnostic';
350
+ const type: ProtocolRequestType<WorkspaceDiagnosticParams, WorkspaceDiagnosticReport, WorkspaceDiagnosticReportPartialResult, DiagnosticServerCancellationData, void>;
351
+ const partialResult: ProgressType<WorkspaceDiagnosticReportPartialResult>;
352
+ type HandlerSignature = RequestHandler<WorkspaceDiagnosticParams, WorkspaceDiagnosticReport | null, void>;
353
+ }
354
+ /**
355
+ * The diagnostic refresh request definition.
356
+ *
357
+ * @since 3.17.0
358
+ * @proposed
359
+ */
360
+ export declare namespace DiagnosticRefreshRequest {
361
+ const method: `workspace/diagnostic/refresh`;
362
+ const type: ProtocolRequestType0<void, void, void, void>;
363
+ type HandlerSignature = RequestHandler0<void, void>;
364
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /* --------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ * ------------------------------------------------------------------------------------------ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = void 0;
8
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
9
+ const Is = require("./utils/is");
10
+ const messages_1 = require("./messages");
11
+ /**
12
+ * @since 3.17.0
13
+ * @proposed
14
+ */
15
+ var DiagnosticServerCancellationData;
16
+ (function (DiagnosticServerCancellationData) {
17
+ function is(value) {
18
+ const candidate = value;
19
+ return candidate && Is.boolean(candidate.retriggerRequest);
20
+ }
21
+ DiagnosticServerCancellationData.is = is;
22
+ })(DiagnosticServerCancellationData = exports.DiagnosticServerCancellationData || (exports.DiagnosticServerCancellationData = {}));
23
+ /**
24
+ * The document diagnostic report kinds.
25
+ *
26
+ * @since 3.17.0
27
+ * @proposed
28
+ */
29
+ var DocumentDiagnosticReportKind;
30
+ (function (DocumentDiagnosticReportKind) {
31
+ /**
32
+ * A diagnostic report with a full
33
+ * set of problems.
34
+ */
35
+ DocumentDiagnosticReportKind.Full = 'full';
36
+ /**
37
+ * A report indicating that the last
38
+ * returned report is still accurate.
39
+ */
40
+ DocumentDiagnosticReportKind.Unchanged = 'unchanged';
41
+ })(DocumentDiagnosticReportKind = exports.DocumentDiagnosticReportKind || (exports.DocumentDiagnosticReportKind = {}));
42
+ /**
43
+ * The document diagnostic request definition.
44
+ *
45
+ * @since 3.17.0
46
+ * @proposed
47
+ */
48
+ var DocumentDiagnosticRequest;
49
+ (function (DocumentDiagnosticRequest) {
50
+ DocumentDiagnosticRequest.method = 'textDocument/diagnostic';
51
+ DocumentDiagnosticRequest.type = new messages_1.ProtocolRequestType(DocumentDiagnosticRequest.method);
52
+ DocumentDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();
53
+ })(DocumentDiagnosticRequest = exports.DocumentDiagnosticRequest || (exports.DocumentDiagnosticRequest = {}));
54
+ /**
55
+ * The workspace diagnostic request definition.
56
+ *
57
+ * @since 3.17.0
58
+ * @proposed
59
+ */
60
+ var WorkspaceDiagnosticRequest;
61
+ (function (WorkspaceDiagnosticRequest) {
62
+ WorkspaceDiagnosticRequest.method = 'workspace/diagnostic';
63
+ WorkspaceDiagnosticRequest.type = new messages_1.ProtocolRequestType(WorkspaceDiagnosticRequest.method);
64
+ WorkspaceDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();
65
+ })(WorkspaceDiagnosticRequest = exports.WorkspaceDiagnosticRequest || (exports.WorkspaceDiagnosticRequest = {}));
66
+ /**
67
+ * The diagnostic refresh request definition.
68
+ *
69
+ * @since 3.17.0
70
+ * @proposed
71
+ */
72
+ var DiagnosticRefreshRequest;
73
+ (function (DiagnosticRefreshRequest) {
74
+ DiagnosticRefreshRequest.method = `workspace/diagnostic/refresh`;
75
+ DiagnosticRefreshRequest.type = new messages_1.ProtocolRequestType0(DiagnosticRefreshRequest.method);
76
+ })(DiagnosticRefreshRequest = exports.DiagnosticRefreshRequest || (exports.DiagnosticRefreshRequest = {}));
77
+ //# sourceMappingURL=protocol.diagnostic.js.map
@@ -83,7 +83,7 @@ interface FileOperationPattern {
83
83
  * - `*` to match one or more characters in a path segment
84
84
  * - `?` to match on one character in a path segment
85
85
  * - `**` to match any number of path segments, including none
86
- * - `{}` to group conditions (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
86
+ * - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
87
87
  * - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
88
88
  * - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
89
89
  */
@@ -1,45 +1,61 @@
1
1
  import { RequestHandler } from 'vscode-jsonrpc';
2
- import { TextDocumentIdentifier, uinteger, FoldingRange } from 'vscode-languageserver-types';
2
+ import { TextDocumentIdentifier, uinteger, FoldingRange, FoldingRangeKind } from 'vscode-languageserver-types';
3
3
  import { ProtocolRequestType } from './messages';
4
- import { TextDocumentRegistrationOptions, StaticRegistrationOptions, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
4
+ import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
5
5
  export interface FoldingRangeClientCapabilities {
6
6
  /**
7
- * Whether implementation supports dynamic registration for folding range providers. If this is set to `true`
8
- * the client supports the new `FoldingRangeRegistrationOptions` return value for the corresponding server
9
- * capability as well.
7
+ * Whether implementation supports dynamic registration for folding range
8
+ * providers. If this is set to `true` the client supports the new
9
+ * `FoldingRangeRegistrationOptions` return value for the corresponding
10
+ * server capability as well.
10
11
  */
11
12
  dynamicRegistration?: boolean;
12
13
  /**
13
- * The maximum number of folding ranges that the client prefers to receive per document. The value serves as a
14
- * hint, servers are free to follow the limit.
14
+ * The maximum number of folding ranges that the client prefers to receive
15
+ * per document. The value serves as a hint, servers are free to follow the
16
+ * limit.
15
17
  */
16
18
  rangeLimit?: uinteger;
17
19
  /**
18
- * If set, the client signals that it only supports folding complete lines. If set, client will
19
- * ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.
20
+ * If set, the client signals that it only supports folding complete lines.
21
+ * If set, client will ignore specified `startCharacter` and `endCharacter`
22
+ * properties in a FoldingRange.
20
23
  */
21
24
  lineFoldingOnly?: boolean;
22
- }
23
- export interface FoldingRangeOptions extends WorkDoneProgressOptions {
24
- }
25
- export interface FoldingRangeRegistrationOptions extends TextDocumentRegistrationOptions, FoldingRangeOptions, StaticRegistrationOptions {
26
- }
27
- /**
28
- * Enum of known range kinds
29
- */
30
- export declare enum FoldingRangeKind {
31
25
  /**
32
- * Folding range for a comment
26
+ * Specific options for the folding range kind.
27
+ *
28
+ * @since 3.17.0
29
+ * @proposed
33
30
  */
34
- Comment = "comment",
31
+ foldingRangeKind?: {
32
+ /**
33
+ * The folding range kind values the client supports. When this
34
+ * property exists the client also guarantees that it will
35
+ * handle values outside its set gracefully and falls back
36
+ * to a default value when unknown.
37
+ */
38
+ valueSet?: FoldingRangeKind[];
39
+ };
35
40
  /**
36
- * Folding range for a imports or includes
41
+ * Specific options for the folding range.
42
+ * @since 3.17.0
43
+ * @proposed
37
44
  */
38
- Imports = "imports",
39
- /**
40
- * Folding range for a region (e.g. `#region`)
41
- */
42
- Region = "region"
45
+ foldingRange?: {
46
+ /**
47
+ * If set, the client signals that it supports setting collapsedText on
48
+ * folding ranges to display custom labels instead of the default text.
49
+ *
50
+ * @since 3.17.0
51
+ * @proposed
52
+ */
53
+ collapsedText?: boolean;
54
+ };
55
+ }
56
+ export interface FoldingRangeOptions extends WorkDoneProgressOptions {
57
+ }
58
+ export interface FoldingRangeRegistrationOptions extends TextDocumentRegistrationOptions, FoldingRangeOptions, StaticRegistrationOptions {
43
59
  }
44
60
  /**
45
61
  * Parameters for a [FoldingRangeRequest](#FoldingRangeRequest).
@@ -58,6 +74,6 @@ export interface FoldingRangeParams extends WorkDoneProgressParams, PartialResul
58
74
  */
59
75
  export declare namespace FoldingRangeRequest {
60
76
  const method: 'textDocument/foldingRange';
61
- const type: ProtocolRequestType<FoldingRangeParams, FoldingRange[] | null, FoldingRange[], any, FoldingRangeRegistrationOptions>;
77
+ const type: ProtocolRequestType<FoldingRangeParams, FoldingRange[] | null, FoldingRange[], void, FoldingRangeRegistrationOptions>;
62
78
  type HandlerSignature = RequestHandler<FoldingRangeParams, FoldingRange[] | null, void>;
63
79
  }
@@ -4,26 +4,8 @@
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.FoldingRangeRequest = exports.FoldingRangeKind = void 0;
7
+ exports.FoldingRangeRequest = void 0;
8
8
  const messages_1 = require("./messages");
9
- /**
10
- * Enum of known range kinds
11
- */
12
- var FoldingRangeKind;
13
- (function (FoldingRangeKind) {
14
- /**
15
- * Folding range for a comment
16
- */
17
- FoldingRangeKind["Comment"] = "comment";
18
- /**
19
- * Folding range for a imports or includes
20
- */
21
- FoldingRangeKind["Imports"] = "imports";
22
- /**
23
- * Folding range for a region (e.g. `#region`)
24
- */
25
- FoldingRangeKind["Region"] = "region";
26
- })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
27
9
  /**
28
10
  * A request to provide folding ranges in a document. The request's
29
11
  * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the
@@ -1,7 +1,7 @@
1
1
  import { RequestHandler } from 'vscode-jsonrpc';
2
2
  import { Definition, DefinitionLink, Location, LocationLink } from 'vscode-languageserver-types';
3
3
  import { ProtocolRequestType } from './messages';
4
- import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
4
+ import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
5
5
  /**
6
6
  * @since 3.6.0
7
7
  */
@@ -27,12 +27,12 @@ export interface ImplementationParams extends TextDocumentPositionParams, WorkDo
27
27
  }
28
28
  /**
29
29
  * A request to resolve the implementation locations of a symbol at a given text
30
- * document position. The request's parameter is of type [TextDocumentPositioParams]
30
+ * document position. The request's parameter is of type [TextDocumentPositionParams]
31
31
  * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a
32
32
  * Thenable that resolves to such.
33
33
  */
34
34
  export declare namespace ImplementationRequest {
35
35
  const method: 'textDocument/implementation';
36
- const type: ProtocolRequestType<ImplementationParams, Location | Location[] | LocationLink[] | null, Location[] | LocationLink[], void, ImplementationRegistrationOptions>;
36
+ const type: ProtocolRequestType<ImplementationParams, Definition | LocationLink[] | null, Location[] | LocationLink[], void, ImplementationRegistrationOptions>;
37
37
  type HandlerSignature = RequestHandler<ImplementationParams, Definition | DefinitionLink[] | null, void>;
38
38
  }
@@ -6,11 +6,11 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.ImplementationRequest = void 0;
8
8
  const messages_1 = require("./messages");
9
- // @ts-ignore: to avoid inlining LocatioLink as dynamic import
9
+ // @ts-ignore: to avoid inlining LocationLink as dynamic import
10
10
  let __noDynamicImport;
11
11
  /**
12
12
  * A request to resolve the implementation locations of a symbol at a given text
13
- * document position. The request's parameter is of type [TextDocumentPositioParams]
13
+ * document position. The request's parameter is of type [TextDocumentPositionParams]
14
14
  * (#TextDocumentPositionParams) the response is of type [Definition](#Definition) or a
15
15
  * Thenable that resolves to such.
16
16
  */