@depup/vscode-languageserver-protocol 3.18.3-depup.0

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 (67) hide show
  1. package/License.txt +11 -0
  2. package/README.md +25 -0
  3. package/changes.json +5 -0
  4. package/eslint.config.js +13 -0
  5. package/lib/browser/main.d.ts +4 -0
  6. package/lib/browser/main.js +27 -0
  7. package/lib/common/api.d.ts +58 -0
  8. package/lib/common/api.js +77 -0
  9. package/lib/common/connection.d.ts +187 -0
  10. package/lib/common/connection.js +14 -0
  11. package/lib/common/messages.d.ts +58 -0
  12. package/lib/common/messages.js +81 -0
  13. package/lib/common/protocol.$.d.ts +1 -0
  14. package/lib/common/protocol.$.js +43 -0
  15. package/lib/common/protocol.callHierarchy.d.ts +89 -0
  16. package/lib/common/protocol.callHierarchy.js +45 -0
  17. package/lib/common/protocol.colorProvider.d.ts +68 -0
  18. package/lib/common/protocol.colorProvider.js +34 -0
  19. package/lib/common/protocol.configuration.d.ts +36 -0
  20. package/lib/common/protocol.configuration.js +25 -0
  21. package/lib/common/protocol.d.ts +3626 -0
  22. package/lib/common/protocol.declaration.d.ts +38 -0
  23. package/lib/common/protocol.declaration.js +23 -0
  24. package/lib/common/protocol.diagnostic.d.ts +369 -0
  25. package/lib/common/protocol.diagnostic.js +111 -0
  26. package/lib/common/protocol.fileOperations.d.ts +312 -0
  27. package/lib/common/protocol.fileOperations.js +107 -0
  28. package/lib/common/protocol.foldingRange.d.ts +118 -0
  29. package/lib/common/protocol.foldingRange.js +33 -0
  30. package/lib/common/protocol.implementation.d.ts +39 -0
  31. package/lib/common/protocol.implementation.js +22 -0
  32. package/lib/common/protocol.inlayHint.d.ts +117 -0
  33. package/lib/common/protocol.inlayHint.js +46 -0
  34. package/lib/common/protocol.inlineCompletion.d.ts +53 -0
  35. package/lib/common/protocol.inlineCompletion.js +22 -0
  36. package/lib/common/protocol.inlineValue.d.ts +88 -0
  37. package/lib/common/protocol.inlineValue.js +32 -0
  38. package/lib/common/protocol.js +1031 -0
  39. package/lib/common/protocol.linkedEditingRange.d.ts +53 -0
  40. package/lib/common/protocol.linkedEditingRange.js +20 -0
  41. package/lib/common/protocol.moniker.d.ts +107 -0
  42. package/lib/common/protocol.moniker.js +69 -0
  43. package/lib/common/protocol.notebook.d.ts +428 -0
  44. package/lib/common/protocol.notebook.js +247 -0
  45. package/lib/common/protocol.progress.d.ts +108 -0
  46. package/lib/common/protocol.progress.js +38 -0
  47. package/lib/common/protocol.selectionRange.d.ts +42 -0
  48. package/lib/common/protocol.selectionRange.js +21 -0
  49. package/lib/common/protocol.semanticTokens.d.ts +241 -0
  50. package/lib/common/protocol.semanticTokens.js +61 -0
  51. package/lib/common/protocol.showDocument.d.ts +73 -0
  52. package/lib/common/protocol.showDocument.js +23 -0
  53. package/lib/common/protocol.textDocumentContent.d.ts +93 -0
  54. package/lib/common/protocol.textDocumentContent.js +33 -0
  55. package/lib/common/protocol.typeDefinition.d.ts +39 -0
  56. package/lib/common/protocol.typeDefinition.js +22 -0
  57. package/lib/common/protocol.typeHierarchy.d.ts +84 -0
  58. package/lib/common/protocol.typeHierarchy.js +43 -0
  59. package/lib/common/protocol.workspaceFolder.d.ts +76 -0
  60. package/lib/common/protocol.workspaceFolder.js +29 -0
  61. package/lib/common/utils/is.d.ts +9 -0
  62. package/lib/common/utils/is.js +45 -0
  63. package/lib/node/main.d.ts +5 -0
  64. package/lib/node/main.js +27 -0
  65. package/metaModel.schema.json +864 -0
  66. package/package.json +68 -0
  67. package/thirdpartynotices.txt +31 -0
