@depup/vscode-languageserver-types 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.
@@ -0,0 +1,3515 @@
1
+ /**
2
+ * A tagging type for string properties that are actually document URIs.
3
+ */
4
+ export type DocumentUri = string;
5
+ export declare namespace DocumentUri {
6
+ function is(value: any): value is DocumentUri;
7
+ }
8
+ /**
9
+ * A tagging type for string properties that are actually URIs
10
+ *
11
+ * @since 3.16.0
12
+ */
13
+ export type URI = string;
14
+ export declare namespace URI {
15
+ function is(value: any): value is URI;
16
+ }
17
+ /**
18
+ * Defines an integer in the range of -2^31 to 2^31 - 1.
19
+ */
20
+ export type integer = number;
21
+ export declare namespace integer {
22
+ const MIN_VALUE = -2147483648;
23
+ const MAX_VALUE = 2147483647;
24
+ function is(value: any): value is integer;
25
+ }
26
+ /**
27
+ * Defines an unsigned integer in the range of 0 to 2^31 - 1.
28
+ */
29
+ export type uinteger = number;
30
+ export declare namespace uinteger {
31
+ const MIN_VALUE = 0;
32
+ const MAX_VALUE = 2147483647;
33
+ function is(value: any): value is uinteger;
34
+ }
35
+ /**
36
+ * Defines a decimal number. Since decimal numbers are very
37
+ * rare in the language server specification we denote the
38
+ * exact range with every decimal using the mathematics
39
+ * interval notations (e.g. [0, 1] denotes all decimals d with
40
+ * 0 <= d <= 1.
41
+ */
42
+ export type decimal = number;
43
+ /**
44
+ * The LSP any type.
45
+ *
46
+ * In the current implementation we map LSPAny to any. This is due to the fact
47
+ * that the TypeScript compilers can't infer string access signatures for
48
+ * interface correctly (it can though for types). See the following issue for
49
+ * details: https://github.com/microsoft/TypeScript/issues/15300.
50
+ *
51
+ * When the issue is addressed LSPAny can be defined as follows:
52
+ *
53
+ * ```ts
54
+ * export type LSPAny = LSPObject | LSPArray | string | integer | uinteger | decimal | boolean | null | undefined;
55
+ * export type LSPObject = { [key: string]: LSPAny };
56
+ * export type LSPArray = LSPAny[];
57
+ * ```
58
+ *
59
+ * Please note that strictly speaking a property with the value `undefined`
60
+ * can't be converted into JSON preserving the property name. However for
61
+ * convenience it is allowed and assumed that all these properties are
62
+ * optional as well.
63
+ *
64
+ * @since 3.17.0
65
+ */
66
+ export type LSPAny = any;
67
+ export type LSPObject = object;
68
+ export type LSPArray = any[];
69
+ /**
70
+ * Position in a text document expressed as zero-based line and character
71
+ * offset. Prior to 3.17 the offsets were always based on a UTF-16 string
72
+ * representation. So a string of the form `a𐐀b` the character offset of the
73
+ * character `a` is 0, the character offset of `𐐀` is 1 and the character
74
+ * offset of b is 3 since `𐐀` is represented using two code units in UTF-16.
75
+ * Since 3.17 clients and servers can agree on a different string encoding
76
+ * representation (e.g. UTF-8). The client announces it's supported encoding
77
+ * via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities).
78
+ * The value is an array of position encodings the client supports, with
79
+ * decreasing preference (e.g. the encoding at index `0` is the most preferred
80
+ * one). To stay backwards compatible the only mandatory encoding is UTF-16
81
+ * represented via the string `utf-16`. The server can pick one of the
82
+ * encodings offered by the client and signals that encoding back to the
83
+ * client via the initialize result's property
84
+ * [`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value
85
+ * `utf-16` is missing from the client's capability `general.positionEncodings`
86
+ * servers can safely assume that the client supports UTF-16. If the server
87
+ * omits the position encoding in its initialize result the encoding defaults
88
+ * to the string value `utf-16`. Implementation considerations: since the
89
+ * conversion from one encoding into another requires the content of the
90
+ * file / line the conversion is best done where the file is read which is
91
+ * usually on the server side.
92
+ *
93
+ * Positions are line end character agnostic. So you can not specify a position
94
+ * that denotes `\r|\n` or `\n|` where `|` represents the character offset.
95
+ *
96
+ * @since 3.17.0 - support for negotiated position encoding.
97
+ */
98
+ export interface Position {
99
+ /**
100
+ * Line position in a document (zero-based).
101
+ */
102
+ line: uinteger;
103
+ /**
104
+ * Character offset on a line in a document (zero-based).
105
+ *
106
+ * The meaning of this offset is determined by the negotiated
107
+ * `PositionEncodingKind`.
108
+ */
109
+ character: uinteger;
110
+ }
111
+ /**
112
+ * The Position namespace provides helper functions to work with
113
+ * {@link Position} literals.
114
+ */
115
+ export declare namespace Position {
116
+ /**
117
+ * Creates a new Position literal from the given line and character.
118
+ * @param line The position's line.
119
+ * @param character The position's character.
120
+ */
121
+ function create(line: uinteger, character: uinteger): Position;
122
+ /**
123
+ * Checks whether the given literal conforms to the {@link Position} interface.
124
+ */
125
+ function is(value: any): value is Position;
126
+ }
127
+ /**
128
+ * A range in a text document expressed as (zero-based) start and end positions.
129
+ *
130
+ * If you want to specify a range that contains a line including the line ending
131
+ * character(s) then use an end position denoting the start of the next line.
132
+ * For example:
133
+ * ```ts
134
+ * {
135
+ * start: { line: 5, character: 23 }
136
+ * end : { line 6, character : 0 }
137
+ * }
138
+ * ```
139
+ */
140
+ export interface Range {
141
+ /**
142
+ * The range's start position.
143
+ */
144
+ start: Position;
145
+ /**
146
+ * The range's end position.
147
+ */
148
+ end: Position;
149
+ }
150
+ /**
151
+ * The Range namespace provides helper functions to work with
152
+ * {@link Range} literals.
153
+ */
154
+ export declare namespace Range {
155
+ /**
156
+ * Create a new Range literal.
157
+ * @param start The range's start position.
158
+ * @param end The range's end position.
159
+ */
160
+ function create(start: Position, end: Position): Range;
161
+ /**
162
+ * Create a new Range literal.
163
+ * @param startLine The start line number.
164
+ * @param startCharacter The start character.
165
+ * @param endLine The end line number.
166
+ * @param endCharacter The end character.
167
+ */
168
+ function create(startLine: uinteger, startCharacter: uinteger, endLine: uinteger, endCharacter: uinteger): Range;
169
+ /**
170
+ * Checks whether the given literal conforms to the {@link Range} interface.
171
+ */
172
+ function is(value: any): value is Range;
173
+ }
174
+ /**
175
+ * Represents a location inside a resource, such as a line
176
+ * inside a text file.
177
+ */
178
+ export interface Location {
179
+ uri: DocumentUri;
180
+ range: Range;
181
+ }
182
+ /**
183
+ * The Location namespace provides helper functions to work with
184
+ * {@link Location} literals.
185
+ */
186
+ export declare namespace Location {
187
+ /**
188
+ * Creates a Location literal.
189
+ * @param uri The location's uri.
190
+ * @param range The location's range.
191
+ */
192
+ function create(uri: DocumentUri, range: Range): Location;
193
+ /**
194
+ * Checks whether the given literal conforms to the {@link Location} interface.
195
+ */
196
+ function is(value: any): value is Location;
197
+ }
198
+ /**
199
+ * Represents the connection of two locations. Provides additional metadata over normal {@link Location locations},
200
+ * including an origin range.
201
+ */
202
+ export interface LocationLink {
203
+ /**
204
+ * Span of the origin of this link.
205
+ *
206
+ * Used as the underlined span for mouse interaction. Defaults to the word range at
207
+ * the definition position.
208
+ */
209
+ originSelectionRange?: Range;
210
+ /**
211
+ * The target resource identifier of this link.
212
+ */
213
+ targetUri: DocumentUri;
214
+ /**
215
+ * The full target range of this link. If the target for example is a symbol then target range is the
216
+ * range enclosing this symbol not including leading/trailing whitespace but everything else
217
+ * like comments. This information is typically used to highlight the range in the editor.
218
+ */
219
+ targetRange: Range;
220
+ /**
221
+ * The range that should be selected and revealed when this link is being followed, e.g the name of a function.
222
+ * Must be contained by the `targetRange`. See also `DocumentSymbol#range`
223
+ */
224
+ targetSelectionRange: Range;
225
+ }
226
+ /**
227
+ * The LocationLink namespace provides helper functions to work with
228
+ * {@link LocationLink} literals.
229
+ */
230
+ export declare namespace LocationLink {
231
+ /**
232
+ * Creates a LocationLink literal.
233
+ * @param targetUri The definition's uri.
234
+ * @param targetRange The full range of the definition.
235
+ * @param targetSelectionRange The span of the symbol definition at the target.
236
+ * @param originSelectionRange The span of the symbol being defined in the originating source file.
237
+ */
238
+ function create(targetUri: DocumentUri, targetRange: Range, targetSelectionRange: Range, originSelectionRange?: Range): LocationLink;
239
+ /**
240
+ * Checks whether the given literal conforms to the {@link LocationLink} interface.
241
+ */
242
+ function is(value: any): value is LocationLink;
243
+ }
244
+ /**
245
+ * Represents a color in RGBA space.
246
+ */
247
+ export interface Color {
248
+ /**
249
+ * The red component of this color in the range [0-1].
250
+ */
251
+ readonly red: decimal;
252
+ /**
253
+ * The green component of this color in the range [0-1].
254
+ */
255
+ readonly green: decimal;
256
+ /**
257
+ * The blue component of this color in the range [0-1].
258
+ */
259
+ readonly blue: decimal;
260
+ /**
261
+ * The alpha component of this color in the range [0-1].
262
+ */
263
+ readonly alpha: decimal;
264
+ }
265
+ /**
266
+ * The Color namespace provides helper functions to work with
267
+ * {@link Color} literals.
268
+ */
269
+ export declare namespace Color {
270
+ /**
271
+ * Creates a new Color literal.
272
+ */
273
+ function create(red: decimal, green: decimal, blue: decimal, alpha: decimal): Color;
274
+ /**
275
+ * Checks whether the given literal conforms to the {@link Color} interface.
276
+ */
277
+ function is(value: any): value is Color;
278
+ }
279
+ /**
280
+ * Represents a color range from a document.
281
+ */
282
+ export interface ColorInformation {
283
+ /**
284
+ * The range in the document where this color appears.
285
+ */
286
+ range: Range;
287
+ /**
288
+ * The actual color value for this color range.
289
+ */
290
+ color: Color;
291
+ }
292
+ /**
293
+ * The ColorInformation namespace provides helper functions to work with
294
+ * {@link ColorInformation} literals.
295
+ */
296
+ export declare namespace ColorInformation {
297
+ /**
298
+ * Creates a new ColorInformation literal.
299
+ */
300
+ function create(range: Range, color: Color): ColorInformation;
301
+ /**
302
+ * Checks whether the given literal conforms to the {@link ColorInformation} interface.
303
+ */
304
+ function is(value: any): value is ColorInformation;
305
+ }
306
+ export interface ColorPresentation {
307
+ /**
308
+ * The label of this color presentation. It will be shown on the color
309
+ * picker header. By default this is also the text that is inserted when selecting
310
+ * this color presentation.
311
+ */
312
+ label: string;
313
+ /**
314
+ * An {@link TextEdit edit} which is applied to a document when selecting
315
+ * this presentation for the color. When `falsy` the {@link ColorPresentation.label label}
316
+ * is used.
317
+ */
318
+ textEdit?: TextEdit;
319
+ /**
320
+ * An optional array of additional {@link TextEdit text edits} that are applied when
321
+ * selecting this color presentation. Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor with themselves.
322
+ */
323
+ additionalTextEdits?: TextEdit[];
324
+ }
325
+ /**
326
+ * The Color namespace provides helper functions to work with
327
+ * {@link ColorPresentation} literals.
328
+ */
329
+ export declare namespace ColorPresentation {
330
+ /**
331
+ * Creates a new ColorInformation literal.
332
+ */
333
+ function create(label: string, textEdit?: TextEdit, additionalTextEdits?: TextEdit[]): ColorPresentation;
334
+ /**
335
+ * Checks whether the given literal conforms to the {@link ColorInformation} interface.
336
+ */
337
+ function is(value: any): value is ColorPresentation;
338
+ }
339
+ /**
340
+ * A set of predefined range kinds.
341
+ */
342
+ export declare namespace FoldingRangeKind {
343
+ /**
344
+ * Folding range for a comment
345
+ */
346
+ const Comment = "comment";
347
+ /**
348
+ * Folding range for an import or include
349
+ */
350
+ const Imports = "imports";
351
+ /**
352
+ * Folding range for a region (e.g. `#region`)
353
+ */
354
+ const Region = "region";
355
+ }
356
+ /**
357
+ * A predefined folding range kind.
358
+ *
359
+ * The type is a string since the value set is extensible
360
+ */
361
+ export type FoldingRangeKind = string;
362
+ /**
363
+ * Represents a folding range. To be valid, start and end line must be bigger than zero and smaller
364
+ * than the number of lines in the document. Clients are free to ignore invalid ranges.
365
+ */
366
+ export interface FoldingRange {
367
+ /**
368
+ * The zero-based start line of the range to fold. The folded area starts after the line's last character.
369
+ * To be valid, the end must be zero or larger and smaller than the number of lines in the document.
370
+ */
371
+ startLine: uinteger;
372
+ /**
373
+ * The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
374
+ */
375
+ startCharacter?: uinteger;
376
+ /**
377
+ * The zero-based end line of the range to fold. The folded area ends with the line's last character.
378
+ * To be valid, the end must be zero or larger and smaller than the number of lines in the document.
379
+ */
380
+ endLine: uinteger;
381
+ /**
382
+ * The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
383
+ */
384
+ endCharacter?: uinteger;
385
+ /**
386
+ * Describes the kind of the folding range such as 'comment' or 'region'. The kind
387
+ * is used to categorize folding ranges and used by commands like 'Fold all comments'.
388
+ * See {@link FoldingRangeKind} for an enumeration of standardized kinds.
389
+ */
390
+ kind?: FoldingRangeKind;
391
+ /**
392
+ * The text that the client should show when the specified range is
393
+ * collapsed. If not defined or not supported by the client, a default
394
+ * will be chosen by the client.
395
+ *
396
+ * @since 3.17.0
397
+ */
398
+ collapsedText?: string;
399
+ }
400
+ /**
401
+ * The folding range namespace provides helper functions to work with
402
+ * {@link FoldingRange} literals.
403
+ */
404
+ export declare namespace FoldingRange {
405
+ /**
406
+ * Creates a new FoldingRange literal.
407
+ */
408
+ function create(startLine: uinteger, endLine: uinteger, startCharacter?: uinteger, endCharacter?: uinteger, kind?: FoldingRangeKind, collapsedText?: string): FoldingRange;
409
+ /**
410
+ * Checks whether the given literal conforms to the {@link FoldingRange} interface.
411
+ */
412
+ function is(value: any): value is FoldingRange;
413
+ }
414
+ /**
415
+ * Represents a related message and source code location for a diagnostic. This should be
416
+ * used to point to code locations that cause or related to a diagnostics, e.g when duplicating
417
+ * a symbol in a scope.
418
+ */
419
+ export interface DiagnosticRelatedInformation {
420
+ /**
421
+ * The location of this related diagnostic information.
422
+ */
423
+ location: Location;
424
+ /**
425
+ * The message of this related diagnostic information.
426
+ */
427
+ message: string;
428
+ }
429
+ /**
430
+ * The DiagnosticRelatedInformation namespace provides helper functions to work with
431
+ * {@link DiagnosticRelatedInformation} literals.
432
+ */
433
+ export declare namespace DiagnosticRelatedInformation {
434
+ /**
435
+ * Creates a new DiagnosticRelatedInformation literal.
436
+ */
437
+ function create(location: Location, message: string): DiagnosticRelatedInformation;
438
+ /**
439
+ * Checks whether the given literal conforms to the {@link DiagnosticRelatedInformation} interface.
440
+ */
441
+ function is(value: any): value is DiagnosticRelatedInformation;
442
+ }
443
+ /**
444
+ * The diagnostic's severity.
445
+ */
446
+ export declare namespace DiagnosticSeverity {
447
+ /**
448
+ * Reports an error.
449
+ */
450
+ const Error: 1;
451
+ /**
452
+ * Reports a warning.
453
+ */
454
+ const Warning: 2;
455
+ /**
456
+ * Reports an information.
457
+ */
458
+ const Information: 3;
459
+ /**
460
+ * Reports a hint.
461
+ */
462
+ const Hint: 4;
463
+ }
464
+ export type DiagnosticSeverity = 1 | 2 | 3 | 4;
465
+ /**
466
+ * The diagnostic tags.
467
+ *
468
+ * @since 3.15.0
469
+ */
470
+ export declare namespace DiagnosticTag {
471
+ /**
472
+ * Unused or unnecessary code.
473
+ *
474
+ * Clients are allowed to render diagnostics with this tag faded out instead of having
475
+ * an error squiggle.
476
+ */
477
+ const Unnecessary: 1;
478
+ /**
479
+ * Deprecated or obsolete code.
480
+ *
481
+ * Clients are allowed to rendered diagnostics with this tag strike through.
482
+ */
483
+ const Deprecated: 2;
484
+ }
485
+ export type DiagnosticTag = 1 | 2;
486
+ /**
487
+ * Structure to capture a description for an error code.
488
+ *
489
+ * @since 3.16.0
490
+ */
491
+ export interface CodeDescription {
492
+ /**
493
+ * An URI to open with more information about the diagnostic error.
494
+ */
495
+ href: URI;
496
+ }
497
+ /**
498
+ * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.
499
+ *
500
+ * @since 3.16.0
501
+ */
502
+ export declare namespace CodeDescription {
503
+ function is(value: any): value is CodeDescription;
504
+ }
505
+ /**
506
+ * Represents a diagnostic, such as a compiler error or warning. Diagnostic objects
507
+ * are only valid in the scope of a resource.
508
+ */
509
+ export interface Diagnostic {
510
+ /**
511
+ * The range at which the message applies
512
+ */
513
+ range: Range;
514
+ /**
515
+ * The diagnostic's severity. To avoid interpretation mismatches when a
516
+ * server is used with different clients it is highly recommended that servers
517
+ * always provide a severity value.
518
+ */
519
+ severity?: DiagnosticSeverity;
520
+ /**
521
+ * The diagnostic's code, which usually appear in the user interface.
522
+ */
523
+ code?: integer | string;
524
+ /**
525
+ * An optional property to describe the error code.
526
+ * Requires the code field (above) to be present/not null.
527
+ *
528
+ * @since 3.16.0
529
+ */
530
+ codeDescription?: CodeDescription;
531
+ /**
532
+ * A human-readable string describing the source of this
533
+ * diagnostic, e.g. 'typescript' or 'super lint'. It usually
534
+ * appears in the user interface.
535
+ */
536
+ source?: string;
537
+ /**
538
+ * The diagnostic's message. It usually appears in the user interface.
539
+ *
540
+ * @since 3.18.0 - support for MarkupContent. This is guarded by the client
541
+ * capability `textDocument.diagnostic.markupMessageSupport`.
542
+ */
543
+ message: string | MarkupContent;
544
+ /**
545
+ * Additional metadata about the diagnostic.
546
+ *
547
+ * @since 3.15.0
548
+ */
549
+ tags?: DiagnosticTag[];
550
+ /**
551
+ * An array of related diagnostic information, e.g. when symbol-names within
552
+ * a scope collide all definitions can be marked via this property.
553
+ */
554
+ relatedInformation?: DiagnosticRelatedInformation[];
555
+ /**
556
+ * A data entry field that is preserved between a `textDocument/publishDiagnostics`
557
+ * notification and `textDocument/codeAction` request.
558
+ *
559
+ * @since 3.16.0
560
+ */
561
+ data?: LSPAny;
562
+ }
563
+ /**
564
+ * The Diagnostic namespace provides helper functions to work with
565
+ * {@link Diagnostic} literals.
566
+ */
567
+ export declare namespace Diagnostic {
568
+ /**
569
+ * Creates a new Diagnostic literal.
570
+ */
571
+ function create(range: Range, message: string | MarkupContent, severity?: DiagnosticSeverity, code?: integer | string, source?: string, relatedInformation?: DiagnosticRelatedInformation[]): Diagnostic;
572
+ /**
573
+ * Checks whether the given literal conforms to the {@link Diagnostic} interface.
574
+ */
575
+ function is(value: any): value is Diagnostic;
576
+ /**
577
+ * Checks whether the given diagnostic's message conforms to the 3.17.0
578
+ * version of the protocol where the message is a string.
579
+ *
580
+ * @param value the diagnostic
581
+ * @returns true if the diagnostic's message is a string, false otherwise.
582
+ */
583
+ function is3_17(value: Diagnostic): value is Omit<Diagnostic, 'message'> & {
584
+ message: string;
585
+ };
586
+ /**
587
+ * Gets the message string of a diagnostic. If the message is already a
588
+ * string, it is returned as is. If the message is a MarkupContent,
589
+ * the value of the MarkupContent is returned. Otherwise an error is thrown.
590
+ *
591
+ * @param diagnostic the diagnostic to get the message string from.
592
+ * @returns the message string of the given diagnostic.
593
+ */
594
+ function getMessageString(diagnostic: Diagnostic): string;
595
+ }
596
+ /**
597
+ * Represents a reference to a command. Provides a title which
598
+ * will be used to represent a command in the UI and, optionally,
599
+ * an array of arguments which will be passed to the command handler
600
+ * function when invoked.
601
+ */
602
+ export interface Command {
603
+ /**
604
+ * Title of the command, like `save`.
605
+ */
606
+ title: string;
607
+ /**
608
+ * An optional tooltip.
609
+ *
610
+ * @since 3.18.0
611
+ */
612
+ tooltip?: string;
613
+ /**
614
+ * The identifier of the actual command handler.
615
+ */
616
+ command: string;
617
+ /**
618
+ * Arguments that the command handler should be
619
+ * invoked with.
620
+ */
621
+ arguments?: LSPAny[];
622
+ }
623
+ /**
624
+ * The Command namespace provides helper functions to work with
625
+ * {@link Command} literals.
626
+ */
627
+ export declare namespace Command {
628
+ /**
629
+ * Creates a new Command literal.
630
+ */
631
+ function create(title: string, command: string, ...args: any[]): Command;
632
+ /**
633
+ * Checks whether the given literal conforms to the {@link Command} interface.
634
+ */
635
+ function is(value: any): value is Command;
636
+ }
637
+ /**
638
+ * A text edit applicable to a text document.
639
+ */
640
+ export interface TextEdit {
641
+ /**
642
+ * The range of the text document to be manipulated. To insert
643
+ * text into a document create a range where start === end.
644
+ */
645
+ range: Range;
646
+ /**
647
+ * The string to be inserted. For delete operations use an
648
+ * empty string.
649
+ */
650
+ newText: string;
651
+ }
652
+ /**
653
+ * The TextEdit namespace provides helper function to create replace,
654
+ * insert and delete edits more easily.
655
+ */
656
+ export declare namespace TextEdit {
657
+ /**
658
+ * Creates a replace text edit.
659
+ * @param range The range of text to be replaced.
660
+ * @param newText The new text.
661
+ */
662
+ function replace(range: Range, newText: string): TextEdit;
663
+ /**
664
+ * Creates an insert text edit.
665
+ * @param position The position to insert the text at.
666
+ * @param newText The text to be inserted.
667
+ */
668
+ function insert(position: Position, newText: string): TextEdit;
669
+ /**
670
+ * Creates a delete text edit.
671
+ * @param range The range of text to be deleted.
672
+ */
673
+ function del(range: Range): TextEdit;
674
+ function is(value: any): value is TextEdit;
675
+ }
676
+ /**
677
+ * Additional information that describes document changes.
678
+ *
679
+ * @since 3.16.0
680
+ */
681
+ export interface ChangeAnnotation {
682
+ /**
683
+ * A human-readable string describing the actual change. The string
684
+ * is rendered prominent in the user interface.
685
+ */
686
+ label: string;
687
+ /**
688
+ * A flag which indicates that user confirmation is needed
689
+ * before applying the change.
690
+ */
691
+ needsConfirmation?: boolean;
692
+ /**
693
+ * A human-readable string which is rendered less prominent in
694
+ * the user interface.
695
+ */
696
+ description?: string;
697
+ }
698
+ export declare namespace ChangeAnnotation {
699
+ function create(label: string, needsConfirmation?: boolean, description?: string): ChangeAnnotation;
700
+ function is(value: any): value is ChangeAnnotation;
701
+ }
702
+ export declare namespace ChangeAnnotationIdentifier {
703
+ function is(value: any): value is ChangeAnnotationIdentifier;
704
+ }
705
+ /**
706
+ * An identifier to refer to a change annotation stored with a workspace edit.
707
+ */
708
+ export type ChangeAnnotationIdentifier = string;
709
+ /**
710
+ * A special text edit with an additional change annotation.
711
+ *
712
+ * @since 3.16.0.
713
+ */
714
+ export interface AnnotatedTextEdit extends TextEdit {
715
+ /**
716
+ * The actual identifier of the change annotation
717
+ */
718
+ annotationId: ChangeAnnotationIdentifier;
719
+ }
720
+ export declare namespace AnnotatedTextEdit {
721
+ /**
722
+ * Creates an annotated replace text edit.
723
+ *
724
+ * @param range The range of text to be replaced.
725
+ * @param newText The new text.
726
+ * @param annotation The annotation.
727
+ */
728
+ function replace(range: Range, newText: string, annotation: ChangeAnnotationIdentifier): AnnotatedTextEdit;
729
+ /**
730
+ * Creates an annotated insert text edit.
731
+ *
732
+ * @param position The position to insert the text at.
733
+ * @param newText The text to be inserted.
734
+ * @param annotation The annotation.
735
+ */
736
+ function insert(position: Position, newText: string, annotation: ChangeAnnotationIdentifier): AnnotatedTextEdit;
737
+ /**
738
+ * Creates an annotated delete text edit.
739
+ *
740
+ * @param range The range of text to be deleted.
741
+ * @param annotation The annotation.
742
+ */
743
+ function del(range: Range, annotation: ChangeAnnotationIdentifier): AnnotatedTextEdit;
744
+ function is(value: any): value is AnnotatedTextEdit;
745
+ }
746
+ /**
747
+ * Describes textual changes on a text document. A TextDocumentEdit describes all changes
748
+ * on a document version Si and after they are applied move the document to version Si+1.
749
+ * So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any
750
+ * kind of ordering. However the edits must be non overlapping.
751
+ */
752
+ export interface TextDocumentEdit {
753
+ /**
754
+ * The text document to change.
755
+ */
756
+ textDocument: OptionalVersionedTextDocumentIdentifier;
757
+ /**
758
+ * The edits to be applied.
759
+ *
760
+ * @since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a
761
+ * client capability.
762
+ *
763
+ * @since 3.18.0 - support for SnippetTextEdit. This is guarded using a
764
+ * client capability.
765
+ */
766
+ edits: (TextEdit | AnnotatedTextEdit | SnippetTextEdit)[];
767
+ }
768
+ /**
769
+ * The TextDocumentEdit namespace provides helper function to create
770
+ * an edit that manipulates a text document.
771
+ */
772
+ export declare namespace TextDocumentEdit {
773
+ /**
774
+ * Creates a new `TextDocumentEdit`
775
+ */
776
+ function create(textDocument: OptionalVersionedTextDocumentIdentifier, edits: (TextEdit | AnnotatedTextEdit | SnippetTextEdit)[]): TextDocumentEdit;
777
+ function is(value: any): value is TextDocumentEdit;
778
+ }
779
+ /**
780
+ * A generic resource operation.
781
+ */
782
+ interface ResourceOperation {
783
+ /**
784
+ * The resource operation kind.
785
+ */
786
+ kind: string;
787
+ /**
788
+ * An optional annotation identifier describing the operation.
789
+ *
790
+ * @since 3.16.0
791
+ */
792
+ annotationId?: ChangeAnnotationIdentifier;
793
+ }
794
+ /**
795
+ * Options to create a file.
796
+ */
797
+ export interface CreateFileOptions {
798
+ /**
799
+ * Overwrite existing file. Overwrite wins over `ignoreIfExists`
800
+ */
801
+ overwrite?: boolean;
802
+ /**
803
+ * Ignore if exists.
804
+ */
805
+ ignoreIfExists?: boolean;
806
+ }
807
+ /**
808
+ * Create file operation.
809
+ */
810
+ export interface CreateFile extends ResourceOperation {
811
+ /**
812
+ * A create
813
+ */
814
+ kind: 'create';
815
+ /**
816
+ * The resource to create.
817
+ */
818
+ uri: DocumentUri;
819
+ /**
820
+ * Additional options
821
+ */
822
+ options?: CreateFileOptions;
823
+ }
824
+ export declare namespace CreateFile {
825
+ function create(uri: DocumentUri, options?: CreateFileOptions, annotation?: ChangeAnnotationIdentifier): CreateFile;
826
+ function is(value: any): value is CreateFile;
827
+ }
828
+ /**
829
+ * Rename file options
830
+ */
831
+ export interface RenameFileOptions {
832
+ /**
833
+ * Overwrite target if existing. Overwrite wins over `ignoreIfExists`
834
+ */
835
+ overwrite?: boolean;
836
+ /**
837
+ * Ignores if target exists.
838
+ */
839
+ ignoreIfExists?: boolean;
840
+ }
841
+ /**
842
+ * Rename file operation
843
+ */
844
+ export interface RenameFile extends ResourceOperation {
845
+ /**
846
+ * A rename
847
+ */
848
+ kind: 'rename';
849
+ /**
850
+ * The old (existing) location.
851
+ */
852
+ oldUri: DocumentUri;
853
+ /**
854
+ * The new location.
855
+ */
856
+ newUri: DocumentUri;
857
+ /**
858
+ * Rename options.
859
+ */
860
+ options?: RenameFileOptions;
861
+ }
862
+ export declare namespace RenameFile {
863
+ function create(oldUri: DocumentUri, newUri: DocumentUri, options?: RenameFileOptions, annotation?: ChangeAnnotationIdentifier): RenameFile;
864
+ function is(value: any): value is RenameFile;
865
+ }
866
+ /**
867
+ * Delete file options
868
+ */
869
+ export interface DeleteFileOptions {
870
+ /**
871
+ * Delete the content recursively if a folder is denoted.
872
+ */
873
+ recursive?: boolean;
874
+ /**
875
+ * Ignore the operation if the file doesn't exist.
876
+ */
877
+ ignoreIfNotExists?: boolean;
878
+ }
879
+ /**
880
+ * Delete file operation
881
+ */
882
+ export interface DeleteFile extends ResourceOperation {
883
+ /**
884
+ * A delete
885
+ */
886
+ kind: 'delete';
887
+ /**
888
+ * The file to delete.
889
+ */
890
+ uri: DocumentUri;
891
+ /**
892
+ * Delete options.
893
+ */
894
+ options?: DeleteFileOptions;
895
+ }
896
+ export declare namespace DeleteFile {
897
+ function create(uri: DocumentUri, options?: DeleteFileOptions, annotation?: ChangeAnnotationIdentifier): DeleteFile;
898
+ function is(value: any): value is DeleteFile;
899
+ }
900
+ /**
901
+ * A workspace edit represents changes to many resources managed in the workspace. The edit
902
+ * should either provide `changes` or `documentChanges`. If documentChanges are present
903
+ * they are preferred over `changes` if the client can handle versioned document edits.
904
+ *
905
+ * Since version 3.13.0 a workspace edit can contain resource operations as well. If resource
906
+ * operations are present clients need to execute the operations in the order in which they
907
+ * are provided. So a workspace edit for example can consist of the following two changes:
908
+ * (1) a create file a.txt and (2) a text document edit which insert text into file a.txt.
909
+ *
910
+ * An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will
911
+ * cause failure of the operation. How the client recovers from the failure is described by
912
+ * the client capability: `workspace.workspaceEdit.failureHandling`
913
+ */
914
+ export interface WorkspaceEdit {
915
+ /**
916
+ * Holds changes to existing resources.
917
+ */
918
+ changes?: {
919
+ [uri: DocumentUri]: TextEdit[];
920
+ };
921
+ /**
922
+ * Depending on the client capability `workspace.workspaceEdit.resourceOperations` document changes
923
+ * are either an array of `TextDocumentEdit`s to express changes to n different text documents
924
+ * where each text document edit addresses a specific version of a text document. Or it can contain
925
+ * above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.
926
+ *
927
+ * Whether a client supports versioned document edits is expressed via
928
+ * `workspace.workspaceEdit.documentChanges` client capability.
929
+ *
930
+ * If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations` then
931
+ * only plain `TextEdit`s using the `changes` property are supported.
932
+ */
933
+ documentChanges?: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[];
934
+ /**
935
+ * A map of change annotations that can be referenced in `AnnotatedTextEdit`s or create, rename and
936
+ * delete file / folder operations.
937
+ *
938
+ * Whether clients honor this property depends on the client capability `workspace.changeAnnotationSupport`.
939
+ *
940
+ * @since 3.16.0
941
+ */
942
+ changeAnnotations?: {
943
+ [id: ChangeAnnotationIdentifier]: ChangeAnnotation;
944
+ };
945
+ }
946
+ export declare namespace WorkspaceEdit {
947
+ function is(value: any): value is WorkspaceEdit;
948
+ }
949
+ /**
950
+ * Additional data about a workspace edit.
951
+ *
952
+ * @since 3.18.0
953
+ */
954
+ export type WorkspaceEditMetadata = {
955
+ /**
956
+ * Signal to the editor that this edit is a refactoring.
957
+ */
958
+ isRefactoring?: boolean;
959
+ };
960
+ /**
961
+ * A change to capture text edits for existing resources.
962
+ */
963
+ export interface TextEditChange {
964
+ /**
965
+ * Gets all text edits for this change.
966
+ *
967
+ * @return An array of text edits.
968
+ *
969
+ * @since 3.16.0 - support for annotated text edits. This is usually
970
+ * guarded using a client capability.
971
+ *
972
+ * @since 3.18.0 - support for snippet text edits. This is usually
973
+ * guarded using a client capability.
974
+ */
975
+ all(): (TextEdit | AnnotatedTextEdit | SnippetTextEdit)[];
976
+ /**
977
+ * Clears the edits for this change.
978
+ */
979
+ clear(): void;
980
+ /**
981
+ * Adds a text edit.
982
+ *
983
+ * @param edit the text edit to add.
984
+ *
985
+ * @since 3.16.0 - support for annotated text edits. This is usually
986
+ * guarded using a client capability.
987
+ *
988
+ * @since 3.18.0 - support for snippet text edits. This is usually
989
+ * guarded using a client capability.
990
+ */
991
+ add(edit: TextEdit | AnnotatedTextEdit | SnippetTextEdit): void;
992
+ /**
993
+ * Insert the given text at the given position.
994
+ *
995
+ * @param position A position.
996
+ * @param newText A string.
997
+ * @param annotation An optional annotation.
998
+ */
999
+ insert(position: Position, newText: string): void;
1000
+ insert(position: Position, newText: string, annotation: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;
1001
+ /**
1002
+ * Replace the given range with given text for the given resource.
1003
+ *
1004
+ * @param range A range.
1005
+ * @param newText A string.
1006
+ * @param annotation An optional annotation.
1007
+ */
1008
+ replace(range: Range, newText: string): void;
1009
+ replace(range: Range, newText: string, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;
1010
+ /**
1011
+ * Delete the text at the given range.
1012
+ *
1013
+ * @param range A range.
1014
+ * @param annotation An optional annotation.
1015
+ */
1016
+ delete(range: Range): void;
1017
+ delete(range: Range, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;
1018
+ }
1019
+ /**
1020
+ * An interactive text edit.
1021
+ *
1022
+ * @since 3.18.0
1023
+ */
1024
+ export interface SnippetTextEdit {
1025
+ /**
1026
+ * The range of the text document to be manipulated.
1027
+ */
1028
+ range: Range;
1029
+ /**
1030
+ * The snippet to be inserted.
1031
+ */
1032
+ snippet: StringValue;
1033
+ /**
1034
+ * The actual identifier of the snippet edit.
1035
+ */
1036
+ annotationId?: ChangeAnnotationIdentifier;
1037
+ }
1038
+ export declare namespace SnippetTextEdit {
1039
+ function is(value: any): value is SnippetTextEdit;
1040
+ }
1041
+ /**
1042
+ * A workspace change helps constructing changes to a workspace.
1043
+ */
1044
+ export declare class WorkspaceChange {
1045
+ private _workspaceEdit;
1046
+ private _textEditChanges;
1047
+ private _changeAnnotations;
1048
+ constructor(workspaceEdit?: WorkspaceEdit);
1049
+ /**
1050
+ * Returns the underlying {@link WorkspaceEdit} literal
1051
+ * use to be returned from a workspace edit operation like rename.
1052
+ */
1053
+ get edit(): WorkspaceEdit;
1054
+ /**
1055
+ * Returns the {@link TextEditChange} to manage text edits
1056
+ * for resources.
1057
+ */
1058
+ getTextEditChange(textDocument: OptionalVersionedTextDocumentIdentifier): TextEditChange;
1059
+ getTextEditChange(uri: DocumentUri): TextEditChange;
1060
+ private initDocumentChanges;
1061
+ private initChanges;
1062
+ createFile(uri: DocumentUri, options?: CreateFileOptions): void;
1063
+ createFile(uri: DocumentUri, annotation: ChangeAnnotation | ChangeAnnotationIdentifier, options?: CreateFileOptions): ChangeAnnotationIdentifier;
1064
+ renameFile(oldUri: DocumentUri, newUri: DocumentUri, options?: RenameFileOptions): void;
1065
+ renameFile(oldUri: DocumentUri, newUri: DocumentUri, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier, options?: RenameFileOptions): ChangeAnnotationIdentifier;
1066
+ deleteFile(uri: DocumentUri, options?: DeleteFileOptions): void;
1067
+ deleteFile(uri: DocumentUri, annotation: ChangeAnnotation | ChangeAnnotationIdentifier, options?: DeleteFileOptions): ChangeAnnotationIdentifier;
1068
+ }
1069
+ /**
1070
+ * A literal to identify a text document in the client.
1071
+ */
1072
+ export interface TextDocumentIdentifier {
1073
+ /**
1074
+ * The text document's uri.
1075
+ */
1076
+ uri: DocumentUri;
1077
+ }
1078
+ /**
1079
+ * The TextDocumentIdentifier namespace provides helper functions to work with
1080
+ * {@link TextDocumentIdentifier} literals.
1081
+ */
1082
+ export declare namespace TextDocumentIdentifier {
1083
+ /**
1084
+ * Creates a new TextDocumentIdentifier literal.
1085
+ * @param uri The document's uri.
1086
+ */
1087
+ function create(uri: DocumentUri): TextDocumentIdentifier;
1088
+ /**
1089
+ * Checks whether the given literal conforms to the {@link TextDocumentIdentifier} interface.
1090
+ */
1091
+ function is(value: any): value is TextDocumentIdentifier;
1092
+ }
1093
+ /**
1094
+ * A text document identifier to denote a specific version of a text document.
1095
+ */
1096
+ export interface VersionedTextDocumentIdentifier extends TextDocumentIdentifier {
1097
+ /**
1098
+ * The version number of this document.
1099
+ */
1100
+ version: integer;
1101
+ }
1102
+ /**
1103
+ * The VersionedTextDocumentIdentifier namespace provides helper functions to work with
1104
+ * {@link VersionedTextDocumentIdentifier} literals.
1105
+ */
1106
+ export declare namespace VersionedTextDocumentIdentifier {
1107
+ /**
1108
+ * Creates a new VersionedTextDocumentIdentifier literal.
1109
+ * @param uri The document's uri.
1110
+ * @param version The document's version.
1111
+ */
1112
+ function create(uri: DocumentUri, version: integer): VersionedTextDocumentIdentifier;
1113
+ /**
1114
+ * Checks whether the given literal conforms to the {@link VersionedTextDocumentIdentifier} interface.
1115
+ */
1116
+ function is(value: any): value is VersionedTextDocumentIdentifier;
1117
+ }
1118
+ /**
1119
+ * A text document identifier to optionally denote a specific version of a text document.
1120
+ */
1121
+ export interface OptionalVersionedTextDocumentIdentifier extends TextDocumentIdentifier {
1122
+ /**
1123
+ * The version number of this document. If a versioned text document identifier
1124
+ * is sent from the server to the client and the file is not open in the editor
1125
+ * (the server has not received an open notification before) the server can send
1126
+ * `null` to indicate that the version is unknown and the content on disk is the
1127
+ * truth (as specified with document content ownership).
1128
+ */
1129
+ version: integer | null;
1130
+ }
1131
+ /**
1132
+ * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with
1133
+ * {@link OptionalVersionedTextDocumentIdentifier} literals.
1134
+ */
1135
+ export declare namespace OptionalVersionedTextDocumentIdentifier {
1136
+ /**
1137
+ * Creates a new OptionalVersionedTextDocumentIdentifier literal.
1138
+ * @param uri The document's uri.
1139
+ * @param version The document's version.
1140
+ */
1141
+ function create(uri: DocumentUri, version: integer | null): OptionalVersionedTextDocumentIdentifier;
1142
+ /**
1143
+ * Checks whether the given literal conforms to the {@link OptionalVersionedTextDocumentIdentifier} interface.
1144
+ */
1145
+ function is(value: any): value is OptionalVersionedTextDocumentIdentifier;
1146
+ }
1147
+ /**
1148
+ * An item to transfer a text document from the client to the
1149
+ * server.
1150
+ */
1151
+ export interface TextDocumentItem {
1152
+ /**
1153
+ * The text document's uri.
1154
+ */
1155
+ uri: DocumentUri;
1156
+ /**
1157
+ * The text document's language identifier.
1158
+ */
1159
+ languageId: LanguageKind;
1160
+ /**
1161
+ * The version number of this document (it will increase after each
1162
+ * change, including undo/redo).
1163
+ */
1164
+ version: integer;
1165
+ /**
1166
+ * The content of the opened text document.
1167
+ */
1168
+ text: string;
1169
+ }
1170
+ /**
1171
+ * Predefined Language kinds
1172
+ * @since 3.18.0
1173
+ */
1174
+ export declare namespace LanguageKind {
1175
+ const ABAP: "abap";
1176
+ const WindowsBat: "bat";
1177
+ const BibTeX: "bibtex";
1178
+ const Clojure: "clojure";
1179
+ const Coffeescript: "coffeescript";
1180
+ const C: "c";
1181
+ const CPP: "cpp";
1182
+ const CSharp: "csharp";
1183
+ const CSS: "css";
1184
+ /**
1185
+ * @since 3.18.0
1186
+ */
1187
+ const D: "d";
1188
+ /**
1189
+ * @since 3.18.0
1190
+ */
1191
+ const Delphi: "pascal";
1192
+ const Diff: "diff";
1193
+ const Dart: "dart";
1194
+ const Dockerfile: "dockerfile";
1195
+ const Elixir: "elixir";
1196
+ const Erlang: "erlang";
1197
+ const FSharp: "fsharp";
1198
+ const GitCommit: "git-commit";
1199
+ const GitRebase: "git-rebase";
1200
+ const Go: "go";
1201
+ const Groovy: "groovy";
1202
+ const Handlebars: "handlebars";
1203
+ const Haskell: "haskell";
1204
+ const HTML: "html";
1205
+ const Ini: "ini";
1206
+ const Java: "java";
1207
+ const JavaScript: "javascript";
1208
+ const JavaScriptReact: "javascriptreact";
1209
+ const JSON: "json";
1210
+ const LaTeX: "latex";
1211
+ const Less: "less";
1212
+ const Lua: "lua";
1213
+ const Makefile: "makefile";
1214
+ const Markdown: "markdown";
1215
+ const ObjectiveC: "objective-c";
1216
+ const ObjectiveCPP: "objective-cpp";
1217
+ /**
1218
+ * @since 3.18.0
1219
+ */
1220
+ const Pascal: "pascal";
1221
+ const Perl: "perl";
1222
+ const Perl6: "perl6";
1223
+ const PHP: "php";
1224
+ const Plaintext: "plaintext";
1225
+ const Powershell: "powershell";
1226
+ const Pug: "jade";
1227
+ const Python: "python";
1228
+ const R: "r";
1229
+ const Razor: "razor";
1230
+ const Ruby: "ruby";
1231
+ const Rust: "rust";
1232
+ const SCSS: "scss";
1233
+ const SASS: "sass";
1234
+ const Scala: "scala";
1235
+ const ShaderLab: "shaderlab";
1236
+ const ShellScript: "shellscript";
1237
+ const SQL: "sql";
1238
+ const Swift: "swift";
1239
+ const TypeScript: "typescript";
1240
+ const TypeScriptReact: "typescriptreact";
1241
+ const TeX: "tex";
1242
+ const VisualBasic: "vb";
1243
+ const XML: "xml";
1244
+ const XSL: "xsl";
1245
+ const YAML: "yaml";
1246
+ }
1247
+ export type LanguageKind = string;
1248
+ /**
1249
+ * The TextDocumentItem namespace provides helper functions to work with
1250
+ * {@link TextDocumentItem} literals.
1251
+ */
1252
+ export declare namespace TextDocumentItem {
1253
+ /**
1254
+ * Creates a new TextDocumentItem literal.
1255
+ * @param uri The document's uri.
1256
+ * @param languageId The document's language identifier.
1257
+ * @param version The document's version number.
1258
+ * @param text The document's text.
1259
+ */
1260
+ function create(uri: DocumentUri, languageId: LanguageKind, version: integer, text: string): TextDocumentItem;
1261
+ /**
1262
+ * Checks whether the given literal conforms to the {@link TextDocumentItem} interface.
1263
+ */
1264
+ function is(value: any): value is TextDocumentItem;
1265
+ }
1266
+ /**
1267
+ * Describes the content type that a client supports in various
1268
+ * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
1269
+ *
1270
+ * Please note that `MarkupKinds` must not start with a `$`. This kinds
1271
+ * are reserved for internal usage.
1272
+ */
1273
+ export declare namespace MarkupKind {
1274
+ /**
1275
+ * Plain text is supported as a content format
1276
+ */
1277
+ const PlainText: 'plaintext';
1278
+ /**
1279
+ * Markdown is supported as a content format
1280
+ */
1281
+ const Markdown: 'markdown';
1282
+ /**
1283
+ * Checks whether the given value is a value of the {@link MarkupKind} type.
1284
+ */
1285
+ function is(value: any): value is MarkupKind;
1286
+ }
1287
+ export type MarkupKind = 'plaintext' | 'markdown';
1288
+ /**
1289
+ * A `MarkupContent` literal represents a string value which content is interpreted base on its
1290
+ * kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.
1291
+ *
1292
+ * If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.
1293
+ * See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
1294
+ *
1295
+ * Here is an example how such a string can be constructed using JavaScript / TypeScript:
1296
+ * ```ts
1297
+ * let markdown: MarkdownContent = {
1298
+ * kind: MarkupKind.Markdown,
1299
+ * value: [
1300
+ * '# Header',
1301
+ * 'Some text',
1302
+ * '```typescript',
1303
+ * 'someCode();',
1304
+ * '```'
1305
+ * ].join('\n')
1306
+ * };
1307
+ * ```
1308
+ *
1309
+ * *Please Note* that clients might sanitize the return markdown. A client could decide to
1310
+ * remove HTML from the markdown to avoid script execution.
1311
+ */
1312
+ export interface MarkupContent {
1313
+ /**
1314
+ * The type of the Markup
1315
+ */
1316
+ kind: MarkupKind;
1317
+ /**
1318
+ * The content itself
1319
+ */
1320
+ value: string;
1321
+ }
1322
+ export declare namespace MarkupContent {
1323
+ /**
1324
+ * Checks whether the given value conforms to the {@link MarkupContent} interface.
1325
+ */
1326
+ function is(value: any): value is MarkupContent;
1327
+ }
1328
+ /**
1329
+ * The kind of a completion entry.
1330
+ */
1331
+ export declare namespace CompletionItemKind {
1332
+ const Text: 1;
1333
+ const Method: 2;
1334
+ const Function: 3;
1335
+ const Constructor: 4;
1336
+ const Field: 5;
1337
+ const Variable: 6;
1338
+ const Class: 7;
1339
+ const Interface: 8;
1340
+ const Module: 9;
1341
+ const Property: 10;
1342
+ const Unit: 11;
1343
+ const Value: 12;
1344
+ const Enum: 13;
1345
+ const Keyword: 14;
1346
+ const Snippet: 15;
1347
+ const Color: 16;
1348
+ const File: 17;
1349
+ const Reference: 18;
1350
+ const Folder: 19;
1351
+ const EnumMember: 20;
1352
+ const Constant: 21;
1353
+ const Struct: 22;
1354
+ const Event: 23;
1355
+ const Operator: 24;
1356
+ const TypeParameter: 25;
1357
+ }
1358
+ export type CompletionItemKind = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25;
1359
+ /**
1360
+ * Defines whether the insert text in a completion item should be interpreted as
1361
+ * plain text or a snippet.
1362
+ */
1363
+ export declare namespace InsertTextFormat {
1364
+ /**
1365
+ * The primary text to be inserted is treated as a plain string.
1366
+ */
1367
+ const PlainText: 1;
1368
+ /**
1369
+ * The primary text to be inserted is treated as a snippet.
1370
+ *
1371
+ * A snippet can define tab stops and placeholders with `$1`, `$2`
1372
+ * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
1373
+ * the end of the snippet. Placeholders with equal identifiers are linked,
1374
+ * that is typing in one will update others too.
1375
+ *
1376
+ * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax
1377
+ */
1378
+ const Snippet: 2;
1379
+ }
1380
+ export type InsertTextFormat = 1 | 2;
1381
+ /**
1382
+ * Completion item tags are extra annotations that tweak the rendering of a completion
1383
+ * item.
1384
+ *
1385
+ * @since 3.15.0
1386
+ */
1387
+ export declare namespace CompletionItemTag {
1388
+ /**
1389
+ * Render a completion as obsolete, usually using a strike-out.
1390
+ */
1391
+ const Deprecated = 1;
1392
+ }
1393
+ export type CompletionItemTag = 1;
1394
+ /**
1395
+ * A special text edit to provide an insert and a replace operation.
1396
+ *
1397
+ * @since 3.16.0
1398
+ */
1399
+ export interface InsertReplaceEdit {
1400
+ /**
1401
+ * The string to be inserted.
1402
+ */
1403
+ newText: string;
1404
+ /**
1405
+ * The range if the insert is requested
1406
+ */
1407
+ insert: Range;
1408
+ /**
1409
+ * The range if the replace is requested.
1410
+ */
1411
+ replace: Range;
1412
+ }
1413
+ /**
1414
+ * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.
1415
+ *
1416
+ * @since 3.16.0
1417
+ */
1418
+ export declare namespace InsertReplaceEdit {
1419
+ /**
1420
+ * Creates a new insert / replace edit
1421
+ */
1422
+ function create(newText: string, insert: Range, replace: Range): InsertReplaceEdit;
1423
+ /**
1424
+ * Checks whether the given literal conforms to the {@link InsertReplaceEdit} interface.
1425
+ */
1426
+ function is(value: TextEdit | InsertReplaceEdit): value is InsertReplaceEdit;
1427
+ }
1428
+ /**
1429
+ * How whitespace and indentation is handled during completion
1430
+ * item insertion.
1431
+ *
1432
+ * @since 3.16.0
1433
+ */
1434
+ export declare namespace InsertTextMode {
1435
+ /**
1436
+ * The insertion or replace strings is taken as it is. If the
1437
+ * value is multi line the lines below the cursor will be
1438
+ * inserted using the indentation defined in the string value.
1439
+ * The client will not apply any kind of adjustments to the
1440
+ * string.
1441
+ */
1442
+ const asIs: 1;
1443
+ /**
1444
+ * The editor adjusts leading whitespace of new lines so that
1445
+ * they match the indentation up to the cursor of the line for
1446
+ * which the item is accepted.
1447
+ *
1448
+ * Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a
1449
+ * multi line completion item is indented using 2 tabs and all
1450
+ * following lines inserted will be indented using 2 tabs as well.
1451
+ */
1452
+ const adjustIndentation: 2;
1453
+ }
1454
+ export type InsertTextMode = 1 | 2;
1455
+ /**
1456
+ * Defines how values from a set of defaults and an individual item will be
1457
+ * merged.
1458
+ *
1459
+ * @since 3.18.0
1460
+ */
1461
+ export declare namespace ApplyKind {
1462
+ /**
1463
+ * The value from the individual item (if provided and not `null`) will be
1464
+ * used instead of the default.
1465
+ */
1466
+ const Replace: 1;
1467
+ /**
1468
+ * The value from the item will be merged with the default.
1469
+ *
1470
+ * The specific rules for mergeing values are defined against each field
1471
+ * that supports merging.
1472
+ */
1473
+ const Merge: 2;
1474
+ }
1475
+ /**
1476
+ * Defines how values from a set of defaults and an individual item will be
1477
+ * merged.
1478
+ *
1479
+ * @since 3.18.0
1480
+ */
1481
+ export type ApplyKind = 1 | 2;
1482
+ /**
1483
+ * Additional details for a completion item label.
1484
+ *
1485
+ * @since 3.17.0
1486
+ */
1487
+ export interface CompletionItemLabelDetails {
1488
+ /**
1489
+ * An optional string which is rendered less prominently directly after {@link CompletionItem.label label},
1490
+ * without any spacing. Should be used for function signatures and type annotations.
1491
+ */
1492
+ detail?: string;
1493
+ /**
1494
+ * An optional string which is rendered less prominently after {@link CompletionItem.detail}. Should be used
1495
+ * for fully qualified names and file paths.
1496
+ */
1497
+ description?: string;
1498
+ }
1499
+ export declare namespace CompletionItemLabelDetails {
1500
+ function is(value: any): value is CompletionItemLabelDetails;
1501
+ }
1502
+ /**
1503
+ * A completion item represents a text snippet that is
1504
+ * proposed to complete text that is being typed.
1505
+ */
1506
+ export interface CompletionItem {
1507
+ /**
1508
+ * The label of this completion item.
1509
+ *
1510
+ * The label property is also by default the text that
1511
+ * is inserted when selecting this completion.
1512
+ *
1513
+ * If label details are provided the label itself should
1514
+ * be an unqualified name of the completion item.
1515
+ */
1516
+ label: string;
1517
+ /**
1518
+ * Additional details for the label
1519
+ *
1520
+ * @since 3.17.0
1521
+ */
1522
+ labelDetails?: CompletionItemLabelDetails;
1523
+ /**
1524
+ * The kind of this completion item. Based of the kind
1525
+ * an icon is chosen by the editor.
1526
+ */
1527
+ kind?: CompletionItemKind;
1528
+ /**
1529
+ * Tags for this completion item.
1530
+ *
1531
+ * @since 3.15.0
1532
+ */
1533
+ tags?: CompletionItemTag[];
1534
+ /**
1535
+ * A human-readable string with additional information
1536
+ * about this item, like type or symbol information.
1537
+ */
1538
+ detail?: string;
1539
+ /**
1540
+ * A human-readable string that represents a doc-comment.
1541
+ */
1542
+ documentation?: string | MarkupContent;
1543
+ /**
1544
+ * Indicates if this item is deprecated.
1545
+ * @deprecated Use `tags` instead.
1546
+ */
1547
+ deprecated?: boolean;
1548
+ /**
1549
+ * Select this item when showing.
1550
+ *
1551
+ * *Note* that only one completion item can be selected and that the
1552
+ * tool / client decides which item that is. The rule is that the *first*
1553
+ * item of those that match best is selected.
1554
+ */
1555
+ preselect?: boolean;
1556
+ /**
1557
+ * A string that should be used when comparing this item
1558
+ * with other items. When `falsy` the {@link CompletionItem.label label}
1559
+ * is used.
1560
+ */
1561
+ sortText?: string;
1562
+ /**
1563
+ * A string that should be used when filtering a set of
1564
+ * completion items. When `falsy` the {@link CompletionItem.label label}
1565
+ * is used.
1566
+ */
1567
+ filterText?: string;
1568
+ /**
1569
+ * A string that should be inserted into a document when selecting
1570
+ * this completion. When `falsy` the {@link CompletionItem.label label}
1571
+ * is used.
1572
+ *
1573
+ * The `insertText` is subject to interpretation by the client side.
1574
+ * Some tools might not take the string literally. For example
1575
+ * VS Code when code complete is requested in this example
1576
+ * `con<cursor position>` and a completion item with an `insertText` of
1577
+ * `console` is provided it will only insert `sole`. Therefore it is
1578
+ * recommended to use `textEdit` instead since it avoids additional client
1579
+ * side interpretation.
1580
+ */
1581
+ insertText?: string;
1582
+ /**
1583
+ * The format of the insert text. The format applies to both the
1584
+ * `insertText` property and the `newText` property of a provided
1585
+ * `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
1586
+ *
1587
+ * Please note that the insertTextFormat doesn't apply to
1588
+ * `additionalTextEdits`.
1589
+ */
1590
+ insertTextFormat?: InsertTextFormat;
1591
+ /**
1592
+ * How whitespace and indentation is handled during completion
1593
+ * item insertion. If not provided the clients default value depends on
1594
+ * the `textDocument.completion.insertTextMode` client capability.
1595
+ *
1596
+ * @since 3.16.0
1597
+ */
1598
+ insertTextMode?: InsertTextMode;
1599
+ /**
1600
+ * An {@link TextEdit edit} which is applied to a document when selecting
1601
+ * this completion. When an edit is provided the value of
1602
+ * {@link CompletionItem.insertText insertText} is ignored.
1603
+ *
1604
+ * Most editors support two different operations when accepting a completion
1605
+ * item. One is to insert a completion text and the other is to replace an
1606
+ * existing text with a completion text. Since this can usually not be
1607
+ * predetermined by a server it can report both ranges. Clients need to
1608
+ * signal support for `InsertReplaceEdits` via the
1609
+ * `textDocument.completion.insertReplaceSupport` client capability
1610
+ * property.
1611
+ *
1612
+ * *Note 1:* The text edit's range as well as both ranges from an insert
1613
+ * replace edit must be a [single line] and they must contain the position
1614
+ * at which completion has been requested.
1615
+ * *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range
1616
+ * must be a prefix of the edit's replace range, that means it must be
1617
+ * contained and starting at the same position.
1618
+ *
1619
+ * @since 3.16.0 additional type `InsertReplaceEdit`
1620
+ */
1621
+ textEdit?: TextEdit | InsertReplaceEdit;
1622
+ /**
1623
+ * The edit text used if the completion item is part of a CompletionList and
1624
+ * CompletionList defines an item default for the text edit range.
1625
+ *
1626
+ * Clients will only honor this property if they opt into completion list
1627
+ * item defaults using the capability `completionList.itemDefaults`.
1628
+ *
1629
+ * If not provided and a list's default range is provided the label
1630
+ * property is used as a text.
1631
+ *
1632
+ * @since 3.17.0
1633
+ */
1634
+ textEditText?: string;
1635
+ /**
1636
+ * An optional array of additional {@link TextEdit text edits} that are applied when
1637
+ * selecting this completion. Edits must not overlap (including the same insert position)
1638
+ * with the main {@link CompletionItem.textEdit edit} nor with themselves.
1639
+ *
1640
+ * Additional text edits should be used to change text unrelated to the current cursor position
1641
+ * (for example adding an import statement at the top of the file if the completion item will
1642
+ * insert an unqualified type).
1643
+ */
1644
+ additionalTextEdits?: TextEdit[];
1645
+ /**
1646
+ * An optional set of characters that when pressed while this completion is active will accept it first and
1647
+ * then type that character. *Note* that all commit characters should have `length=1` and that superfluous
1648
+ * characters will be ignored.
1649
+ */
1650
+ commitCharacters?: string[];
1651
+ /**
1652
+ * An optional {@link Command command} that is executed *after* inserting this completion. *Note* that
1653
+ * additional modifications to the current document should be described with the
1654
+ * {@link CompletionItem.additionalTextEdits additionalTextEdits}-property.
1655
+ */
1656
+ command?: Command;
1657
+ /**
1658
+ * A data entry field that is preserved on a completion item between a
1659
+ * {@link CompletionRequest} and a {@link CompletionResolveRequest}.
1660
+ */
1661
+ data?: LSPAny;
1662
+ }
1663
+ /**
1664
+ * The CompletionItem namespace provides functions to deal with
1665
+ * completion items.
1666
+ */
1667
+ export declare namespace CompletionItem {
1668
+ /**
1669
+ * Create a completion item and seed it with a label.
1670
+ * @param label The completion item's label
1671
+ */
1672
+ function create(label: string): CompletionItem;
1673
+ }
1674
+ /**
1675
+ * Edit range variant that includes ranges for insert and replace operations.
1676
+ *
1677
+ * @since 3.18.0
1678
+ */
1679
+ export type EditRangeWithInsertReplace = {
1680
+ insert: Range;
1681
+ replace: Range;
1682
+ };
1683
+ /**
1684
+ * In many cases the items of an actual completion result share the same
1685
+ * value for properties like `commitCharacters` or the range of a text
1686
+ * edit. A completion list can therefore define item defaults which will
1687
+ * be used if a completion item itself doesn't specify the value.
1688
+ *
1689
+ * If a completion list specifies a default value and a completion item
1690
+ * also specifies a corresponding value, the rules for combining these are
1691
+ * defined by `applyKinds` (if the client supports it), defaulting to
1692
+ * ApplyKind.Replace.
1693
+ *
1694
+ * Servers are only allowed to return default values if the client
1695
+ * signals support for this via the `completionList.itemDefaults`
1696
+ * capability.
1697
+ *
1698
+ * @since 3.17.0
1699
+ */
1700
+ export interface CompletionItemDefaults {
1701
+ /**
1702
+ * A default commit character set.
1703
+ *
1704
+ * @since 3.17.0
1705
+ */
1706
+ commitCharacters?: string[];
1707
+ /**
1708
+ * A default edit range.
1709
+ *
1710
+ * @since 3.17.0
1711
+ */
1712
+ editRange?: Range | EditRangeWithInsertReplace;
1713
+ /**
1714
+ * A default insert text format.
1715
+ *
1716
+ * @since 3.17.0
1717
+ */
1718
+ insertTextFormat?: InsertTextFormat;
1719
+ /**
1720
+ * A default insert text mode.
1721
+ *
1722
+ * @since 3.17.0
1723
+ */
1724
+ insertTextMode?: InsertTextMode;
1725
+ /**
1726
+ * A default data value.
1727
+ *
1728
+ * @since 3.17.0
1729
+ */
1730
+ data?: LSPAny;
1731
+ }
1732
+ /**
1733
+ * Specifies how fields from a completion item should be combined with those
1734
+ * from `completionList.itemDefaults`.
1735
+ *
1736
+ * If unspecified, all fields will be treated as ApplyKind.Replace.
1737
+ *
1738
+ * If a field's value is ApplyKind.Replace, the value from a completion item (if
1739
+ * provided and not `null`) will always be used instead of the value from
1740
+ * `completionItem.itemDefaults`.
1741
+ *
1742
+ * If a field's value is ApplyKind.Merge, the values will be merged using the rules
1743
+ * defined against each field below.
1744
+ *
1745
+ * Servers are only allowed to return `applyKind` if the client
1746
+ * signals support for this via the `completionList.applyKindSupport`
1747
+ * capability.
1748
+ *
1749
+ * @since 3.18.0
1750
+ */
1751
+ export interface CompletionItemApplyKinds {
1752
+ /**
1753
+ * Specifies whether commitCharacters on a completion will replace or be
1754
+ * merged with those in `completionList.itemDefaults.commitCharacters`.
1755
+ *
1756
+ * If ApplyKind.Replace, the commit characters from the completion item will
1757
+ * always be used unless not provided, in which case those from
1758
+ * `completionList.itemDefaults.commitCharacters` will be used. An
1759
+ * empty list can be used if a completion item does not have any commit
1760
+ * characters and also should not use those from
1761
+ * `completionList.itemDefaults.commitCharacters`.
1762
+ *
1763
+ * If ApplyKind.Merge the commitCharacters for the completion will be the
1764
+ * union of all values in both `completionList.itemDefaults.commitCharacters`
1765
+ * and the completion's own `commitCharacters`.
1766
+ *
1767
+ * @since 3.18.0
1768
+ */
1769
+ commitCharacters?: ApplyKind;
1770
+ /**
1771
+ * Specifies whether the `data` field on a completion will replace or
1772
+ * be merged with data from `completionList.itemDefaults.data`.
1773
+ *
1774
+ * If ApplyKind.Replace, the data from the completion item will be used if
1775
+ * provided (and not `null`), otherwise
1776
+ * `completionList.itemDefaults.data` will be used. An empty object can
1777
+ * be used if a completion item does not have any data but also should
1778
+ * not use the value from `completionList.itemDefaults.data`.
1779
+ *
1780
+ * If ApplyKind.Merge, a shallow merge will be performed between
1781
+ * `completionList.itemDefaults.data` and the completion's own data
1782
+ * using the following rules:
1783
+ *
1784
+ * - If a completion's `data` field is not provided (or `null`), the
1785
+ * entire `data` field from `completionList.itemDefaults.data` will be
1786
+ * used as-is.
1787
+ * - If a completion's `data` field is provided, each field will
1788
+ * overwrite the field of the same name in
1789
+ * `completionList.itemDefaults.data` but no merging of nested fields
1790
+ * within that value will occur.
1791
+ *
1792
+ * @since 3.18.0
1793
+ */
1794
+ data?: ApplyKind;
1795
+ }
1796
+ /**
1797
+ * Represents a collection of {@link CompletionItem completion items} to be presented
1798
+ * in the editor.
1799
+ */
1800
+ export interface CompletionList {
1801
+ /**
1802
+ * This list it not complete. Further typing results in recomputing this list.
1803
+ *
1804
+ * Recomputed lists have all their items replaced (not appended) in the
1805
+ * incomplete completion sessions.
1806
+ */
1807
+ isIncomplete: boolean;
1808
+ /**
1809
+ * In many cases the items of an actual completion result share the same
1810
+ * value for properties like `commitCharacters` or the range of a text
1811
+ * edit. A completion list can therefore define item defaults which will
1812
+ * be used if a completion item itself doesn't specify the value.
1813
+ *
1814
+ * If a completion list specifies a default value and a completion item
1815
+ * also specifies a corresponding value, the rules for combining these are
1816
+ * defined by `applyKinds` (if the client supports it), defaulting to
1817
+ * ApplyKind.Replace.
1818
+ *
1819
+ * Servers are only allowed to return default values if the client
1820
+ * signals support for this via the `completionList.itemDefaults`
1821
+ * capability.
1822
+ *
1823
+ * @since 3.17.0
1824
+ */
1825
+ itemDefaults?: CompletionItemDefaults;
1826
+ /**
1827
+ * Specifies how fields from a completion item should be combined with those
1828
+ * from `completionList.itemDefaults`.
1829
+ *
1830
+ * If unspecified, all fields will be treated as ApplyKind.Replace.
1831
+ *
1832
+ * If a field's value is ApplyKind.Replace, the value from a completion item
1833
+ * (if provided and not `null`) will always be used instead of the value
1834
+ * from `completionItem.itemDefaults`.
1835
+ *
1836
+ * If a field's value is ApplyKind.Merge, the values will be merged using
1837
+ * the rules defined against each field below.
1838
+ *
1839
+ * Servers are only allowed to return `applyKind` if the client
1840
+ * signals support for this via the `completionList.applyKindSupport`
1841
+ * capability.
1842
+ *
1843
+ * @since 3.18.0
1844
+ */
1845
+ applyKind?: CompletionItemApplyKinds;
1846
+ /**
1847
+ * The completion items.
1848
+ */
1849
+ items: CompletionItem[];
1850
+ }
1851
+ /**
1852
+ * The CompletionList namespace provides functions to deal with
1853
+ * completion lists.
1854
+ */
1855
+ export declare namespace CompletionList {
1856
+ /**
1857
+ * Creates a new completion list.
1858
+ *
1859
+ * @param items The completion items.
1860
+ * @param isIncomplete The list is not complete.
1861
+ */
1862
+ function create(items?: CompletionItem[], isIncomplete?: boolean): CompletionList;
1863
+ }
1864
+ /**
1865
+ * @since 3.18.0
1866
+ * @deprecated use MarkupContent instead.
1867
+ */
1868
+ export type MarkedStringWithLanguage = {
1869
+ language: string;
1870
+ value: string;
1871
+ };
1872
+ /**
1873
+ * MarkedString can be used to render human readable text. It is either a markdown string
1874
+ * or a code-block that provides a language and a code snippet. The language identifier
1875
+ * is semantically equal to the optional language identifier in fenced code blocks in GitHub
1876
+ * issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
1877
+ *
1878
+ * The pair of a language and a value is an equivalent to markdown:
1879
+ * ```${language}
1880
+ * ${value}
1881
+ * ```
1882
+ *
1883
+ * Note that markdown strings will be sanitized - that means html will be escaped.
1884
+ * @deprecated use MarkupContent instead.
1885
+ */
1886
+ export type MarkedString = string | MarkedStringWithLanguage;
1887
+ export declare namespace MarkedString {
1888
+ /**
1889
+ * Creates a marked string from plain text.
1890
+ *
1891
+ * @param plainText The plain text.
1892
+ */
1893
+ function fromPlainText(plainText: string): string;
1894
+ /**
1895
+ * Checks whether the given value conforms to the {@link MarkedString} type.
1896
+ */
1897
+ function is(value: any): value is MarkedString;
1898
+ }
1899
+ /**
1900
+ * The result of a hover request.
1901
+ */
1902
+ export interface Hover {
1903
+ /**
1904
+ * The hover's content
1905
+ */
1906
+ contents: MarkupContent | MarkedString | MarkedString[];
1907
+ /**
1908
+ * An optional range inside the text document that is used to
1909
+ * visualize the hover, e.g. by changing the background color.
1910
+ */
1911
+ range?: Range;
1912
+ }
1913
+ export declare namespace Hover {
1914
+ /**
1915
+ * Checks whether the given value conforms to the {@link Hover} interface.
1916
+ */
1917
+ function is(value: any): value is Hover;
1918
+ }
1919
+ /**
1920
+ * Represents a parameter of a callable-signature. A parameter can
1921
+ * have a label and a doc-comment.
1922
+ */
1923
+ export interface ParameterInformation {
1924
+ /**
1925
+ * The label of this parameter information.
1926
+ *
1927
+ * Either a string or an inclusive start and exclusive end offsets within its containing
1928
+ * signature label. (see SignatureInformation.label). The offsets are based on a UTF-16
1929
+ * string representation as `Position` and `Range` does.
1930
+ *
1931
+ * To avoid ambiguities a server should use the [start, end] offset value instead of using
1932
+ * a substring. Whether a client support this is controlled via `labelOffsetSupport` client
1933
+ * capability.
1934
+ *
1935
+ * *Note*: a label of type string should be a substring of its containing signature label.
1936
+ * Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
1937
+ */
1938
+ label: string | [uinteger, uinteger];
1939
+ /**
1940
+ * The human-readable doc-comment of this parameter. Will be shown
1941
+ * in the UI but can be omitted.
1942
+ */
1943
+ documentation?: string | MarkupContent;
1944
+ }
1945
+ /**
1946
+ * The ParameterInformation namespace provides helper functions to work with
1947
+ * {@link ParameterInformation} literals.
1948
+ */
1949
+ export declare namespace ParameterInformation {
1950
+ /**
1951
+ * Creates a new parameter information literal.
1952
+ *
1953
+ * @param label A label string.
1954
+ * @param documentation A doc string.
1955
+ */
1956
+ function create(label: string | [uinteger, uinteger], documentation?: string): ParameterInformation;
1957
+ }
1958
+ /**
1959
+ * Represents the signature of something callable. A signature
1960
+ * can have a label, like a function-name, a doc-comment, and
1961
+ * a set of parameters.
1962
+ */
1963
+ export interface SignatureInformation {
1964
+ /**
1965
+ * The label of this signature. Will be shown in
1966
+ * the UI.
1967
+ */
1968
+ label: string;
1969
+ /**
1970
+ * The human-readable doc-comment of this signature. Will be shown
1971
+ * in the UI but can be omitted.
1972
+ */
1973
+ documentation?: string | MarkupContent;
1974
+ /**
1975
+ * The parameters of this signature.
1976
+ */
1977
+ parameters?: ParameterInformation[];
1978
+ /**
1979
+ * The index of the active parameter.
1980
+ *
1981
+ * If `null`, no parameter of the signature is active (for example a named
1982
+ * argument that does not match any declared parameters). This is only valid
1983
+ * if the client specifies the client capability
1984
+ * `textDocument.signatureHelp.noActiveParameterSupport === true`
1985
+ *
1986
+ * If provided (or `null`), this is used in place of
1987
+ * `SignatureHelp.activeParameter`.
1988
+ *
1989
+ * @since 3.16.0
1990
+ */
1991
+ activeParameter?: uinteger | null;
1992
+ }
1993
+ /**
1994
+ * The SignatureInformation namespace provides helper functions to work with
1995
+ * {@link SignatureInformation} literals.
1996
+ */
1997
+ export declare namespace SignatureInformation {
1998
+ function create(label: string, documentation?: string, ...parameters: ParameterInformation[]): SignatureInformation;
1999
+ }
2000
+ /**
2001
+ * Signature help represents the signature of something
2002
+ * callable. There can be multiple signature but only one
2003
+ * active and only one active parameter.
2004
+ */
2005
+ export interface SignatureHelp {
2006
+ /**
2007
+ * One or more signatures.
2008
+ */
2009
+ signatures: SignatureInformation[];
2010
+ /**
2011
+ * The active signature. If omitted or the value lies outside the
2012
+ * range of `signatures` the value defaults to zero or is ignored if
2013
+ * the `SignatureHelp` has no signatures.
2014
+ *
2015
+ * Whenever possible implementors should make an active decision about
2016
+ * the active signature and shouldn't rely on a default value.
2017
+ *
2018
+ * In future version of the protocol this property might become
2019
+ * mandatory to better express this.
2020
+ */
2021
+ activeSignature?: uinteger;
2022
+ /**
2023
+ * The active parameter of the active signature.
2024
+ *
2025
+ * If `null`, no parameter of the signature is active (for example a named
2026
+ * argument that does not match any declared parameters). This is only valid
2027
+ * if the client specifies the client capability
2028
+ * `textDocument.signatureHelp.noActiveParameterSupport === true`
2029
+ *
2030
+ * If omitted or the value lies outside the range of
2031
+ * `signatures[activeSignature].parameters` defaults to 0 if the active
2032
+ * signature has parameters.
2033
+ *
2034
+ * If the active signature has no parameters it is ignored.
2035
+ *
2036
+ * In future version of the protocol this property might become
2037
+ * mandatory (but still nullable) to better express the active parameter if
2038
+ * the active signature does have any.
2039
+ *
2040
+ * Since version 3.16.0 the `SignatureInformation` itself provides a
2041
+ * `activeParameter` property and it should be used instead of this one.
2042
+ */
2043
+ activeParameter?: uinteger | null;
2044
+ }
2045
+ /**
2046
+ * The definition of a symbol represented as one or many {@link Location locations}.
2047
+ * For most programming languages there is only one location at which a symbol is
2048
+ * defined.
2049
+ *
2050
+ * Servers should prefer returning `DefinitionLink` over `Definition` if supported
2051
+ * by the client.
2052
+ */
2053
+ export type Definition = Location | Location[];
2054
+ /**
2055
+ * Information about where a symbol is defined.
2056
+ *
2057
+ * Provides additional metadata over normal {@link Location location} definitions, including the range of
2058
+ * the defining symbol
2059
+ */
2060
+ export type DefinitionLink = LocationLink;
2061
+ /**
2062
+ * The declaration of a symbol representation as one or many {@link Location locations}.
2063
+ */
2064
+ export type Declaration = Location | Location[];
2065
+ /**
2066
+ * Information about where a symbol is declared.
2067
+ *
2068
+ * Provides additional metadata over normal {@link Location location} declarations, including the range of
2069
+ * the declaring symbol.
2070
+ *
2071
+ * Servers should prefer returning `DeclarationLink` over `Declaration` if supported
2072
+ * by the client.
2073
+ */
2074
+ export type DeclarationLink = LocationLink;
2075
+ /**
2076
+ * Value-object that contains additional information when
2077
+ * requesting references.
2078
+ */
2079
+ export interface ReferenceContext {
2080
+ /**
2081
+ * Include the declaration of the current symbol.
2082
+ */
2083
+ includeDeclaration: boolean;
2084
+ }
2085
+ /**
2086
+ * A document highlight kind.
2087
+ */
2088
+ export declare namespace DocumentHighlightKind {
2089
+ /**
2090
+ * A textual occurrence.
2091
+ */
2092
+ const Text: 1;
2093
+ /**
2094
+ * Read-access of a symbol, like reading a variable.
2095
+ */
2096
+ const Read: 2;
2097
+ /**
2098
+ * Write-access of a symbol, like writing to a variable.
2099
+ */
2100
+ const Write: 3;
2101
+ }
2102
+ export type DocumentHighlightKind = 1 | 2 | 3;
2103
+ /**
2104
+ * A document highlight is a range inside a text document which deserves
2105
+ * special attention. Usually a document highlight is visualized by changing
2106
+ * the background color of its range.
2107
+ */
2108
+ export interface DocumentHighlight {
2109
+ /**
2110
+ * The range this highlight applies to.
2111
+ */
2112
+ range: Range;
2113
+ /**
2114
+ * The highlight kind, default is {@link DocumentHighlightKind.Text text}.
2115
+ */
2116
+ kind?: DocumentHighlightKind;
2117
+ }
2118
+ /**
2119
+ * DocumentHighlight namespace to provide helper functions to work with
2120
+ * {@link DocumentHighlight} literals.
2121
+ */
2122
+ export declare namespace DocumentHighlight {
2123
+ /**
2124
+ * Create a DocumentHighlight object.
2125
+ * @param range The range the highlight applies to.
2126
+ * @param kind The highlight kind
2127
+ */
2128
+ function create(range: Range, kind?: DocumentHighlightKind): DocumentHighlight;
2129
+ }
2130
+ /**
2131
+ * A symbol kind.
2132
+ */
2133
+ export declare namespace SymbolKind {
2134
+ const File: 1;
2135
+ const Module: 2;
2136
+ const Namespace: 3;
2137
+ const Package: 4;
2138
+ const Class: 5;
2139
+ const Method: 6;
2140
+ const Property: 7;
2141
+ const Field: 8;
2142
+ const Constructor: 9;
2143
+ const Enum: 10;
2144
+ const Interface: 11;
2145
+ const Function: 12;
2146
+ const Variable: 13;
2147
+ const Constant: 14;
2148
+ const String: 15;
2149
+ const Number: 16;
2150
+ const Boolean: 17;
2151
+ const Array: 18;
2152
+ const Object: 19;
2153
+ const Key: 20;
2154
+ const Null: 21;
2155
+ const EnumMember: 22;
2156
+ const Struct: 23;
2157
+ const Event: 24;
2158
+ const Operator: 25;
2159
+ const TypeParameter: 26;
2160
+ }
2161
+ export type SymbolKind = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26;
2162
+ /**
2163
+ * Symbol tags are extra annotations that tweak the rendering of a symbol.
2164
+ *
2165
+ * @since 3.16
2166
+ */
2167
+ export declare namespace SymbolTag {
2168
+ /**
2169
+ * Render a symbol as obsolete, usually using a strike-out.
2170
+ */
2171
+ const Deprecated: 1;
2172
+ }
2173
+ export type SymbolTag = 1;
2174
+ /**
2175
+ * A base for all symbol information.
2176
+ */
2177
+ export interface BaseSymbolInformation {
2178
+ /**
2179
+ * The name of this symbol.
2180
+ */
2181
+ name: string;
2182
+ /**
2183
+ * The kind of this symbol.
2184
+ */
2185
+ kind: SymbolKind;
2186
+ /**
2187
+ * Tags for this symbol.
2188
+ *
2189
+ * @since 3.16.0
2190
+ */
2191
+ tags?: SymbolTag[];
2192
+ /**
2193
+ * The name of the symbol containing this symbol. This information is for
2194
+ * user interface purposes (e.g. to render a qualifier in the user interface
2195
+ * if necessary). It can't be used to re-infer a hierarchy for the document
2196
+ * symbols.
2197
+ */
2198
+ containerName?: string;
2199
+ }
2200
+ /**
2201
+ * Represents information about programming constructs like variables, classes,
2202
+ * interfaces etc.
2203
+ */
2204
+ export interface SymbolInformation extends BaseSymbolInformation {
2205
+ /**
2206
+ * Indicates if this symbol is deprecated.
2207
+ *
2208
+ * @deprecated Use tags instead
2209
+ */
2210
+ deprecated?: boolean;
2211
+ /**
2212
+ * The location of this symbol. The location's range is used by a tool
2213
+ * to reveal the location in the editor. If the symbol is selected in the
2214
+ * tool the range's start information is used to position the cursor. So
2215
+ * the range usually spans more than the actual symbol's name and does
2216
+ * normally include things like visibility modifiers.
2217
+ *
2218
+ * The range doesn't have to denote a node range in the sense of an abstract
2219
+ * syntax tree. It can therefore not be used to re-construct a hierarchy of
2220
+ * the symbols.
2221
+ */
2222
+ location: Location;
2223
+ }
2224
+ export declare namespace SymbolInformation {
2225
+ /**
2226
+ * Creates a new symbol information literal.
2227
+ *
2228
+ * @param name The name of the symbol.
2229
+ * @param kind The kind of the symbol.
2230
+ * @param range The range of the location of the symbol.
2231
+ * @param uri The resource of the location of symbol.
2232
+ * @param containerName The name of the symbol containing the symbol.
2233
+ */
2234
+ function create(name: string, kind: SymbolKind, range: Range, uri: DocumentUri, containerName?: string): SymbolInformation;
2235
+ }
2236
+ /**
2237
+ * Location with only uri and does not include range.
2238
+ *
2239
+ * @since 3.18.0
2240
+ */
2241
+ export type LocationUriOnly = {
2242
+ uri: DocumentUri;
2243
+ };
2244
+ /**
2245
+ * A special workspace symbol that supports locations without a range.
2246
+ *
2247
+ * See also SymbolInformation.
2248
+ *
2249
+ * @since 3.17.0
2250
+ */
2251
+ export interface WorkspaceSymbol extends BaseSymbolInformation {
2252
+ /**
2253
+ * The location of the symbol. Whether a server is allowed to
2254
+ * return a location without a range depends on the client
2255
+ * capability `workspace.symbol.resolveSupport`.
2256
+ *
2257
+ * See SymbolInformation#location for more details.
2258
+ */
2259
+ location: Location | LocationUriOnly;
2260
+ /**
2261
+ * A data entry field that is preserved on a workspace symbol between a
2262
+ * workspace symbol request and a workspace symbol resolve request.
2263
+ */
2264
+ data?: LSPAny;
2265
+ }
2266
+ export declare namespace WorkspaceSymbol {
2267
+ /**
2268
+ * Create a new workspace symbol.
2269
+ *
2270
+ * @param name The name of the symbol.
2271
+ * @param kind The kind of the symbol.
2272
+ * @param uri The resource of the location of the symbol.
2273
+ * @param range An options range of the location.
2274
+ * @returns A WorkspaceSymbol.
2275
+ */
2276
+ function create(name: string, kind: SymbolKind, uri: DocumentUri, range?: Range): WorkspaceSymbol;
2277
+ }
2278
+ /**
2279
+ * Represents programming constructs like variables, classes, interfaces etc.
2280
+ * that appear in a document. Document symbols can be hierarchical and they
2281
+ * have two ranges: one that encloses its definition and one that points to
2282
+ * its most interesting range, e.g. the range of an identifier.
2283
+ */
2284
+ export interface DocumentSymbol {
2285
+ /**
2286
+ * The name of this symbol. Will be displayed in the user interface and therefore must not be
2287
+ * an empty string or a string only consisting of white spaces.
2288
+ */
2289
+ name: string;
2290
+ /**
2291
+ * More detail for this symbol, e.g the signature of a function.
2292
+ */
2293
+ detail?: string;
2294
+ /**
2295
+ * The kind of this symbol.
2296
+ */
2297
+ kind: SymbolKind;
2298
+ /**
2299
+ * Tags for this document symbol.
2300
+ *
2301
+ * @since 3.16.0
2302
+ */
2303
+ tags?: SymbolTag[];
2304
+ /**
2305
+ * Indicates if this symbol is deprecated.
2306
+ *
2307
+ * @deprecated Use tags instead
2308
+ */
2309
+ deprecated?: boolean;
2310
+ /**
2311
+ * The range enclosing this symbol not including leading/trailing whitespace but everything else
2312
+ * like comments. This information is typically used to determine if the clients cursor is
2313
+ * inside the symbol to reveal in the symbol in the UI.
2314
+ */
2315
+ range: Range;
2316
+ /**
2317
+ * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
2318
+ * Must be contained by the `range`.
2319
+ */
2320
+ selectionRange: Range;
2321
+ /**
2322
+ * Children of this symbol, e.g. properties of a class.
2323
+ */
2324
+ children?: DocumentSymbol[];
2325
+ }
2326
+ export declare namespace DocumentSymbol {
2327
+ /**
2328
+ * Creates a new symbol information literal.
2329
+ *
2330
+ * @param name The name of the symbol.
2331
+ * @param detail The detail of the symbol.
2332
+ * @param kind The kind of the symbol.
2333
+ * @param range The range of the symbol.
2334
+ * @param selectionRange The selectionRange of the symbol.
2335
+ * @param children Children of the symbol.
2336
+ */
2337
+ function create(name: string, detail: string | undefined, kind: SymbolKind, range: Range, selectionRange: Range, children?: DocumentSymbol[]): DocumentSymbol;
2338
+ /**
2339
+ * Checks whether the given literal conforms to the {@link DocumentSymbol} interface.
2340
+ */
2341
+ function is(value: any): value is DocumentSymbol;
2342
+ }
2343
+ /**
2344
+ * The kind of a code action.
2345
+ *
2346
+ * Kinds are a hierarchical list of identifiers separated by `.`, e.g. `"refactor.extract.function"`.
2347
+ *
2348
+ * The set of kinds is open and client needs to announce the kinds it supports to the server during
2349
+ * initialization.
2350
+ */
2351
+ export type CodeActionKind = string;
2352
+ /**
2353
+ * A set of predefined code action kinds
2354
+ */
2355
+ export declare namespace CodeActionKind {
2356
+ /**
2357
+ * Empty kind.
2358
+ */
2359
+ const Empty: '';
2360
+ /**
2361
+ * Base kind for quickfix actions: 'quickfix'
2362
+ */
2363
+ const QuickFix: 'quickfix';
2364
+ /**
2365
+ * Base kind for refactoring actions: 'refactor'
2366
+ */
2367
+ const Refactor: 'refactor';
2368
+ /**
2369
+ * Base kind for refactoring extraction actions: 'refactor.extract'
2370
+ *
2371
+ * Example extract actions:
2372
+ *
2373
+ * - Extract method
2374
+ * - Extract function
2375
+ * - Extract variable
2376
+ * - Extract interface from class
2377
+ * - ...
2378
+ */
2379
+ const RefactorExtract: 'refactor.extract';
2380
+ /**
2381
+ * Base kind for refactoring inline actions: 'refactor.inline'
2382
+ *
2383
+ * Example inline actions:
2384
+ *
2385
+ * - Inline function
2386
+ * - Inline variable
2387
+ * - Inline constant
2388
+ * - ...
2389
+ */
2390
+ const RefactorInline: 'refactor.inline';
2391
+ /**
2392
+ * Base kind for refactoring move actions: `refactor.move`
2393
+ *
2394
+ * Example move actions:
2395
+ *
2396
+ * - Move a function to a new file
2397
+ * - Move a property between classes
2398
+ * - Move method to base class
2399
+ * - ...
2400
+ *
2401
+ * @since 3.18.0
2402
+ */
2403
+ const RefactorMove: 'refactor.move';
2404
+ /**
2405
+ * Base kind for refactoring rewrite actions: 'refactor.rewrite'
2406
+ *
2407
+ * Example rewrite actions:
2408
+ *
2409
+ * - Convert JavaScript function to class
2410
+ * - Add or remove parameter
2411
+ * - Encapsulate field
2412
+ * - Make method static
2413
+ * - Move method to base class
2414
+ * - ...
2415
+ */
2416
+ const RefactorRewrite: 'refactor.rewrite';
2417
+ /**
2418
+ * Base kind for source actions: `source`
2419
+ *
2420
+ * Source code actions apply to the entire file.
2421
+ */
2422
+ const Source: 'source';
2423
+ /**
2424
+ * Base kind for an organize imports source action: `source.organizeImports`
2425
+ */
2426
+ const SourceOrganizeImports: 'source.organizeImports';
2427
+ /**
2428
+ * Base kind for auto-fix source actions: `source.fixAll`.
2429
+ *
2430
+ * Fix all actions automatically fix errors that have a clear fix that do not require user input.
2431
+ * They should not suppress errors or perform unsafe fixes such as generating new types or classes.
2432
+ *
2433
+ * @since 3.15.0
2434
+ */
2435
+ const SourceFixAll: 'source.fixAll';
2436
+ /**
2437
+ * Base kind for all code actions applying to the entire notebook's scope. CodeActionKinds using
2438
+ * this should always begin with `notebook.`
2439
+ *
2440
+ * @since 3.18.0
2441
+ */
2442
+ const Notebook: 'notebook';
2443
+ }
2444
+ /**
2445
+ * The reason why code actions were requested.
2446
+ *
2447
+ * @since 3.17.0
2448
+ */
2449
+ export declare namespace CodeActionTriggerKind {
2450
+ /**
2451
+ * Code actions were explicitly requested by the user or by an extension.
2452
+ */
2453
+ const Invoked: 1;
2454
+ /**
2455
+ * Code actions were requested automatically.
2456
+ *
2457
+ * This typically happens when current selection in a file changes, but can
2458
+ * also be triggered when file content changes.
2459
+ */
2460
+ const Automatic: 2;
2461
+ }
2462
+ export type CodeActionTriggerKind = 1 | 2;
2463
+ /**
2464
+ * Contains additional diagnostic information about the context in which
2465
+ * a {@link CodeActionProvider.provideCodeActions code action} is run.
2466
+ */
2467
+ export interface CodeActionContext {
2468
+ /**
2469
+ * An array of diagnostics known on the client side overlapping the range provided to the
2470
+ * `textDocument/codeAction` request. They are provided so that the server knows which
2471
+ * errors are currently presented to the user for the given range. There is no guarantee
2472
+ * that these accurately reflect the error state of the resource. The primary parameter
2473
+ * to compute code actions is the provided range.
2474
+ */
2475
+ diagnostics: Diagnostic[];
2476
+ /**
2477
+ * Requested kind of actions to return.
2478
+ *
2479
+ * Actions not of this kind are filtered out by the client before being shown. So servers
2480
+ * can omit computing them.
2481
+ */
2482
+ only?: CodeActionKind[];
2483
+ /**
2484
+ * The reason why code actions were requested.
2485
+ *
2486
+ * @since 3.17.0
2487
+ */
2488
+ triggerKind?: CodeActionTriggerKind;
2489
+ }
2490
+ /**
2491
+ * The CodeActionContext namespace provides helper functions to work with
2492
+ * {@link CodeActionContext} literals.
2493
+ */
2494
+ export declare namespace CodeActionContext {
2495
+ /**
2496
+ * Creates a new CodeActionContext literal.
2497
+ */
2498
+ function create(diagnostics: Diagnostic[], only?: CodeActionKind[], triggerKind?: CodeActionTriggerKind): CodeActionContext;
2499
+ /**
2500
+ * Checks whether the given literal conforms to the {@link CodeActionContext} interface.
2501
+ */
2502
+ function is(value: any): value is CodeActionContext;
2503
+ }
2504
+ /**
2505
+ * Captures why the code action is currently disabled.
2506
+ *
2507
+ * @since 3.18.0
2508
+ */
2509
+ export type CodeActionDisabled = {
2510
+ /**
2511
+ * Human readable description of why the code action is currently disabled.
2512
+ *
2513
+ * This is displayed in the code actions UI.
2514
+ */
2515
+ reason: string;
2516
+ };
2517
+ /**
2518
+ * Code action tags are extra annotations that tweak the behavior of a code action.
2519
+ *
2520
+ * @since 3.18.0
2521
+ */
2522
+ export declare namespace CodeActionTag {
2523
+ /**
2524
+ * Marks the code action as LLM-generated.
2525
+ */
2526
+ const LLMGenerated = 1;
2527
+ /**
2528
+ * Checks whether the given literal conforms to the {@link CodeActionTag} interface.
2529
+ */
2530
+ function is(value: any): value is CodeActionTag;
2531
+ }
2532
+ export type CodeActionTag = 1;
2533
+ /**
2534
+ * A code action represents a change that can be performed in code, e.g. to fix a problem or
2535
+ * to refactor code.
2536
+ *
2537
+ * A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.
2538
+ */
2539
+ export interface CodeAction {
2540
+ /**
2541
+ * A short, human-readable, title for this code action.
2542
+ */
2543
+ title: string;
2544
+ /**
2545
+ * The kind of the code action.
2546
+ *
2547
+ * Used to filter code actions.
2548
+ */
2549
+ kind?: CodeActionKind;
2550
+ /**
2551
+ * The diagnostics that this code action resolves.
2552
+ */
2553
+ diagnostics?: Diagnostic[];
2554
+ /**
2555
+ * Marks this as a preferred action. Preferred actions are used by the `auto fix` command and can be targeted
2556
+ * by keybindings.
2557
+ *
2558
+ * A quick fix should be marked preferred if it properly addresses the underlying error.
2559
+ * A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
2560
+ *
2561
+ * @since 3.15.0
2562
+ */
2563
+ isPreferred?: boolean;
2564
+ /**
2565
+ * Marks that the code action cannot currently be applied.
2566
+ *
2567
+ * Clients should follow the following guidelines regarding disabled code actions:
2568
+ *
2569
+ * - Disabled code actions are not shown in automatic [lightbulbs](https://code.visualstudio.com/docs/editor/editingevolved#_code-action)
2570
+ * code action menus.
2571
+ *
2572
+ * - Disabled actions are shown as faded out in the code action menu when the user requests a more specific type
2573
+ * of code action, such as refactorings.
2574
+ *
2575
+ * - If the user has a [keybinding](https://code.visualstudio.com/docs/editor/refactoring#_keybindings-for-code-actions)
2576
+ * that auto applies a code action and only disabled code actions are returned, the client should show the user an
2577
+ * error message with `reason` in the editor.
2578
+ *
2579
+ * @since 3.16.0
2580
+ */
2581
+ disabled?: CodeActionDisabled;
2582
+ /**
2583
+ * The workspace edit this code action performs.
2584
+ */
2585
+ edit?: WorkspaceEdit;
2586
+ /**
2587
+ * A command this code action executes. If a code action
2588
+ * provides an edit and a command, first the edit is
2589
+ * executed and then the command.
2590
+ */
2591
+ command?: Command;
2592
+ /**
2593
+ * A data entry field that is preserved on a code action between
2594
+ * a `textDocument/codeAction` and a `codeAction/resolve` request.
2595
+ *
2596
+ * @since 3.16.0
2597
+ */
2598
+ data?: LSPAny;
2599
+ /**
2600
+ * Tags for this code action.
2601
+ *
2602
+ * @since 3.18.0
2603
+ */
2604
+ tags?: CodeActionTag[];
2605
+ }
2606
+ export declare namespace CodeAction {
2607
+ /**
2608
+ * Creates a new code action.
2609
+ *
2610
+ * @param title The title of the code action.
2611
+ * @param kind The kind of the code action.
2612
+ */
2613
+ function create(title: string, kind?: CodeActionKind): CodeAction;
2614
+ /**
2615
+ * Creates a new code action.
2616
+ *
2617
+ * @param title The title of the code action.
2618
+ * @param command The command to execute.
2619
+ * @param kind The kind of the code action.
2620
+ */
2621
+ function create(title: string, command: Command, kind?: CodeActionKind): CodeAction;
2622
+ /**
2623
+ * Creates a new code action.
2624
+ *
2625
+ * @param title The title of the code action.
2626
+ * @param edit The edit to perform.
2627
+ * @param kind The kind of the code action.
2628
+ */
2629
+ function create(title: string, edit: WorkspaceEdit, kind?: CodeActionKind): CodeAction;
2630
+ function is(value: any): value is CodeAction;
2631
+ }
2632
+ /**
2633
+ * A code lens represents a {@link Command command} that should be shown along with
2634
+ * source text, like the number of references, a way to run tests, etc.
2635
+ *
2636
+ * A code lens is _unresolved_ when no command is associated to it. For performance
2637
+ * reasons the creation of a code lens and resolving should be done in two stages.
2638
+ */
2639
+ export interface CodeLens {
2640
+ /**
2641
+ * The range in which this code lens is valid. Should only span a single line.
2642
+ */
2643
+ range: Range;
2644
+ /**
2645
+ * The command this code lens represents.
2646
+ */
2647
+ command?: Command;
2648
+ /**
2649
+ * A data entry field that is preserved on a code lens item between
2650
+ * a {@link CodeLensRequest} and a {@link CodeLensResolveRequest}
2651
+ */
2652
+ data?: LSPAny;
2653
+ }
2654
+ /**
2655
+ * The CodeLens namespace provides helper functions to work with
2656
+ * {@link CodeLens} literals.
2657
+ */
2658
+ export declare namespace CodeLens {
2659
+ /**
2660
+ * Creates a new CodeLens literal.
2661
+ */
2662
+ function create(range: Range, data?: LSPAny): CodeLens;
2663
+ /**
2664
+ * Checks whether the given literal conforms to the {@link CodeLens} interface.
2665
+ */
2666
+ function is(value: any): value is CodeLens;
2667
+ }
2668
+ /**
2669
+ * Value-object describing what options formatting should use.
2670
+ */
2671
+ export interface FormattingOptions {
2672
+ /**
2673
+ * Size of a tab in spaces.
2674
+ */
2675
+ tabSize: uinteger;
2676
+ /**
2677
+ * Prefer spaces over tabs.
2678
+ */
2679
+ insertSpaces: boolean;
2680
+ /**
2681
+ * Trim trailing whitespace on a line.
2682
+ *
2683
+ * @since 3.15.0
2684
+ */
2685
+ trimTrailingWhitespace?: boolean;
2686
+ /**
2687
+ * Insert a newline character at the end of the file if one does not exist.
2688
+ *
2689
+ * @since 3.15.0
2690
+ */
2691
+ insertFinalNewline?: boolean;
2692
+ /**
2693
+ * Trim all newlines after the final newline at the end of the file.
2694
+ *
2695
+ * @since 3.15.0
2696
+ */
2697
+ trimFinalNewlines?: boolean;
2698
+ /**
2699
+ * Signature for further properties.
2700
+ */
2701
+ [key: string]: boolean | integer | string | undefined;
2702
+ }
2703
+ /**
2704
+ * The FormattingOptions namespace provides helper functions to work with
2705
+ * {@link FormattingOptions} literals.
2706
+ */
2707
+ export declare namespace FormattingOptions {
2708
+ /**
2709
+ * Creates a new FormattingOptions literal.
2710
+ */
2711
+ function create(tabSize: uinteger, insertSpaces: boolean): FormattingOptions;
2712
+ /**
2713
+ * Checks whether the given literal conforms to the {@link FormattingOptions} interface.
2714
+ */
2715
+ function is(value: any): value is FormattingOptions;
2716
+ }
2717
+ /**
2718
+ * A document link is a range in a text document that links to an internal or external resource, like another
2719
+ * text document or a web site.
2720
+ */
2721
+ export interface DocumentLink {
2722
+ /**
2723
+ * The range this link applies to.
2724
+ */
2725
+ range: Range;
2726
+ /**
2727
+ * The uri this link points to. If missing a resolve request is sent later.
2728
+ */
2729
+ target?: URI;
2730
+ /**
2731
+ * The tooltip text when you hover over this link.
2732
+ *
2733
+ * If a tooltip is provided, is will be displayed in a string that includes instructions on how to
2734
+ * trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
2735
+ * user settings, and localization.
2736
+ *
2737
+ * @since 3.15.0
2738
+ */
2739
+ tooltip?: string;
2740
+ /**
2741
+ * A data entry field that is preserved on a document link between a
2742
+ * DocumentLinkRequest and a DocumentLinkResolveRequest.
2743
+ */
2744
+ data?: LSPAny;
2745
+ }
2746
+ /**
2747
+ * The DocumentLink namespace provides helper functions to work with
2748
+ * {@link DocumentLink} literals.
2749
+ */
2750
+ export declare namespace DocumentLink {
2751
+ /**
2752
+ * Creates a new DocumentLink literal.
2753
+ */
2754
+ function create(range: Range, target?: string, data?: LSPAny): DocumentLink;
2755
+ /**
2756
+ * Checks whether the given literal conforms to the {@link DocumentLink} interface.
2757
+ */
2758
+ function is(value: any): value is DocumentLink;
2759
+ }
2760
+ /**
2761
+ * A selection range represents a part of a selection hierarchy. A selection range
2762
+ * may have a parent selection range that contains it.
2763
+ */
2764
+ export interface SelectionRange {
2765
+ /**
2766
+ * The {@link Range range} of this selection range.
2767
+ */
2768
+ range: Range;
2769
+ /**
2770
+ * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
2771
+ */
2772
+ parent?: SelectionRange;
2773
+ }
2774
+ /**
2775
+ * The SelectionRange namespace provides helper function to work with
2776
+ * SelectionRange literals.
2777
+ */
2778
+ export declare namespace SelectionRange {
2779
+ /**
2780
+ * Creates a new SelectionRange
2781
+ * @param range the range.
2782
+ * @param parent an optional parent.
2783
+ */
2784
+ function create(range: Range, parent?: SelectionRange): SelectionRange;
2785
+ function is(value: any): value is SelectionRange;
2786
+ }
2787
+ /**
2788
+ * Represents programming constructs like functions or constructors in the context
2789
+ * of call hierarchy.
2790
+ *
2791
+ * @since 3.16.0
2792
+ */
2793
+ export interface CallHierarchyItem {
2794
+ /**
2795
+ * The name of this item.
2796
+ */
2797
+ name: string;
2798
+ /**
2799
+ * The kind of this item.
2800
+ */
2801
+ kind: SymbolKind;
2802
+ /**
2803
+ * Tags for this item.
2804
+ */
2805
+ tags?: SymbolTag[];
2806
+ /**
2807
+ * More detail for this item, e.g. the signature of a function.
2808
+ */
2809
+ detail?: string;
2810
+ /**
2811
+ * The resource identifier of this item.
2812
+ */
2813
+ uri: DocumentUri;
2814
+ /**
2815
+ * The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
2816
+ */
2817
+ range: Range;
2818
+ /**
2819
+ * The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function.
2820
+ * Must be contained by the {@link CallHierarchyItem.range `range`}.
2821
+ */
2822
+ selectionRange: Range;
2823
+ /**
2824
+ * A data entry field that is preserved between a call hierarchy prepare and
2825
+ * incoming calls or outgoing calls requests.
2826
+ */
2827
+ data?: LSPAny;
2828
+ }
2829
+ /**
2830
+ * Represents an incoming call, e.g. a caller of a method or constructor.
2831
+ *
2832
+ * @since 3.16.0
2833
+ */
2834
+ export interface CallHierarchyIncomingCall {
2835
+ /**
2836
+ * The item that makes the call.
2837
+ */
2838
+ from: CallHierarchyItem;
2839
+ /**
2840
+ * The ranges at which the calls appear. This is relative to the caller
2841
+ * denoted by {@link CallHierarchyIncomingCall.from `this.from`}.
2842
+ */
2843
+ fromRanges: Range[];
2844
+ }
2845
+ /**
2846
+ * Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.
2847
+ *
2848
+ * @since 3.16.0
2849
+ */
2850
+ export interface CallHierarchyOutgoingCall {
2851
+ /**
2852
+ * The item that is called.
2853
+ */
2854
+ to: CallHierarchyItem;
2855
+ /**
2856
+ * The range at which this item is called. This is the range relative to the caller, e.g the item
2857
+ * passed to {@link CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls `provideCallHierarchyOutgoingCalls`}
2858
+ * and not {@link CallHierarchyOutgoingCall.to `this.to`}.
2859
+ */
2860
+ fromRanges: Range[];
2861
+ }
2862
+ /**
2863
+ * A set of predefined token types. This set is not fixed
2864
+ * an clients can specify additional token types via the
2865
+ * corresponding client capabilities.
2866
+ *
2867
+ * @since 3.16.0
2868
+ */
2869
+ export declare enum SemanticTokenTypes {
2870
+ namespace = "namespace",
2871
+ /**
2872
+ * Represents a generic type. Acts as a fallback for types which can't be mapped to
2873
+ * a specific type like class or enum.
2874
+ */
2875
+ type = "type",
2876
+ class = "class",
2877
+ enum = "enum",
2878
+ interface = "interface",
2879
+ struct = "struct",
2880
+ typeParameter = "typeParameter",
2881
+ parameter = "parameter",
2882
+ variable = "variable",
2883
+ property = "property",
2884
+ enumMember = "enumMember",
2885
+ event = "event",
2886
+ function = "function",
2887
+ method = "method",
2888
+ macro = "macro",
2889
+ keyword = "keyword",
2890
+ modifier = "modifier",
2891
+ comment = "comment",
2892
+ string = "string",
2893
+ number = "number",
2894
+ regexp = "regexp",
2895
+ operator = "operator",
2896
+ /**
2897
+ * @since 3.17.0
2898
+ */
2899
+ decorator = "decorator",
2900
+ /**
2901
+ * @since 3.18.0
2902
+ */
2903
+ label = "label"
2904
+ }
2905
+ /**
2906
+ * A set of predefined token modifiers. This set is not fixed
2907
+ * an clients can specify additional token types via the
2908
+ * corresponding client capabilities.
2909
+ *
2910
+ * @since 3.16.0
2911
+ */
2912
+ export declare enum SemanticTokenModifiers {
2913
+ declaration = "declaration",
2914
+ definition = "definition",
2915
+ readonly = "readonly",
2916
+ static = "static",
2917
+ deprecated = "deprecated",
2918
+ abstract = "abstract",
2919
+ async = "async",
2920
+ modification = "modification",
2921
+ documentation = "documentation",
2922
+ defaultLibrary = "defaultLibrary"
2923
+ }
2924
+ /**
2925
+ * @since 3.16.0
2926
+ */
2927
+ export interface SemanticTokensLegend {
2928
+ /**
2929
+ * The token types a server uses.
2930
+ */
2931
+ tokenTypes: string[];
2932
+ /**
2933
+ * The token modifiers a server uses.
2934
+ */
2935
+ tokenModifiers: string[];
2936
+ }
2937
+ /**
2938
+ * @since 3.16.0
2939
+ */
2940
+ export interface SemanticTokens {
2941
+ /**
2942
+ * An optional result id. If provided and clients support delta updating
2943
+ * the client will include the result id in the next semantic token request.
2944
+ * A server can then instead of computing all semantic tokens again simply
2945
+ * send a delta.
2946
+ */
2947
+ resultId?: string;
2948
+ /**
2949
+ * The actual tokens.
2950
+ */
2951
+ data: uinteger[];
2952
+ }
2953
+ /**
2954
+ * @since 3.16.0
2955
+ */
2956
+ export declare namespace SemanticTokens {
2957
+ function is(value: any): value is SemanticTokens;
2958
+ }
2959
+ /**
2960
+ * @since 3.16.0
2961
+ */
2962
+ export interface SemanticTokensEdit {
2963
+ /**
2964
+ * The start offset of the edit.
2965
+ */
2966
+ start: uinteger;
2967
+ /**
2968
+ * The count of elements to remove.
2969
+ */
2970
+ deleteCount: uinteger;
2971
+ /**
2972
+ * The elements to insert.
2973
+ */
2974
+ data?: uinteger[];
2975
+ }
2976
+ /**
2977
+ * @since 3.16.0
2978
+ */
2979
+ export interface SemanticTokensDelta {
2980
+ readonly resultId?: string;
2981
+ /**
2982
+ * The semantic token edits to transform a previous result into a new result.
2983
+ */
2984
+ edits: SemanticTokensEdit[];
2985
+ }
2986
+ /**
2987
+ * @since 3.17.0
2988
+ */
2989
+ export type TypeHierarchyItem = {
2990
+ /**
2991
+ * The name of this item.
2992
+ */
2993
+ name: string;
2994
+ /**
2995
+ * The kind of this item.
2996
+ */
2997
+ kind: SymbolKind;
2998
+ /**
2999
+ * Tags for this item.
3000
+ */
3001
+ tags?: SymbolTag[];
3002
+ /**
3003
+ * More detail for this item, e.g. the signature of a function.
3004
+ */
3005
+ detail?: string;
3006
+ /**
3007
+ * The resource identifier of this item.
3008
+ */
3009
+ uri: DocumentUri;
3010
+ /**
3011
+ * The range enclosing this symbol not including leading/trailing whitespace
3012
+ * but everything else, e.g. comments and code.
3013
+ */
3014
+ range: Range;
3015
+ /**
3016
+ * The range that should be selected and revealed when this symbol is being
3017
+ * picked, e.g. the name of a function. Must be contained by the
3018
+ * {@link TypeHierarchyItem.range `range`}.
3019
+ */
3020
+ selectionRange: Range;
3021
+ /**
3022
+ * A data entry field that is preserved between a type hierarchy prepare and
3023
+ * supertypes or subtypes requests. It could also be used to identify the
3024
+ * type hierarchy in the server, helping improve the performance on
3025
+ * resolving supertypes and subtypes.
3026
+ */
3027
+ data?: LSPAny;
3028
+ };
3029
+ /**
3030
+ * Returns inline value information as the complete text to be shown.
3031
+ *
3032
+ * @since 3.17.0
3033
+ */
3034
+ export type InlineValueText = {
3035
+ /**
3036
+ * The document range for which the inline value applies.
3037
+ */
3038
+ range: Range;
3039
+ /**
3040
+ * The text of the inline value.
3041
+ */
3042
+ text: string;
3043
+ };
3044
+ /**
3045
+ * The InlineValueText namespace provides functions to deal with InlineValueTexts.
3046
+ *
3047
+ * @since 3.17.0
3048
+ */
3049
+ export declare namespace InlineValueText {
3050
+ /**
3051
+ * Creates a new InlineValueText literal.
3052
+ */
3053
+ function create(range: Range, text: string): InlineValueText;
3054
+ function is(value: InlineValue | undefined | null): value is InlineValueText;
3055
+ }
3056
+ /**
3057
+ * To compute inline value through a variable lookup.
3058
+ *
3059
+ * If only a range is specified, the variable name should
3060
+ * be extracted from the underlying document.
3061
+ *
3062
+ * An optional variable name could be used to lookup instead
3063
+ * of the extracted name.
3064
+ *
3065
+ * @since 3.17.0
3066
+ */
3067
+ export type InlineValueVariableLookup = {
3068
+ /**
3069
+ * The document range for which the inline value applies.
3070
+ *
3071
+ * The range could be used to extract the variable name
3072
+ * from the underlying document.
3073
+ */
3074
+ range: Range;
3075
+ /**
3076
+ * If specified the name of the variable to look up.
3077
+ */
3078
+ variableName?: string;
3079
+ /**
3080
+ * How to perform the lookup.
3081
+ */
3082
+ caseSensitiveLookup: boolean;
3083
+ };
3084
+ /**
3085
+ * The InlineValueVariableLookup namespace provides functions to
3086
+ * deal with InlineValueVariableLookups.
3087
+ *
3088
+ * @since 3.17.0
3089
+ */
3090
+ export declare namespace InlineValueVariableLookup {
3091
+ /**
3092
+ * Creates a new InlineValueText literal.
3093
+ */
3094
+ function create(range: Range, variableName: string | undefined, caseSensitiveLookup: boolean): InlineValueVariableLookup;
3095
+ function is(value: InlineValue | undefined | null): value is InlineValueVariableLookup;
3096
+ }
3097
+ /**
3098
+ * To compute an inline value through an expression evaluation.
3099
+ *
3100
+ * If only a range is specified, the expression should be
3101
+ * extracted from the underlying document.
3102
+ *
3103
+ * An optional expression could be evaluated instead of
3104
+ * the extracted expression.
3105
+ *
3106
+ * @since 3.17.0
3107
+ */
3108
+ export type InlineValueEvaluatableExpression = {
3109
+ /**
3110
+ * The document range for which the inline value applies.
3111
+ *
3112
+ * The range could be used to extract the evaluatable expression
3113
+ * from the underlying document.
3114
+ */
3115
+ range: Range;
3116
+ /**
3117
+ * If specified the expression could be evaluated instead.
3118
+ */
3119
+ expression?: string;
3120
+ };
3121
+ /**
3122
+ * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.
3123
+ *
3124
+ * @since 3.17.0
3125
+ */
3126
+ export declare namespace InlineValueEvaluatableExpression {
3127
+ /**
3128
+ * Creates a new InlineValueEvaluatableExpression literal.
3129
+ */
3130
+ function create(range: Range, expression: string | undefined): InlineValueEvaluatableExpression;
3131
+ function is(value: InlineValue | undefined | null): value is InlineValueEvaluatableExpression;
3132
+ }
3133
+ /**
3134
+ * Inline value information can be provided by different means:
3135
+ * - directly as a text value (class InlineValueText).
3136
+ * - as a name to use for a variable lookup (class InlineValueVariableLookup)
3137
+ * - as an evaluatable expression (class InlineValueEvaluatableExpression)
3138
+ * The InlineValue types combines all inline value types into one type.
3139
+ *
3140
+ * @since 3.17.0
3141
+ */
3142
+ export type InlineValue = InlineValueText | InlineValueVariableLookup | InlineValueEvaluatableExpression;
3143
+ /**
3144
+ * @since 3.17.0
3145
+ */
3146
+ export type InlineValueContext = {
3147
+ /**
3148
+ * The stack frame (as a DAP Id) where the execution has stopped.
3149
+ */
3150
+ frameId: integer;
3151
+ /**
3152
+ * The document range where execution has stopped.
3153
+ * Typically the end position of the range denotes the line where the inline values are shown.
3154
+ */
3155
+ stoppedLocation: Range;
3156
+ };
3157
+ /**
3158
+ * The InlineValueContext namespace provides helper functions to work with
3159
+ * {@link InlineValueContext} literals.
3160
+ *
3161
+ * @since 3.17.0
3162
+ */
3163
+ export declare namespace InlineValueContext {
3164
+ /**
3165
+ * Creates a new InlineValueContext literal.
3166
+ */
3167
+ function create(frameId: integer, stoppedLocation: Range): InlineValueContext;
3168
+ /**
3169
+ * Checks whether the given literal conforms to the {@link InlineValueContext} interface.
3170
+ */
3171
+ function is(value: any): value is InlineValueContext;
3172
+ }
3173
+ /**
3174
+ * Inlay hint kinds.
3175
+ *
3176
+ * @since 3.17.0
3177
+ */
3178
+ export declare namespace InlayHintKind {
3179
+ /**
3180
+ * An inlay hint that for a type annotation.
3181
+ */
3182
+ const Type = 1;
3183
+ /**
3184
+ * An inlay hint that is for a parameter.
3185
+ */
3186
+ const Parameter = 2;
3187
+ function is(value: number): value is InlayHintKind;
3188
+ }
3189
+ export type InlayHintKind = 1 | 2;
3190
+ /**
3191
+ * An inlay hint label part allows for interactive and composite labels
3192
+ * of inlay hints.
3193
+ *
3194
+ * @since 3.17.0
3195
+ */
3196
+ export type InlayHintLabelPart = {
3197
+ /**
3198
+ * The value of this label part.
3199
+ */
3200
+ value: string;
3201
+ /**
3202
+ * The tooltip text when you hover over this label part. Depending on
3203
+ * the client capability `inlayHint.resolveSupport` clients might resolve
3204
+ * this property late using the resolve request.
3205
+ */
3206
+ tooltip?: string | MarkupContent;
3207
+ /**
3208
+ * An optional source code location that represents this
3209
+ * label part.
3210
+ *
3211
+ * The editor will use this location for the hover and for code navigation
3212
+ * features: This part will become a clickable link that resolves to the
3213
+ * definition of the symbol at the given location (not necessarily the
3214
+ * location itself), it shows the hover that shows at the given location,
3215
+ * and it shows a context menu with further code navigation commands.
3216
+ *
3217
+ * Depending on the client capability `inlayHint.resolveSupport` clients
3218
+ * might resolve this property late using the resolve request.
3219
+ */
3220
+ location?: Location;
3221
+ /**
3222
+ * An optional command for this label part.
3223
+ *
3224
+ * Depending on the client capability `inlayHint.resolveSupport` clients
3225
+ * might resolve this property late using the resolve request.
3226
+ */
3227
+ command?: Command;
3228
+ };
3229
+ export declare namespace InlayHintLabelPart {
3230
+ function create(value: string): InlayHintLabelPart;
3231
+ function is(value: any): value is InlayHintLabelPart;
3232
+ }
3233
+ /**
3234
+ * Inlay hint information.
3235
+ *
3236
+ * @since 3.17.0
3237
+ */
3238
+ export type InlayHint = {
3239
+ /**
3240
+ * The position of this hint.
3241
+ *
3242
+ * If multiple hints have the same position, they will be shown in the order
3243
+ * they appear in the response.
3244
+ */
3245
+ position: Position;
3246
+ /**
3247
+ * The label of this hint. A human readable string or an array of
3248
+ * InlayHintLabelPart label parts.
3249
+ *
3250
+ * *Note* that neither the string nor the label part can be empty.
3251
+ */
3252
+ label: string | InlayHintLabelPart[];
3253
+ /**
3254
+ * The kind of this hint. Can be omitted in which case the client
3255
+ * should fall back to a reasonable default.
3256
+ */
3257
+ kind?: InlayHintKind;
3258
+ /**
3259
+ * Optional text edits that are performed when accepting this inlay hint.
3260
+ *
3261
+ * *Note* that edits are expected to change the document so that the inlay
3262
+ * hint (or its nearest variant) is now part of the document and the inlay
3263
+ * hint itself is now obsolete.
3264
+ */
3265
+ textEdits?: TextEdit[];
3266
+ /**
3267
+ * The tooltip text when you hover over this item.
3268
+ */
3269
+ tooltip?: string | MarkupContent;
3270
+ /**
3271
+ * Render padding before the hint.
3272
+ *
3273
+ * Note: Padding should use the editor's background color, not the
3274
+ * background color of the hint itself. That means padding can be used
3275
+ * to visually align/separate an inlay hint.
3276
+ */
3277
+ paddingLeft?: boolean;
3278
+ /**
3279
+ * Render padding after the hint.
3280
+ *
3281
+ * Note: Padding should use the editor's background color, not the
3282
+ * background color of the hint itself. That means padding can be used
3283
+ * to visually align/separate an inlay hint.
3284
+ */
3285
+ paddingRight?: boolean;
3286
+ /**
3287
+ * A data entry field that is preserved on an inlay hint between
3288
+ * a `textDocument/inlayHint` and a `inlayHint/resolve` request.
3289
+ */
3290
+ data?: LSPAny;
3291
+ };
3292
+ export declare namespace InlayHint {
3293
+ function create(position: Position, label: string | InlayHintLabelPart[], kind?: InlayHintKind): InlayHint;
3294
+ function is(value: any): value is InlayHint;
3295
+ }
3296
+ /**
3297
+ * A string value used as a snippet is a template which allows to insert text
3298
+ * and to control the editor cursor when insertion happens.
3299
+ *
3300
+ * A snippet can define tab stops and placeholders with `$1`, `$2`
3301
+ * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
3302
+ * the end of the snippet. Variables are defined with `$name` and
3303
+ * `${name:default value}`.
3304
+ *
3305
+ * @since 3.18.0
3306
+ */
3307
+ export type StringValue = {
3308
+ /**
3309
+ * The kind of string value.
3310
+ */
3311
+ kind: 'snippet';
3312
+ /**
3313
+ * The snippet string.
3314
+ */
3315
+ value: string;
3316
+ };
3317
+ export declare namespace StringValue {
3318
+ function createSnippet(value: string): StringValue;
3319
+ function isSnippet(value: any): value is StringValue;
3320
+ }
3321
+ /**
3322
+ * An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.
3323
+ *
3324
+ * @since 3.18.0
3325
+ */
3326
+ export interface InlineCompletionItem {
3327
+ /**
3328
+ * The text to replace the range with. Must be set.
3329
+ */
3330
+ insertText: string | StringValue;
3331
+ /**
3332
+ * A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used.
3333
+ */
3334
+ filterText?: string;
3335
+ /**
3336
+ * The range to replace. Must begin and end on the same line.
3337
+ */
3338
+ range?: Range;
3339
+ /**
3340
+ * An optional {@link Command} that is executed *after* inserting this completion.
3341
+ */
3342
+ command?: Command;
3343
+ }
3344
+ export declare namespace InlineCompletionItem {
3345
+ function create(insertText: string | StringValue, filterText?: string, range?: Range, command?: Command): InlineCompletionItem;
3346
+ }
3347
+ /**
3348
+ * Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor.
3349
+ *
3350
+ * @since 3.18.0
3351
+ */
3352
+ export interface InlineCompletionList {
3353
+ /**
3354
+ * The inline completion items
3355
+ */
3356
+ items: InlineCompletionItem[];
3357
+ }
3358
+ export declare namespace InlineCompletionList {
3359
+ function create(items: InlineCompletionItem[]): InlineCompletionList;
3360
+ }
3361
+ /**
3362
+ * Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
3363
+ *
3364
+ * @since 3.18.0
3365
+ */
3366
+ export declare namespace InlineCompletionTriggerKind {
3367
+ /**
3368
+ * Completion was triggered explicitly by a user gesture.
3369
+ */
3370
+ const Invoked: 1;
3371
+ /**
3372
+ * Completion was triggered automatically while editing.
3373
+ */
3374
+ const Automatic: 2;
3375
+ }
3376
+ export type InlineCompletionTriggerKind = 1 | 2;
3377
+ /**
3378
+ * Describes the currently selected completion item.
3379
+ *
3380
+ * @since 3.18.0
3381
+ */
3382
+ export type SelectedCompletionInfo = {
3383
+ /**
3384
+ * The range that will be replaced if this completion item is accepted.
3385
+ */
3386
+ range: Range;
3387
+ /**
3388
+ * The text the range will be replaced with if this completion is accepted.
3389
+ */
3390
+ text: string;
3391
+ };
3392
+ export declare namespace SelectedCompletionInfo {
3393
+ function create(range: Range, text: string): SelectedCompletionInfo;
3394
+ }
3395
+ /**
3396
+ * Provides information about the context in which an inline completion was requested.
3397
+ *
3398
+ * @since 3.18.0
3399
+ */
3400
+ export type InlineCompletionContext = {
3401
+ /**
3402
+ * Describes how the inline completion was triggered.
3403
+ */
3404
+ triggerKind: InlineCompletionTriggerKind;
3405
+ /**
3406
+ * Provides information about the currently selected item in the autocomplete widget if it is visible.
3407
+ */
3408
+ selectedCompletionInfo?: SelectedCompletionInfo;
3409
+ };
3410
+ export declare namespace InlineCompletionContext {
3411
+ function create(triggerKind: InlineCompletionTriggerKind, selectedCompletionInfo?: SelectedCompletionInfo): InlineCompletionContext;
3412
+ }
3413
+ /**
3414
+ * A workspace folder inside a client.
3415
+ */
3416
+ export interface WorkspaceFolder {
3417
+ /**
3418
+ * The associated URI for this workspace folder.
3419
+ */
3420
+ uri: URI;
3421
+ /**
3422
+ * The name of the workspace folder. Used to refer to this
3423
+ * workspace folder in the user interface.
3424
+ */
3425
+ name: string;
3426
+ }
3427
+ export declare namespace WorkspaceFolder {
3428
+ function is(value: any): value is WorkspaceFolder;
3429
+ }
3430
+ export declare const EOL: string[];
3431
+ /**
3432
+ * A simple text document. Not to be implemented. The document keeps the content
3433
+ * as string.
3434
+ *
3435
+ * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
3436
+ */
3437
+ export interface TextDocument {
3438
+ /**
3439
+ * The associated URI for this document. Most documents have the __file__-scheme, indicating that they
3440
+ * represent files on disk. However, some documents may have other schemes indicating that they are not
3441
+ * available on disk.
3442
+ *
3443
+ * @readonly
3444
+ */
3445
+ readonly uri: DocumentUri;
3446
+ /**
3447
+ * The identifier of the language associated with this document.
3448
+ *
3449
+ * @readonly
3450
+ */
3451
+ readonly languageId: LanguageKind;
3452
+ /**
3453
+ * The version number of this document (it will increase after each
3454
+ * change, including undo/redo).
3455
+ *
3456
+ * @readonly
3457
+ */
3458
+ readonly version: integer;
3459
+ /**
3460
+ * Get the text of this document. A substring can be retrieved by
3461
+ * providing a range.
3462
+ *
3463
+ * @param range (optional) An range within the document to return.
3464
+ * If no range is passed, the full content is returned.
3465
+ * Invalid range positions are adjusted as described in {@link Position.line Position.line}
3466
+ * and {@link Position.character Position.character}.
3467
+ * If the start range position is greater than the end range position,
3468
+ * then the effect of getText is as if the two positions were swapped.
3469
+
3470
+ * @return The text of this document or a substring of the text if a
3471
+ * range is provided.
3472
+ */
3473
+ getText(range?: Range): string;
3474
+ /**
3475
+ * Converts a zero-based offset to a position.
3476
+ *
3477
+ * @param offset A zero-based offset.
3478
+ * @return A valid {@link Position position}.
3479
+ */
3480
+ positionAt(offset: uinteger): Position;
3481
+ /**
3482
+ * Converts the position to a zero-based offset.
3483
+ * Invalid positions are adjusted as described in {@link Position.line Position.line}
3484
+ * and {@link Position.character Position.character}.
3485
+ *
3486
+ * @param position A position.
3487
+ * @return A valid zero-based offset.
3488
+ */
3489
+ offsetAt(position: Position): uinteger;
3490
+ /**
3491
+ * The number of lines in this document.
3492
+ *
3493
+ * @readonly
3494
+ */
3495
+ readonly lineCount: uinteger;
3496
+ }
3497
+ /**
3498
+ * @deprecated Use the text document from the new vscode-languageserver-textdocument package.
3499
+ */
3500
+ export declare namespace TextDocument {
3501
+ /**
3502
+ * Creates a new ITextDocument literal from the given uri and content.
3503
+ * @param uri The document's uri.
3504
+ * @param languageId The document's language Id.
3505
+ * @param version The document's version.
3506
+ * @param content The document's content.
3507
+ */
3508
+ function create(uri: DocumentUri, languageId: LanguageKind, version: integer, content: string): TextDocument;
3509
+ /**
3510
+ * Checks whether the given literal conforms to the {@link ITextDocument} interface.
3511
+ */
3512
+ function is(value: any): value is TextDocument;
3513
+ function applyEdits(document: TextDocument, edits: TextEdit[]): string;
3514
+ }
3515
+ export {};