-
-
Notifications
You must be signed in to change notification settings - Fork 958
/
Copy pathindex.d.ts
7678 lines (7007 loc) · 235 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// vim: set sw=2 ts=2 sts=2 et foldmarker={{,}} foldmethod=marker foldlevel=0 nofen:
/******************************************************************
MIT License http://www.opensource.org/licenses/mit-license.php
Author Qiming Zhao <chemzqm@gmail> (https://github.com/chemzqm)
*******************************************************************/
/// <reference types="node" />
import cp from 'child_process'
declare module 'coc.nvim' {
// Language server protocol interfaces {{
export interface Thenable<T> {
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>
// eslint-disable-next-line @typescript-eslint/unified-signatures
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>
}
export interface Disposable {
/**
* Dispose this object.
*/
dispose(): void
}
export namespace Disposable {
function create(func: () => void): Disposable
}
/**
* The declaration of a symbol representation as one or many [locations](#Location).
*/
export type Declaration = Location | Location[]
/**
* Information about where a symbol is declared.
*
* Provides additional metadata over normal [location](#Location) declarations, including the range of
* the declaring symbol.
*
* Servers should prefer returning `DeclarationLink` over `Declaration` if supported
* by the client.
*/
export type DeclarationLink = LocationLink
export type ProgressToken = number | string
export interface WorkDoneProgressBegin {
kind: 'begin'
/**
* Mandatory title of the progress operation. Used to briefly inform about
* the kind of operation being performed.
*
* Examples: "Indexing" or "Linking dependencies".
*/
title: string
/**
* Controls if a cancel button should show to allow the user to cancel the
* long running operation. Clients that don't support cancellation are allowed
* to ignore the setting.
*/
cancellable?: boolean
/**
* Optional, more detailed associated progress message. Contains
* complementary information to the `title`.
*
* Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
* If unset, the previous progress message (if any) is still valid.
*/
message?: string
/**
* Optional progress percentage to display (value 100 is considered 100%).
* If not provided infinite progress is assumed and clients are allowed
* to ignore the `percentage` value in subsequent in report notifications.
*
* The value should be steadily rising. Clients are free to ignore values
* that are not following this rule.
*/
percentage?: number
}
export interface WorkDoneProgressReport {
kind: 'report'
/**
* Controls enablement state of a cancel button. This property is only valid if a cancel
* button got requested in the `WorkDoneProgressStart` payload.
*
* Clients that don't support cancellation or don't support control the button's
* enablement state are allowed to ignore the setting.
*/
cancellable?: boolean
/**
* Optional, more detailed associated progress message. Contains
* complementary information to the `title`.
*
* Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
* If unset, the previous progress message (if any) is still valid.
*/
message?: string
/**
* Optional progress percentage to display (value 100 is considered 100%).
* If not provided infinite progress is assumed and clients are allowed
* to ignore the `percentage` value in subsequent in report notifications.
*
* The value should be steadily rising. Clients are free to ignore values
* that are not following this rule.
*/
percentage?: number
}
/**
* The file event type
*/
export namespace FileChangeType {
/**
* The file got created.
*/
const Created = 1
/**
* The file got changed.
*/
const Changed = 2
/**
* The file got deleted.
*/
const Deleted = 3
}
export type FileChangeType = 1 | 2 | 3
/**
* An event describing a file change.
*/
export interface FileEvent {
/**
* The file's uri.
*/
uri: string
/**
* The change type.
*/
type: FileChangeType
}
export interface WorkDoneProgressEnd {
kind: 'end'
/**
* Optional, a final message indicating to for example indicate the outcome
* of the operation.
*/
message?: string
}
/**
* A literal to identify a text document in the client.
*/
export interface TextDocumentIdentifier {
/**
* The text document's uri.
*/
uri: string
}
/**
* A parameter literal used in requests to pass a text document and a position inside that
* document.
*/
export interface TextDocumentPositionParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier
/**
* The position inside the text document.
*/
position: Position
}
export interface WorkspaceFolder {
/**
* The associated URI for this workspace folder.
*/
uri: string
/**
* The name of the workspace folder. Used to refer to this
* workspace folder in the user interface.
*/
name: string
}
/**
* An event describing a change to a text document.
*/
export interface TextDocumentContentChange {
/**
* The range of the document that changed.
*/
range: Range
/**
* The new text for the provided range.
*/
text: string
}
/**
* The workspace folder change event.
*/
export interface WorkspaceFoldersChangeEvent {
/**
* The array of added workspace folders
*/
added: WorkspaceFolder[]
/**
* The array of the removed workspace folders
*/
removed: WorkspaceFolder[]
}
/**
* An event that is fired when a [document](#TextDocument) will be saved.
*
* To make modifications to the document before it is being saved, call the
* [`waitUntil`](#TextDocumentWillSaveEvent.waitUntil)-function with a thenable
* that resolves to an array of [text edits](#TextEdit).
*/
export interface TextDocumentWillSaveEvent {
/**
* The document that will be saved.
*/
document: TextDocument
/**
* The reason why save was triggered.
*/
reason: 1 | 2 | 3
}
/**
* A document filter denotes a document by different properties like
* the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of
* its resource, or a glob-pattern that is applied to the [path](#TextDocument.fileName).
*
* Glob patterns can have the following syntax:
* - `*` to match one or more characters in a path segment
* - `?` to match on one character in a path segment
* - `**` to match any number of path segments, including none
* - `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
* - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
* - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
*
* @sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
* @sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`
*/
export type DocumentFilter = {
/** A language id, like `typescript`. */
language: string
/** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */
scheme?: string
/** A glob pattern, like `*.{ts,js}`. */
pattern?: string
} | {
/** A language id, like `typescript`. */
language?: string
/** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */
scheme: string
/** A glob pattern, like `*.{ts,js}`. */
pattern?: string
} | {
/** A language id, like `typescript`. */
language?: string
/** A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */
scheme?: string
/** A glob pattern, like `*.{ts,js}`. */
pattern: string
}
/**
* A document selector is the combination of one or many document filters.
*
* @sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;
*/
export type DocumentSelector = (string | DocumentFilter)[]
/**
* A selection range represents a part of a selection hierarchy. A selection range
* may have a parent selection range that contains it.
*/
export interface SelectionRange {
/**
* The [range](#Range) of this selection range.
*/
range: Range
/**
* The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
*/
parent?: SelectionRange
}
/**
* MarkedString can be used to render human readable text. It is either a markdown string
* or a code-block that provides a language and a code snippet. The language identifier
* is semantically equal to the optional language identifier in fenced code blocks in GitHub
* issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
*
* The pair of a language and a value is an equivalent to markdown:
* ```${language}
* ${value}
* ```
*
* Note that markdown strings will be sanitized - that means html will be escaped.
* @deprecated use MarkupContent instead.
*/
export type MarkedString = string | {
language: string
value: string
}
/**
* The result of a hover request.
*/
export interface Hover {
/**
* The hover's content
*/
contents: MarkupContent | MarkedString | MarkedString[]
/**
* An optional range
*/
range?: Range
}
/**
* The definition of a symbol represented as one or many [locations](#Location).
* For most programming languages there is only one location at which a symbol is
* defined.
*
* Servers should prefer returning `DefinitionLink` over `Definition` if supported
* by the client.
*/
export type Definition = Location | Location[]
/**
* Information about where a symbol is defined.
*
* Provides additional metadata over normal [location](#Location) definitions, including the range of
* the defining symbol
*/
export type DefinitionLink = LocationLink
/**
* How a signature help was triggered.
*/
export namespace SignatureHelpTriggerKind {
/**
* Signature help was invoked manually by the user or by a command.
*/
const Invoked: 1
/**
* Signature help was triggered by a trigger character.
*/
const TriggerCharacter: 2
/**
* Signature help was triggered by the cursor moving or by the document content changing.
*/
const ContentChange: 3
}
export type SignatureHelpTriggerKind = 1 | 2 | 3
/**
* Represents the signature of something callable. A signature
* can have a label, like a function-name, a doc-comment, and
* a set of parameters.
*/
export interface SignatureInformation {
/**
* The label of this signature. Will be shown in
* the UI.
*/
label: string
/**
* The human-readable doc-comment of this signature. Will be shown
* in the UI but can be omitted.
*/
documentation?: string | MarkupContent
/**
* The parameters of this signature.
*/
parameters?: ParameterInformation[]
}
/**
* Represents a parameter of a callable-signature. A parameter can
* have a label and a doc-comment.
*/
export interface ParameterInformation {
/**
* The label of this parameter information.
*
* Either a string or an inclusive start and exclusive end offsets within its containing
* signature label. (see SignatureInformation.label). The offsets are based on a UTF-16
* string representation as `Position` and `Range` does.
*
* *Note*: a label of type string should be a substring of its containing signature label.
* Its intended use case is to highlight the parameter label part in the `SignatureInformation.label`.
*/
label: string | [number, number]
/**
* The human-readable doc-comment of this signature. Will be shown
* in the UI but can be omitted.
*/
documentation?: string | MarkupContent
}
/**
* Signature help represents the signature of something
* callable. There can be multiple signature but only one
* active and only one active parameter.
*/
export interface SignatureHelp {
/**
* One or more signatures.
*/
signatures: SignatureInformation[]
/**
* The active signature. Set to `null` if no
* signatures exist.
*/
activeSignature: number | null
/**
* The active parameter of the active signature. Set to `null`
* if the active signature has no parameters.
*/
activeParameter: number | null
}
/**
* Additional information about the context in which a signature help request was triggered.
*
* @since 3.15.0
*/
export interface SignatureHelpContext {
/**
* Action that caused signature help to be triggered.
*/
triggerKind: SignatureHelpTriggerKind
/**
* Character that caused signature help to be triggered.
*
* This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter`
*/
triggerCharacter?: string
/**
* `true` if signature help was already showing when it was triggered.
*
* Retriggers occur when the signature help is already active and can be caused by actions such as
* typing a trigger character, a cursor move, or document content changes.
*/
isRetrigger: boolean
/**
* The currently active `SignatureHelp`.
*
* The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated based on
* the user navigating through available signatures.
*/
activeSignatureHelp?: SignatureHelp
}
/**
* Represents a folding range.
*/
export interface FoldingRange {
/**
* The zero-based line number from where the folded range starts.
*/
startLine: number
/**
* The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.
*/
startCharacter?: number
/**
* The zero-based line number where the folded range ends.
*/
endLine: number
/**
* The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
*/
endCharacter?: number
/**
* Describes the kind of the folding range such as `comment' or 'region'. The kind
* is used to categorize folding ranges and used by commands like 'Fold all comments'. See
* [FoldingRangeKind](#FoldingRangeKind) for an enumeration of standardized kinds.
*/
kind?: string
}
/**
* A symbol kind.
*/
export namespace SymbolKind {
const File: 1
const Module: 2
const Namespace: 3
const Package: 4
const Class: 5
const Method: 6
const Property: 7
const Field: 8
const Constructor: 9
const Enum: 10
const Interface: 11
const Function: 12
const Variable: 13
const Constant: 14
const String: 15
const Number: 16
const Boolean: 17
const Array: 18
const Object: 19
const Key: 20
const Null: 21
const EnumMember: 22
const Struct: 23
const Event: 24
const Operator: 25
const TypeParameter: 26
}
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
/**
* Represents information about programming constructs like variables, classes,
* interfaces etc.
*/
export interface SymbolInformation {
/**
* The name of this symbol.
*/
name: string
/**
* The kind of this symbol.
*/
kind: SymbolKind
/**
* Indicates if this symbol is deprecated.
*/
deprecated?: boolean
/**
* The location of this symbol. The location's range is used by a tool
* to reveal the location in the editor. If the symbol is selected in the
* tool the range's start information is used to position the cursor. So
* the range usually spans more than the actual symbol's name and does
* normally include thinks like visibility modifiers.
*
* The range doesn't have to denote a node range in the sense of a abstract
* syntax tree. It can therefore not be used to re-construct a hierarchy of
* the symbols.
*/
location: Location
/**
* The name of the symbol containing this symbol. This information is for
* user interface purposes (e.g. to render a qualifier in the user interface
* if necessary). It can't be used to re-infer a hierarchy for the document
* symbols.
*/
containerName?: string
}
/**
* Represents programming constructs like variables, classes, interfaces etc.
* that appear in a document. Document symbols can be hierarchical and they
* have two ranges: one that encloses its definition and one that points to
* its most interesting range, e.g. the range of an identifier.
*/
export interface DocumentSymbol {
/**
* The name of this symbol. Will be displayed in the user interface and therefore must not be
* an empty string or a string only consisting of white spaces.
*/
name: string
/**
* More detail for this symbol, e.g the signature of a function.
*/
detail?: string
/**
* The kind of this symbol.
*/
kind: SymbolKind
/**
* Indicates if this symbol is deprecated.
*/
deprecated?: boolean
/**
* The range enclosing this symbol not including leading/trailing whitespace but everything else
* like comments. This information is typically used to determine if the the clients cursor is
* inside the symbol to reveal in the symbol in the UI.
*/
range: Range
/**
* The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
* Must be contained by the the `range`.
*/
selectionRange: Range
/**
* Children of this symbol, e.g. properties of a class.
*/
children?: DocumentSymbol[]
}
export interface FormattingOptions {
/**
* If indentation is based on spaces (`insertSpaces` = true), the number of spaces that make an indent.
*/
tabSize?: number
/**
* Is indentation based on spaces?
*/
insertSpaces?: boolean
/**
* The default 'end of line' character. If not set, '\n' is used as default.
*/
eol?: string
}
/**
* Contains additional diagnostic information about the context in which
* a [code action](#CodeActionProvider.provideCodeActions) is run.
*/
export interface CodeActionContext {
/**
* An array of diagnostics known on the client side overlapping the range provided to the
* `textDocument/codeAction` request. They are provied so that the server knows which
* errors are currently presented to the user for the given range. There is no guarantee
* that these accurately reflect the error state of the resource. The primary parameter
* to compute code actions is the provided range.
*/
diagnostics: Diagnostic[]
/**
* Requested kind of actions to return.
*
* Actions not of this kind are filtered out by the client before being shown. So servers
* can omit computing them.
*/
only?: string[]
}
/**
* A document highlight kind.
*/
export namespace DocumentHighlightKind {
/**
* A textual occurrence.
*/
const Text: 1
/**
* Read-access of a symbol, like reading a variable.
*/
const Read: 2
/**
* Write-access of a symbol, like writing to a variable.
*/
const Write: 3
}
export type DocumentHighlightKind = 1 | 2 | 3
/**
* A document highlight is a range inside a text document which deserves
* special attention. Usually a document highlight is visualized by changing
* the background color of its range.
*/
export interface DocumentHighlight {
/**
* The range this highlight applies to.
*/
range: Range
/**
* The highlight kind, default is [text](#DocumentHighlightKind.Text).
*/
kind?: DocumentHighlightKind
}
/**
* A document link is a range in a text document that links to an internal or external resource, like another
* text document or a web site.
*/
export interface DocumentLink {
/**
* The range this link applies to.
*/
range: Range
/**
* The uri this link points to.
*/
target?: string
/**
* The tooltip text when you hover over this link.
*
* If a tooltip is provided, is will be displayed in a string that includes instructions on how to
* trigger the link, such as `{0} (ctrl + click)`. The specific instructions vary depending on OS,
* user settings, and localization.
*
* @since 3.15.0
*/
tooltip?: string
/**
* A data entry field that is preserved on a document link between a
* DocumentLinkRequest and a DocumentLinkResolveRequest.
*/
data?: any
}
/**
* Represents a color in RGBA space.
*/
export interface Color {
/**
* The red component of this color in the range [0-1].
*/
readonly red: number
/**
* The green component of this color in the range [0-1].
*/
readonly green: number
/**
* The blue component of this color in the range [0-1].
*/
readonly blue: number
/**
* The alpha component of this color in the range [0-1].
*/
readonly alpha: number
}
/**
* Represents a color range from a document.
*/
export interface ColorInformation {
/**
* The range in the document where this color appers.
*/
range: Range
/**
* The actual color value for this color range.
*/
color: Color
}
export interface ColorPresentation {
/**
* The label of this color presentation. It will be shown on the color
* picker header. By default this is also the text that is inserted when selecting
* this color presentation.
*/
label: string
/**
* An [edit](#TextEdit) which is applied to a document when selecting
* this presentation for the color. When `falsy` the [label](#ColorPresentation.label)
* is used.
*/
textEdit?: TextEdit
/**
* An optional array of additional [text edits](#TextEdit) that are applied when
* selecting this color presentation. Edits must not overlap with the main [edit](#ColorPresentation.textEdit) nor with themselves.
*/
additionalTextEdits?: TextEdit[]
}
/**
* A code lens represents a [command](#Command) that should be shown along with
* source text, like the number of references, a way to run tests, etc.
*
* A code lens is _unresolved_ when no command is associated to it. For performance
* reasons the creation of a code lens and resolving should be done to two stages.
*/
export interface CodeLens {
/**
* The range in which this code lens is valid. Should only span a single line.
*/
range: Range
/**
* The command this code lens represents.
*/
command?: Command
/**
* An data entry field that is preserved on a code lens item between
* a [CodeLensRequest](#CodeLensRequest) and a [CodeLensResolveRequest]
* (#CodeLensResolveRequest)
*/
data?: any
}
/**
* Represents the connection of two locations. Provides additional metadata over normal [locations](#Location),
* including an origin range.
*/
export interface LocationLink {
/**
* Span of the origin of this link.
*
* Used as the underlined span for mouse definition hover. Defaults to the word range at
* the definition position.
*/
originSelectionRange?: Range
/**
* The target resource identifier of this link.
*/
targetUri: string
/**
* The full target range of this link. If the target for example is a symbol then target range is the
* range enclosing this symbol not including leading/trailing whitespace but everything else
* like comments. This information is typically used to highlight the range in the editor.
*/
targetRange: Range
/**
* The range that should be selected and revealed when this link is being followed, e.g the name of a function.
* Must be contained by the the `targetRange`. See also `DocumentSymbol#range`
*/
targetSelectionRange: Range
}
/**
* The LocationLink namespace provides helper functions to work with
* [LocationLink](#LocationLink) literals.
*/
export namespace LocationLink {
/**
* Creates a LocationLink literal.
* @param targetUri The definition's uri.
* @param targetRange The full range of the definition.
* @param targetSelectionRange The span of the symbol definition at the target.
* @param originSelectionRange The span of the symbol being defined in the originating source file.
*/
function create(targetUri: string, targetRange: Range, targetSelectionRange: Range, originSelectionRange?: Range): LocationLink
/**
* Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.
*/
function is(value: any): value is LocationLink
}
export type MarkupKind = 'plaintext' | 'markdown'
/**
* Describes the content type that a client supports in various
* result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
*
* Please note that `MarkupKinds` must not start with a `$`. This kinds
* are reserved for internal usage.
*/
export namespace MarkupKind {
/**
* Plain text is supported as a content format
*/
const PlainText: 'plaintext'
/**
* Markdown is supported as a content format
*/
const Markdown: 'markdown'
}
/**
* A `MarkupContent` literal represents a string value which content is interpreted base on its
* kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.
*
* If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.
* See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
*
* Here is an example how such a string can be constructed using JavaScript / TypeScript:
* ```ts
* let markdown: MarkdownContent = {
* kind: MarkupKind.Markdown,
* value: [
* '# Header',
* 'Some text',
* '```typescript',
* 'someCode();',
* '```'
* ].join('\n')
* };
* ```
*
* *Please Note* that clients might sanitize the return markdown. A client could decide to
* remove HTML from the markdown to avoid script execution.
*/
export interface MarkupContent {
/**
* The type of the Markup
*/
kind: MarkupKind
/**
* The content itself
*/
value: string
}
/**
* The kind of a completion entry.
*/
export namespace CompletionItemKind {
const Text: 1
const Method: 2
const Function: 3
const Constructor: 4
const Field: 5
const Variable: 6
const Class: 7
const Interface: 8
const Module: 9
const Property: 10
const Unit: 11
const Value: 12
const Enum: 13
const Keyword: 14
const Snippet: 15
const Color: 16
const File: 17
const Reference: 18
const Folder: 19
const EnumMember: 20
const Constant: 21
const Struct: 22
const Event: 23
const Operator: 24
const TypeParameter: 25
}
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
/**
* Defines whether the insert text in a completion item should be interpreted as
* plain text or a snippet.
*/
export namespace InsertTextFormat {
/**
* The primary text to be inserted is treated as a plain string.
*/
const PlainText: 1
/**
* The primary text to be inserted is treated as a snippet.
*
* A snippet can define tab stops and placeholders with `$1`, `$2`
* and `${3:foo}`. `$0` defines the final tab stop, it defaults to
* the end of the snippet. Placeholders with equal identifiers are linked,
* that is typing in one will update others too.
*
* See also: https://github.com/microsoft/vscode/blob/main/src/vs/editor/contrib/snippet/snippet.md
*/
const Snippet: 2
}
export type InsertTextFormat = 1 | 2
/**
* A completion item represents a text snippet that is
* proposed to complete text that is being typed.
*/
export interface CompletionItem {
/**
* The label of this completion item. By default
* also the text that is inserted when selecting
* this completion.
*/
label: string
/**
* The kind of this completion item. Based of the kind
* an icon is chosen by the editor.
*/
kind?: CompletionItemKind
/**
* Tags for this completion item.
*
* @since 3.15.0
*/
tags?: number[]
/**
* A human-readable string with additional information
* about this item, like type or symbol information.
*/
detail?: string
/**
* A human-readable string that represents a doc-comment.
*/
documentation?: string | MarkupContent
/**
* Indicates if this item is deprecated.
* @deprecated Use `tags` instead.
*/
deprecated?: boolean
/**
* Select this item when showing.
*
* *Note* that only one completion item can be selected and that the
* tool / client decides which item that is. The rule is that the *first*
* item of those that match best is selected.
*/
preselect?: boolean
/**
* A string that should be used when comparing this item
* with other items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/
sortText?: string
/**
* A string that should be used when filtering a set of
* completion items. When `falsy` the [label](#CompletionItem.label)
* is used.
*/