@@ -0,0 +1,247 @@
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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || (function () {
23
+ var ownKeys = function(o) {
24
+ ownKeys = Object.getOwnPropertyNames || function (o) {
25
+ var ar = [];
26
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
+ return ar;
28
+ };
29
+ return ownKeys(o);
30
+ };
31
+ return function (mod) {
32
+ if (mod && mod.__esModule) return mod;
33
+ var result = {};
34
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
+ __setModuleDefault(result, mod);
36
+ return result;
37
+ };
38
+ })();
39
+ Object.defineProperty(exports, "__esModule", { value: true });
40
+ exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = void 0;
41
+ const vscode_languageserver_types_1 = require("vscode-languageserver-types");
42
+ const Is = __importStar(require("./utils/is"));
43
+ const messages_1 = require("./messages");
44
+ /**
45
+ * A notebook cell kind.
46
+ *
47
+ * @since 3.17.0
48
+ */
49
+ var NotebookCellKind;
50
+ (function (NotebookCellKind) {
51
+ /**
52
+ * A markup-cell is formatted source that is used for display.
53
+ */
54
+ NotebookCellKind.Markup = 1;
55
+ /**
56
+ * A code-cell is source code.
57
+ */
58
+ NotebookCellKind.Code = 2;
59
+ function is(value) {
60
+ return value === 1 || value === 2;
61
+ }
62
+ NotebookCellKind.is = is;
63
+ })(NotebookCellKind || (exports.NotebookCellKind = NotebookCellKind = {}));
64
+ var ExecutionSummary;
65
+ (function (ExecutionSummary) {
66
+ function create(executionOrder, success) {
67
+ const result = { executionOrder };
68
+ if (success === true || success === false) {
69
+ result.success = success;
70
+ }
71
+ return result;
72
+ }
73
+ ExecutionSummary.create = create;
74
+ function is(value) {
75
+ const candidate = value;
76
+ return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.executionOrder) && (candidate.success === undefined || Is.boolean(candidate.success));
77
+ }
78
+ ExecutionSummary.is = is;
79
+ function equals(one, other) {
80
+ if (one === other) {
81
+ return true;
82
+ }
83
+ if (one === null || one === undefined || other === null || other === undefined) {
84
+ return false;
85
+ }
86
+ return one.executionOrder === other.executionOrder && one.success === other.success;
87
+ }
88
+ ExecutionSummary.equals = equals;
89
+ })(ExecutionSummary || (exports.ExecutionSummary = ExecutionSummary = {}));
90
+ var NotebookCell;
91
+ (function (NotebookCell) {
92
+ function create(kind, document) {
93
+ return { kind, document };
94
+ }
95
+ NotebookCell.create = create;
96
+ function is(value) {
97
+ const candidate = value;
98
+ return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) &&
99
+ (candidate.metadata === undefined || Is.objectLiteral(candidate.metadata));
100
+ }
101
+ NotebookCell.is = is;
102
+ function diff(one, two) {
103
+ const result = new Set();
104
+ if (one.document !== two.document) {
105
+ result.add('document');
106
+ }
107
+ if (one.kind !== two.kind) {
108
+ result.add('kind');
109
+ }
110
+ if (one.executionSummary !== two.executionSummary) {
111
+ result.add('executionSummary');
112
+ }
113
+ if ((one.metadata !== undefined || two.metadata !== undefined) && !equalsMetadata(one.metadata, two.metadata)) {
114
+ result.add('metadata');
115
+ }
116
+ if ((one.executionSummary !== undefined || two.executionSummary !== undefined) && !ExecutionSummary.equals(one.executionSummary, two.executionSummary)) {
117
+ result.add('executionSummary');
118
+ }
119
+ return result;
120
+ }
121
+ NotebookCell.diff = diff;
122
+ function equalsMetadata(one, other) {
123
+ if (one === other) {
124
+ return true;
125
+ }
126
+ if (one === null || one === undefined || other === null || other === undefined) {
127
+ return false;
128
+ }
129
+ if (typeof one !== typeof other) {
130
+ return false;
131
+ }
132
+ if (typeof one !== 'object') {
133
+ return false;
134
+ }
135
+ const oneArray = Array.isArray(one);
136
+ const otherArray = Array.isArray(other);
137
+ if (oneArray !== otherArray) {
138
+ return false;
139
+ }
140
+ if (oneArray && otherArray) {
141
+ if (one.length !== other.length) {
142
+ return false;
143
+ }
144
+ for (let i = 0; i < one.length; i++) {
145
+ if (!equalsMetadata(one[i], other[i])) {
146
+ return false;
147
+ }
148
+ }
149
+ }
150
+ if (Is.objectLiteral(one) && Is.objectLiteral(other)) {
151
+ const oneKeys = Object.keys(one);
152
+ const otherKeys = Object.keys(other);
153
+ if (oneKeys.length !== otherKeys.length) {
154
+ return false;
155
+ }
156
+ oneKeys.sort();
157
+ otherKeys.sort();
158
+ if (!equalsMetadata(oneKeys, otherKeys)) {
159
+ return false;
160
+ }
161
+ for (let i = 0; i < oneKeys.length; i++) {
162
+ const prop = oneKeys[i];
163
+ if (!equalsMetadata(one[prop], other[prop])) {
164
+ return false;
165
+ }
166
+ }
167
+ }
168
+ return true;
169
+ }
170
+ })(NotebookCell || (exports.NotebookCell = NotebookCell = {}));
171
+ var NotebookDocument;
172
+ (function (NotebookDocument) {
173
+ function create(uri, notebookType, version, cells) {
174
+ return { uri, notebookType, version, cells };
175
+ }
176
+ NotebookDocument.create = create;
177
+ function is(value) {
178
+ const candidate = value;
179
+ return Is.objectLiteral(candidate) && Is.string(candidate.uri) && vscode_languageserver_types_1.integer.is(candidate.version) && Is.typedArray(candidate.cells, NotebookCell.is);
180
+ }
181
+ NotebookDocument.is = is;
182
+ })(NotebookDocument || (exports.NotebookDocument = NotebookDocument = {}));
183
+ var NotebookDocumentSyncRegistrationType;
184
+ (function (NotebookDocumentSyncRegistrationType) {
185
+ NotebookDocumentSyncRegistrationType.method = 'notebookDocument/sync';
186
+ NotebookDocumentSyncRegistrationType.messageDirection = messages_1.MessageDirection.clientToServer;
187
+ NotebookDocumentSyncRegistrationType.type = new messages_1.RegistrationType(NotebookDocumentSyncRegistrationType.method);
188
+ })(NotebookDocumentSyncRegistrationType || (exports.NotebookDocumentSyncRegistrationType = NotebookDocumentSyncRegistrationType = {}));
189
+ /**
190
+ * A notification sent when a notebook opens.
191
+ *
192
+ * @since 3.17.0
193
+ */
194
+ var DidOpenNotebookDocumentNotification;
195
+ (function (DidOpenNotebookDocumentNotification) {
196
+ DidOpenNotebookDocumentNotification.method = 'notebookDocument/didOpen';
197
+ DidOpenNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
198
+ DidOpenNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenNotebookDocumentNotification.method);
199
+ DidOpenNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
200
+ })(DidOpenNotebookDocumentNotification || (exports.DidOpenNotebookDocumentNotification = DidOpenNotebookDocumentNotification = {}));
201
+ var NotebookCellArrayChange;
202
+ (function (NotebookCellArrayChange) {
203
+ function is(value) {
204
+ const candidate = value;
205
+ 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));
206
+ }
207
+ NotebookCellArrayChange.is = is;
208
+ function create(start, deleteCount, cells) {
209
+ const result = { start, deleteCount };
210
+ if (cells !== undefined) {
211
+ result.cells = cells;
212
+ }
213
+ return result;
214
+ }
215
+ NotebookCellArrayChange.create = create;
216
+ })(NotebookCellArrayChange || (exports.NotebookCellArrayChange = NotebookCellArrayChange = {}));
217
+ var DidChangeNotebookDocumentNotification;
218
+ (function (DidChangeNotebookDocumentNotification) {
219
+ DidChangeNotebookDocumentNotification.method = 'notebookDocument/didChange';
220
+ DidChangeNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
221
+ DidChangeNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeNotebookDocumentNotification.method);
222
+ DidChangeNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
223
+ })(DidChangeNotebookDocumentNotification || (exports.DidChangeNotebookDocumentNotification = DidChangeNotebookDocumentNotification = {}));
224
+ /**
225
+ * A notification sent when a notebook document is saved.
226
+ *
227
+ * @since 3.17.0
228
+ */
229
+ var DidSaveNotebookDocumentNotification;
230
+ (function (DidSaveNotebookDocumentNotification) {
231
+ DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave';
232
+ DidSaveNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
233
+ DidSaveNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method);
234
+ DidSaveNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
235
+ })(DidSaveNotebookDocumentNotification || (exports.DidSaveNotebookDocumentNotification = DidSaveNotebookDocumentNotification = {}));
236
+ /**
237
+ * A notification sent when a notebook closes.
238
+ *
239
+ * @since 3.17.0
240
+ */
241
+ var DidCloseNotebookDocumentNotification;
242
+ (function (DidCloseNotebookDocumentNotification) {
243
+ DidCloseNotebookDocumentNotification.method = 'notebookDocument/didClose';
244
+ DidCloseNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
245
+ DidCloseNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseNotebookDocumentNotification.method);
246
+ DidCloseNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
247
+ })(DidCloseNotebookDocumentNotification || (exports.DidCloseNotebookDocumentNotification = DidCloseNotebookDocumentNotification = {}));
@@ -0,0 +1,108 @@
1
+ import { NotificationHandler, RequestHandler, ProgressType, ProgressToken } from 'vscode-jsonrpc';
2
+ import { uinteger } from 'vscode-languageserver-types';
3
+ import { MessageDirection, ProtocolRequestType, ProtocolNotificationType, CM } from './messages';
4
+ export interface WorkDoneProgressBegin {
5
+ kind: 'begin';
6
+ /**
7
+ * Mandatory title of the progress operation. Used to briefly inform about
8
+ * the kind of operation being performed.
9
+ *
10
+ * Examples: "Indexing" or "Linking dependencies".
11
+ */
12
+ title: string;
13
+ /**
14
+ * Controls if a cancel button should show to allow the user to cancel the
15
+ * long running operation. Clients that don't support cancellation are allowed
16
+ * to ignore the setting.
17
+ */
18
+ cancellable?: boolean;
19
+ /**
20
+ * Optional, more detailed associated progress message. Contains
21
+ * complementary information to the `title`.
22
+ *
23
+ * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
24
+ * If unset, the previous progress message (if any) is still valid.
25
+ */
26
+ message?: string;
27
+ /**
28
+ * Optional progress percentage to display (value 100 is considered 100%).
29
+ * If not provided infinite progress is assumed and clients are allowed
30
+ * to ignore the `percentage` value in subsequent in report notifications.
31
+ *
32
+ * The value should be steadily rising. Clients are free to ignore values
33
+ * that are not following this rule. The value range is [0, 100].
34
+ */
35
+ percentage?: uinteger;
36
+ }
37
+ export interface WorkDoneProgressReport {
38
+ kind: 'report';
39
+ /**
40
+ * Controls enablement state of a cancel button.
41
+ *
42
+ * Clients that don't support cancellation or don't support controlling the button's
43
+ * enablement state are allowed to ignore the property.
44
+ */
45
+ cancellable?: boolean;
46
+ /**
47
+ * Optional, more detailed associated progress message. Contains
48
+ * complementary information to the `title`.
49
+ *
50
+ * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
51
+ * If unset, the previous progress message (if any) is still valid.
52
+ */
53
+ message?: string;
54
+ /**
55
+ * Optional progress percentage to display (value 100 is considered 100%).
56
+ * If not provided infinite progress is assumed and clients are allowed
57
+ * to ignore the `percentage` value in subsequent in report notifications.
58
+ *
59
+ * The value should be steadily rising. Clients are free to ignore values
60
+ * that are not following this rule. The value range is [0, 100]
61
+ */
62
+ percentage?: uinteger;
63
+ }
64
+ export interface WorkDoneProgressEnd {
65
+ kind: 'end';
66
+ /**
67
+ * Optional, a final message indicating to for example indicate the outcome
68
+ * of the operation.
69
+ */
70
+ message?: string;
71
+ }
72
+ export declare namespace WorkDoneProgress {
73
+ const type: ProgressType<WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd>;
74
+ function is(value: ProgressType<any>): value is typeof type;
75
+ }
76
+ export interface WorkDoneProgressCreateParams {
77
+ /**
78
+ * The token to be used to report progress.
79
+ */
80
+ token: ProgressToken;
81
+ }
82
+ /**
83
+ * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
84
+ * reporting from the server.
85
+ */
86
+ export declare namespace WorkDoneProgressCreateRequest {
87
+ const method: 'window/workDoneProgress/create';
88
+ const messageDirection: MessageDirection;
89
+ const type: ProtocolRequestType<WorkDoneProgressCreateParams, void, never, void, void>;
90
+ type HandlerSignature = RequestHandler<WorkDoneProgressCreateParams, void, void>;
91
+ const capabilities: CM<"window.workDoneProgress", undefined>;
92
+ }
93
+ export interface WorkDoneProgressCancelParams {
94
+ /**
95
+ * The token to be used to report progress.
96
+ */
97
+ token: ProgressToken;
98
+ }
99
+ /**
100
+ * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
101
+ * initiated on the server side.
102
+ */
103
+ export declare namespace WorkDoneProgressCancelNotification {
104
+ const method: 'window/workDoneProgress/cancel';
105
+ const messageDirection: MessageDirection;
106
+ const type: ProtocolNotificationType<WorkDoneProgressCancelParams, void>;
107
+ type HandlerSignature = NotificationHandler<WorkDoneProgressCancelParams>;
108
+ }
@@ -0,0 +1,38 @@
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.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = void 0;
8
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
9
+ const messages_1 = require("./messages");
10
+ var WorkDoneProgress;
11
+ (function (WorkDoneProgress) {
12
+ WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();
13
+ function is(value) {
14
+ return value === WorkDoneProgress.type;
15
+ }
16
+ WorkDoneProgress.is = is;
17
+ })(WorkDoneProgress || (exports.WorkDoneProgress = WorkDoneProgress = {}));
18
+ /**
19
+ * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
20
+ * reporting from the server.
21
+ */
22
+ var WorkDoneProgressCreateRequest;
23
+ (function (WorkDoneProgressCreateRequest) {
24
+ WorkDoneProgressCreateRequest.method = 'window/workDoneProgress/create';
25
+ WorkDoneProgressCreateRequest.messageDirection = messages_1.MessageDirection.serverToClient;
26
+ WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType(WorkDoneProgressCreateRequest.method);
27
+ WorkDoneProgressCreateRequest.capabilities = messages_1.CM.create('window.workDoneProgress', undefined);
28
+ })(WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = WorkDoneProgressCreateRequest = {}));
29
+ /**
30
+ * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
31
+ * initiated on the server side.
32
+ */
33
+ var WorkDoneProgressCancelNotification;
34
+ (function (WorkDoneProgressCancelNotification) {
35
+ WorkDoneProgressCancelNotification.method = 'window/workDoneProgress/cancel';
36
+ WorkDoneProgressCancelNotification.messageDirection = messages_1.MessageDirection.clientToServer;
37
+ WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType(WorkDoneProgressCancelNotification.method);
38
+ })(WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = WorkDoneProgressCancelNotification = {}));
@@ -0,0 +1,42 @@
1
+ import { RequestHandler } from 'vscode-jsonrpc';
2
+ import { TextDocumentIdentifier, Position, SelectionRange } from 'vscode-languageserver-types';
3
+ import { MessageDirection, ProtocolRequestType, CM } from './messages';
4
+ import { type TextDocumentRegistrationOptions, type WorkDoneProgressOptions, type StaticRegistrationOptions, type WorkDoneProgressParams, type PartialResultParams } from './protocol';
5
+ export interface SelectionRangeClientCapabilities {
6
+ /**
7
+ * Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
8
+ * the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server
9
+ * capability as well.
10
+ */
11
+ dynamicRegistration?: boolean;
12
+ }
13
+ export interface SelectionRangeOptions extends WorkDoneProgressOptions {
14
+ }
15
+ export interface SelectionRangeRegistrationOptions extends SelectionRangeOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions {
16
+ }
17
+ /**
18
+ * A parameter literal used in selection range requests.
19
+ */
20
+ export interface SelectionRangeParams extends WorkDoneProgressParams, PartialResultParams {
21
+ /**
22
+ * The text document.
23
+ */
24
+ textDocument: TextDocumentIdentifier;
25
+ /**
26
+ * The positions inside the text document.
27
+ */
28
+ positions: Position[];
29
+ }
30
+ /**
31
+ * A request to provide selection ranges in a document. The request's
32
+ * parameter is of type {@link SelectionRangeParams}, the
33
+ * response is of type {@link SelectionRange SelectionRange[]} or a Thenable
34
+ * that resolves to such.
35
+ */
36
+ export declare namespace SelectionRangeRequest {
37
+ const method: 'textDocument/selectionRange';
38
+ const messageDirection: MessageDirection;
39
+ const type: ProtocolRequestType<SelectionRangeParams, SelectionRange[] | null, SelectionRange[], void, SelectionRangeRegistrationOptions>;
40
+ type HandlerSignature = RequestHandler<SelectionRangeParams, SelectionRange[] | null, void>;
41
+ const capabilities: CM<"textDocument.selectionRange", "selectionRangeProvider">;
42
+ }
@@ -0,0 +1,21 @@
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.SelectionRangeRequest = void 0;
8
+ const messages_1 = require("./messages");
9
+ /**
10
+ * A request to provide selection ranges in a document. The request's
11
+ * parameter is of type {@link SelectionRangeParams}, the
12
+ * response is of type {@link SelectionRange SelectionRange[]} or a Thenable
13
+ * that resolves to such.
14
+ */
15
+ var SelectionRangeRequest;
16
+ (function (SelectionRangeRequest) {
17
+ SelectionRangeRequest.method = 'textDocument/selectionRange';
18
+ SelectionRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;
19
+ SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);
20
+ SelectionRangeRequest.capabilities = messages_1.CM.create('textDocument.selectionRange', 'selectionRangeProvider');
21
+ })(SelectionRangeRequest || (exports.SelectionRangeRequest = SelectionRangeRequest = {}));