forked from microsoft/TypeScript
- Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprotocol.ts
3309 lines (2895 loc) · 93.9 KB
/
protocol.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
importtype*astsfrom"./_namespaces/ts.js";
importtype{
ApplicableRefactorInfo,
CompilerOptionsValue,
CompletionsTriggerCharacter,
EndOfLineState,
FileExtensionInfo,
HighlightSpanKind,
InlayHintKind,
InteractiveRefactorArguments,
OutputFile,
RefactorActionInfo,
RefactorTriggerReason,
RenameInfoFailure,
RenameLocation,
ScriptElementKind,
ScriptKind,
SignatureHelpCharacterTypedReason,
SignatureHelpInvokedReason,
SignatureHelpParameter,
SignatureHelpRetriggerCharacter,
SignatureHelpRetriggeredReason,
SignatureHelpTriggerCharacter,
SignatureHelpTriggerReason,
SymbolDisplayPart,
TextChange,
TextInsertion,
TodoComment,
TodoCommentDescriptor,
TypeAcquisition,
UserPreferences,
}from"./_namespaces/ts.js";
import{
ClassificationType,
CompletionTriggerKind,
OrganizeImportsMode,
SemicolonPreference,
}from"./_namespaces/ts.js";
// These types/enums used to be defined in duplicate here and exported. They are re-exported to avoid breaking changes.
export{ApplicableRefactorInfo,ClassificationType,CompletionsTriggerCharacter,CompletionTriggerKind,InlayHintKind,OrganizeImportsMode,RefactorActionInfo,RefactorTriggerReason,RenameInfoFailure,SemicolonPreference,SignatureHelpCharacterTypedReason,SignatureHelpInvokedReason,SignatureHelpParameter,SignatureHelpRetriggerCharacter,SignatureHelpRetriggeredReason,SignatureHelpTriggerCharacter,SignatureHelpTriggerReason,SymbolDisplayPart,UserPreferences};
typeChangeStringIndexSignature<T,NewStringIndexSignatureType>={[KinkeyofT]: stringextendsK ? NewStringIndexSignatureType : T[K];};
typeChangePropertyTypes<T,Substitutionsextends{[KinkeyofT]?: any;}>={
[KinkeyofT]: KextendskeyofSubstitutions ? Substitutions[K] : T[K];
};
// Declaration module describing the TypeScript Server protocol
exportconstenumCommandTypes{
JsxClosingTag="jsxClosingTag",
LinkedEditingRange="linkedEditingRange",
Brace="brace",
/** @internal */
BraceFull="brace-full",
BraceCompletion="braceCompletion",
GetSpanOfEnclosingComment="getSpanOfEnclosingComment",
Change="change",
Close="close",
/** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */
Completions="completions",
CompletionInfo="completionInfo",
/** @internal */
CompletionsFull="completions-full",
CompletionDetails="completionEntryDetails",
/** @internal */
CompletionDetailsFull="completionEntryDetails-full",
CompileOnSaveAffectedFileList="compileOnSaveAffectedFileList",
CompileOnSaveEmitFile="compileOnSaveEmitFile",
Configure="configure",
Definition="definition",
/** @internal */
DefinitionFull="definition-full",
DefinitionAndBoundSpan="definitionAndBoundSpan",
/** @internal */
DefinitionAndBoundSpanFull="definitionAndBoundSpan-full",
Implementation="implementation",
/** @internal */
ImplementationFull="implementation-full",
/** @internal */
EmitOutput="emit-output",
Exit="exit",
FileReferences="fileReferences",
/** @internal */
FileReferencesFull="fileReferences-full",
Format="format",
Formatonkey="formatonkey",
/** @internal */
FormatFull="format-full",
/** @internal */
FormatonkeyFull="formatonkey-full",
/** @internal */
FormatRangeFull="formatRange-full",
Geterr="geterr",
GeterrForProject="geterrForProject",
SemanticDiagnosticsSync="semanticDiagnosticsSync",
SyntacticDiagnosticsSync="syntacticDiagnosticsSync",
SuggestionDiagnosticsSync="suggestionDiagnosticsSync",
NavBar="navbar",
/** @internal */
NavBarFull="navbar-full",
Navto="navto",
/** @internal */
NavtoFull="navto-full",
NavTree="navtree",
NavTreeFull="navtree-full",
DocumentHighlights="documentHighlights",
/** @internal */
DocumentHighlightsFull="documentHighlights-full",
Open="open",
Quickinfo="quickinfo",
/** @internal */
QuickinfoFull="quickinfo-full",
References="references",
/** @internal */
ReferencesFull="references-full",
Reload="reload",
Rename="rename",
/** @internal */
RenameInfoFull="rename-full",
/** @internal */
RenameLocationsFull="renameLocations-full",
Saveto="saveto",
SignatureHelp="signatureHelp",
/** @internal */
SignatureHelpFull="signatureHelp-full",
FindSourceDefinition="findSourceDefinition",
Status="status",
TypeDefinition="typeDefinition",
ProjectInfo="projectInfo",
ReloadProjects="reloadProjects",
Unknown="unknown",
OpenExternalProject="openExternalProject",
OpenExternalProjects="openExternalProjects",
CloseExternalProject="closeExternalProject",
/** @internal */
SynchronizeProjectList="synchronizeProjectList",
/** @internal */
ApplyChangedToOpenFiles="applyChangedToOpenFiles",
UpdateOpen="updateOpen",
/** @internal */
EncodedSyntacticClassificationsFull="encodedSyntacticClassifications-full",
/** @internal */
EncodedSemanticClassificationsFull="encodedSemanticClassifications-full",
/** @internal */
Cleanup="cleanup",
GetOutliningSpans="getOutliningSpans",
/** @internal */
GetOutliningSpansFull="outliningSpans",// Full command name is different for backward compatibility purposes
TodoComments="todoComments",
Indentation="indentation",
DocCommentTemplate="docCommentTemplate",
/** @internal */
CompilerOptionsDiagnosticsFull="compilerOptionsDiagnostics-full",
/** @internal */
NameOrDottedNameSpan="nameOrDottedNameSpan",
/** @internal */
BreakpointStatement="breakpointStatement",
CompilerOptionsForInferredProjects="compilerOptionsForInferredProjects",
GetCodeFixes="getCodeFixes",
/** @internal */
GetCodeFixesFull="getCodeFixes-full",
GetCombinedCodeFix="getCombinedCodeFix",
/** @internal */
GetCombinedCodeFixFull="getCombinedCodeFix-full",
ApplyCodeActionCommand="applyCodeActionCommand",
GetSupportedCodeFixes="getSupportedCodeFixes",
GetApplicableRefactors="getApplicableRefactors",
GetEditsForRefactor="getEditsForRefactor",
GetMoveToRefactoringFileSuggestions="getMoveToRefactoringFileSuggestions",
PreparePasteEdits="preparePasteEdits",
GetPasteEdits="getPasteEdits",
/** @internal */
GetEditsForRefactorFull="getEditsForRefactor-full",
OrganizeImports="organizeImports",
/** @internal */
OrganizeImportsFull="organizeImports-full",
GetEditsForFileRename="getEditsForFileRename",
/** @internal */
GetEditsForFileRenameFull="getEditsForFileRename-full",
ConfigurePlugin="configurePlugin",
SelectionRange="selectionRange",
/** @internal */
SelectionRangeFull="selectionRange-full",
ToggleLineComment="toggleLineComment",
/** @internal */
ToggleLineCommentFull="toggleLineComment-full",
ToggleMultilineComment="toggleMultilineComment",
/** @internal */
ToggleMultilineCommentFull="toggleMultilineComment-full",
CommentSelection="commentSelection",
/** @internal */
CommentSelectionFull="commentSelection-full",
UncommentSelection="uncommentSelection",
/** @internal */
UncommentSelectionFull="uncommentSelection-full",
PrepareCallHierarchy="prepareCallHierarchy",
ProvideCallHierarchyIncomingCalls="provideCallHierarchyIncomingCalls",
ProvideCallHierarchyOutgoingCalls="provideCallHierarchyOutgoingCalls",
ProvideInlayHints="provideInlayHints",
WatchChange="watchChange",
MapCode="mapCode",
/** @internal */
CopilotRelated="copilotRelated",
}
/**
* A TypeScript Server message
*/
exportinterfaceMessage{
/**
* Sequence number of the message
*/
seq: number;
/**
* One of "request", "response", or "event"
*/
type: "request"|"response"|"event";
}
/**
* Client-initiated request message
*/
exportinterfaceRequestextendsMessage{
type: "request";
/**
* The command to execute
*/
command: string;
/**
* Object containing arguments for the command
*/
arguments?: any;
}
/**
* Request to reload the project structure for all the opened files
*/
exportinterfaceReloadProjectsRequestextendsRequest{
command: CommandTypes.ReloadProjects;
}
/**
* Server-initiated event message
*/
exportinterfaceEventextendsMessage{
type: "event";
/**
* Name of event
*/
event: string;
/**
* Event-specific information
*/
body?: any;
}
/**
* Response by server to client request message.
*/
exportinterfaceResponseextendsMessage{
type: "response";
/**
* Sequence number of the request message.
*/
request_seq: number;
/**
* Outcome of the request.
*/
success: boolean;
/**
* The command requested.
*/
command: string;
/**
* If success === false, this should always be provided.
* Otherwise, may (or may not) contain a success message.
*/
message?: string;
/**
* Contains message body if success === true.
*/
body?: any;
/**
* Contains extra information that plugin can include to be passed on
*/
metadata?: unknown;
/**
* Exposes information about the performance of this request-response pair.
*/
performanceData?: PerformanceData;
}
exportinterfacePerformanceData{
/**
* Time spent updating the program graph, in milliseconds.
*/
updateGraphDurationMs?: number;
/**
* The time spent creating or updating the auto-import program, in milliseconds.
*/
createAutoImportProviderProgramDurationMs?: number;
/**
* The time spent computing diagnostics, in milliseconds.
*/
diagnosticsDuration?: FileDiagnosticPerformanceData[];
}
/**
* Time spent computing each kind of diagnostics, in milliseconds.
*/
exporttypeDiagnosticPerformanceData={[KindinDiagnosticEventKind]?: number;};
exportinterfaceFileDiagnosticPerformanceDataextendsDiagnosticPerformanceData{
/**
* The file for which the performance data is reported.
*/
file: string;
}
/**
* Arguments for FileRequest messages.
*/
exportinterfaceFileRequestArgs{
/**
* The file for the request (absolute pathname required).
*/
file: string;
/*
* Optional name of project that contains file
*/
projectFileName?: string;
}
exportinterfaceStatusRequestextendsRequest{
command: CommandTypes.Status;
}
exportinterfaceStatusResponseBody{
/**
* The TypeScript version (`ts.version`).
*/
version: string;
}
/**
* Response to StatusRequest
*/
exportinterfaceStatusResponseextendsResponse{
body: StatusResponseBody;
}
/**
* Requests a JS Doc comment template for a given position
*/
exportinterfaceDocCommentTemplateRequestextendsFileLocationRequest{
command: CommandTypes.DocCommentTemplate;
}
/**
* Response to DocCommentTemplateRequest
*/
exportinterfaceDocCommandTemplateResponseextendsResponse{
body?: TextInsertion;
}
/**
* A request to get TODO comments from the file
*/
exportinterfaceTodoCommentRequestextendsFileRequest{
command: CommandTypes.TodoComments;
arguments: TodoCommentRequestArgs;
}
/**
* Arguments for TodoCommentRequest request.
*/
exportinterfaceTodoCommentRequestArgsextendsFileRequestArgs{
/**
* Array of target TodoCommentDescriptors that describes TODO comments to be found
*/
descriptors: TodoCommentDescriptor[];
}
/**
* Response for TodoCommentRequest request.
*/
exportinterfaceTodoCommentsResponseextendsResponse{
body?: TodoComment[];
}
/**
* A request to determine if the caret is inside a comment.
*/
exportinterfaceSpanOfEnclosingCommentRequestextendsFileLocationRequest{
command: CommandTypes.GetSpanOfEnclosingComment;
arguments: SpanOfEnclosingCommentRequestArgs;
}
exportinterfaceSpanOfEnclosingCommentRequestArgsextendsFileLocationRequestArgs{
/**
* Requires that the enclosing span be a multi-line comment, or else the request returns undefined.
*/
onlyMultiLine: boolean;
}
/**
* Request to obtain outlining spans in file.
*/
exportinterfaceOutliningSpansRequestextendsFileRequest{
command: CommandTypes.GetOutliningSpans;
}
exporttypeOutliningSpan=ChangePropertyTypes<ts.OutliningSpan,{textSpan: TextSpan;hintSpan: TextSpan;}>;
/**
* Response to OutliningSpansRequest request.
*/
exportinterfaceOutliningSpansResponseextendsResponse{
body?: OutliningSpan[];
}
/**
* Request to obtain outlining spans in file.
*
* @internal
*/
exportinterfaceOutliningSpansRequestFullextendsFileRequest{
command: CommandTypes.GetOutliningSpansFull;
}
/**
* Response to OutliningSpansRequest request.
*
* @internal@knipignore
*/
exportinterfaceOutliningSpansResponseFullextendsResponse{
body?: ts.OutliningSpan[];
}
/**
* A request to get indentation for a location in file
*/
exportinterfaceIndentationRequestextendsFileLocationRequest{
command: CommandTypes.Indentation;
arguments: IndentationRequestArgs;
}
/**
* Response for IndentationRequest request.
*/
exportinterfaceIndentationResponseextendsResponse{
body?: IndentationResult;
}
/**
* Indentation result representing where indentation should be placed
*/
exportinterfaceIndentationResult{
/**
* The base position in the document that the indent should be relative to
*/
position: number;
/**
* The number of columns the indent should be at relative to the position's column.
*/
indentation: number;
}
/**
* Arguments for IndentationRequest request.
*/
exportinterfaceIndentationRequestArgsextendsFileLocationRequestArgs{
/**
* An optional set of settings to be used when computing indentation.
* If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings.
*/
options?: EditorSettings;
}
/**
* Arguments for ProjectInfoRequest request.
*/
exportinterfaceProjectInfoRequestArgsextendsFileRequestArgs{
/**
* Indicate if the file name list of the project is needed
*/
needFileNameList: boolean;
/**
* if true returns details about default configured project calculation
*/
needDefaultConfiguredProjectInfo?: boolean;
}
/**
* A request to get the project information of the current file.
*/
exportinterfaceProjectInfoRequestextendsRequest{
command: CommandTypes.ProjectInfo;
arguments: ProjectInfoRequestArgs;
}
/**
* A request to retrieve compiler options diagnostics for a project
*/
exportinterfaceCompilerOptionsDiagnosticsRequestextendsRequest{
arguments: CompilerOptionsDiagnosticsRequestArgs;
}
/**
* Arguments for CompilerOptionsDiagnosticsRequest request.
*/
exportinterfaceCompilerOptionsDiagnosticsRequestArgs{
/**
* Name of the project to retrieve compiler options diagnostics.
*/
projectFileName: string;
}
/**
* Details about the default project for the file if tsconfig file is found
*/
exportinterfaceDefaultConfiguredProjectInfo{
/** List of config files looked and did not match because file was not part of root file names */
notMatchedByConfig?: readonlystring[];
/** List of projects which were loaded but file was not part of the project or is file from referenced project */
notInProject?: readonlystring[];
/** Configured project used as default */
defaultProject?: string;
}
/**
* Response message body for "projectInfo" request
*/
exportinterfaceProjectInfo{
/**
* For configured project, this is the normalized path of the 'tsconfig.json' file
* For inferred project, this is undefined
*/
configFileName: string;
/**
* The list of normalized file name in the project, including 'lib.d.ts'
*/
fileNames?: string[];
/**
* Indicates if the project has a active language service instance
*/
languageServiceDisabled?: boolean;
/**
* Information about default project
*/
configuredProjectInfo?: DefaultConfiguredProjectInfo;
}
/**
* Represents diagnostic info that includes location of diagnostic in two forms
* - start position and length of the error span
* - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span.
*/
exportinterfaceDiagnosticWithLinePosition{
message: string;
start: number;
length: number;
startLocation: Location;
endLocation: Location;
category: string;
code: number;
/** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */
reportsUnnecessary?: {};
reportsDeprecated?: {};
relatedInformation?: DiagnosticRelatedInformation[];
}
/**
* Response message for "projectInfo" request
*/
exportinterfaceProjectInfoResponseextendsResponse{
body?: ProjectInfo;
}
/**
* Request whose sole parameter is a file name.
*/
exportinterfaceFileRequestextendsRequest{
arguments: FileRequestArgs;
}
/**
* Instances of this interface specify a location in a source file:
* (file, line, character offset), where line and character offset are 1-based.
*/
exportinterfaceFileLocationRequestArgsextendsFileRequestArgs{
/**
* The line number for the request (1-based).
*/
line: number;
/**
* The character offset (on the line) for the request (1-based).
*/
offset: number;
/**
* Position (can be specified instead of line/offset pair)
*
* @internal
*/
position?: number;
}
exporttypeFileLocationOrRangeRequestArgs=FileLocationRequestArgs|FileRangeRequestArgs;
/**
* Request refactorings at a given position or selection area.
*/
exportinterfaceGetApplicableRefactorsRequestextendsRequest{
command: CommandTypes.GetApplicableRefactors;
arguments: GetApplicableRefactorsRequestArgs;
}
exporttypeGetApplicableRefactorsRequestArgs=FileLocationOrRangeRequestArgs&{
triggerReason?: RefactorTriggerReason;
kind?: string;
/**
* Include refactor actions that require additional arguments to be passed when
* calling 'GetEditsForRefactor'. When true, clients should inspect the
* `isInteractive` property of each returned `RefactorActionInfo`
* and ensure they are able to collect the appropriate arguments for any
* interactive refactor before offering it.
*/
includeInteractiveActions?: boolean;
};
/**
* Response is a list of available refactorings.
* Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
*/
exportinterfaceGetApplicableRefactorsResponseextendsResponse{
body?: ApplicableRefactorInfo[];
}
/**
* Request refactorings at a given position or selection area to move to an existing file.
*/
exportinterfaceGetMoveToRefactoringFileSuggestionsRequestextendsRequest{
command: CommandTypes.GetMoveToRefactoringFileSuggestions;
arguments: GetMoveToRefactoringFileSuggestionsRequestArgs;
}
exporttypeGetMoveToRefactoringFileSuggestionsRequestArgs=FileLocationOrRangeRequestArgs&{
kind?: string;
};
/**
* Response is a list of available files.
* Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring
*/
exportinterfaceGetMoveToRefactoringFileSuggestionsextendsResponse{
body: {
newFileName: string;
files: string[];
};
}
/**
* Request to check if `pasteEdits` should be provided for a given location post copying text from that location.
*/
exportinterfacePreparePasteEditsRequestextendsFileRequest{
command: CommandTypes.PreparePasteEdits;
arguments: PreparePasteEditsRequestArgs;
}
exportinterfacePreparePasteEditsRequestArgsextendsFileRequestArgs{
copiedTextSpan: TextSpan[];
}
exportinterfacePreparePasteEditsResponseextendsResponse{
body: boolean;
}
/**
* Request refactorings at a given position post pasting text from some other location.
*/
exportinterfaceGetPasteEditsRequestextendsRequest{
command: CommandTypes.GetPasteEdits;
arguments: GetPasteEditsRequestArgs;
}
exportinterfaceGetPasteEditsRequestArgsextendsFileRequestArgs{
/** The text that gets pasted in a file. */
pastedText: string[];
/** Locations of where the `pastedText` gets added in a file. If the length of the `pastedText` and `pastedLocations` are not the same,
* then the `pastedText` is combined into one and added at all the `pastedLocations`.
*/
pasteLocations: TextSpan[];
/** The source location of each `pastedText`. If present, the length of `spans` must be equal to the length of `pastedText`. */
copiedFrom?: {file: string;spans: TextSpan[];};
}
exportinterfaceGetPasteEditsResponseextendsResponse{
body: PasteEditsAction;
}
exportinterfacePasteEditsAction{
edits: FileCodeEdits[];
fixId?: {};
}
exportinterfaceGetEditsForRefactorRequestextendsRequest{
command: CommandTypes.GetEditsForRefactor;
arguments: GetEditsForRefactorRequestArgs;
}
/**
* Request the edits that a particular refactoring action produces.
* Callers must specify the name of the refactor and the name of the action.
*/
exporttypeGetEditsForRefactorRequestArgs=FileLocationOrRangeRequestArgs&{
/* The 'name' property from the refactoring that offered this action */
refactor: string;
/* The 'name' property from the refactoring action */
action: string;
/* Arguments for interactive action */
interactiveRefactorArguments?: InteractiveRefactorArguments;
};
exportinterfaceGetEditsForRefactorResponseextendsResponse{
body?: RefactorEditInfo;
}
exportinterfaceRefactorEditInfo{
edits: FileCodeEdits[];
/**
* An optional location where the editor should start a rename operation once
* the refactoring edits have been applied
*/
renameLocation?: Location;
renameFilename?: string;
notApplicableReason?: string;
}
/**
* Organize imports by:
* 1) Removing unused imports
* 2) Coalescing imports from the same module
* 3) Sorting imports
*/
exportinterfaceOrganizeImportsRequestextendsRequest{
command: CommandTypes.OrganizeImports;
arguments: OrganizeImportsRequestArgs;
}
exporttypeOrganizeImportsScope=GetCombinedCodeFixScope;
exportinterfaceOrganizeImportsRequestArgs{
scope: OrganizeImportsScope;
/** @deprecated Use `mode` instead */
skipDestructiveCodeActions?: boolean;
mode?: OrganizeImportsMode;
}
exportinterfaceOrganizeImportsResponseextendsResponse{
body: readonlyFileCodeEdits[];
}
exportinterfaceGetEditsForFileRenameRequestextendsRequest{
command: CommandTypes.GetEditsForFileRename;
arguments: GetEditsForFileRenameRequestArgs;
}
/** Note: Paths may also be directories. */
exportinterfaceGetEditsForFileRenameRequestArgs{
readonlyoldFilePath: string;
readonlynewFilePath: string;
}
exportinterfaceGetEditsForFileRenameResponseextendsResponse{
body: readonlyFileCodeEdits[];
}
/**
* Request for the available codefixes at a specific position.
*/
exportinterfaceCodeFixRequestextendsRequest{
command: CommandTypes.GetCodeFixes;
arguments: CodeFixRequestArgs;
}
exportinterfaceGetCombinedCodeFixRequestextendsRequest{
command: CommandTypes.GetCombinedCodeFix;
arguments: GetCombinedCodeFixRequestArgs;
}
exportinterfaceGetCombinedCodeFixResponseextendsResponse{
body: CombinedCodeActions;
}
exportinterfaceApplyCodeActionCommandRequestextendsRequest{
command: CommandTypes.ApplyCodeActionCommand;
arguments: ApplyCodeActionCommandRequestArgs;
}
// All we need is the `success` and `message` fields of Response.
exportinterfaceApplyCodeActionCommandResponseextendsResponse{}
exportinterfaceFileRangeRequestArgsextendsFileRequestArgs,FileRange{
/**
* Position (can be specified instead of line/offset pair)
*
* @internal
*/
startPosition?: number;
/**
* Position (can be specified instead of line/offset pair)
*
* @internal
*/
endPosition?: number;
}
/**
* Instances of this interface specify errorcodes on a specific location in a sourcefile.
*/
exportinterfaceCodeFixRequestArgsextendsFileRangeRequestArgs{
/**
* Errorcodes we want to get the fixes for.
*/
errorCodes: readonlynumber[];
}
exportinterfaceGetCombinedCodeFixRequestArgs{
scope: GetCombinedCodeFixScope;
fixId: {};
}
exportinterfaceGetCombinedCodeFixScope{
type: "file";
args: FileRequestArgs;
}
exportinterfaceApplyCodeActionCommandRequestArgs{
/** May also be an array of commands. */
command: {};
}
/**
* Response for GetCodeFixes request.
*/
exportinterfaceGetCodeFixesResponseextendsResponse{
body?: CodeAction[];
}
/**
* A request whose arguments specify a file location (file, line, col).
*/
exportinterfaceFileLocationRequestextendsFileRequest{
arguments: FileLocationRequestArgs;
}
/**
* A request to get codes of supported code fixes.
*/
exportinterfaceGetSupportedCodeFixesRequestextendsRequest{
command: CommandTypes.GetSupportedCodeFixes;
arguments?: Partial<FileRequestArgs>;
}
/**
* A response for GetSupportedCodeFixesRequest request.
*/
exportinterfaceGetSupportedCodeFixesResponseextendsResponse{
/**
* List of error codes supported by the server.
*/
body?: string[];
}
/**
* A request to get encoded Syntactic classifications for a span in the file
*
* @internal
*/
exportinterfaceEncodedSyntacticClassificationsRequestextendsFileRequest{
arguments: EncodedSyntacticClassificationsRequestArgs;
}
/**
* Arguments for EncodedSyntacticClassificationsRequest request.
*
* @internal
*/
exportinterfaceEncodedSyntacticClassificationsRequestArgsextendsFileRequestArgs{
/**
* Start position of the span.
*/
start: number;
/**
* Length of the span.
*/
length: number;
}
/**
* A request to get encoded semantic classifications for a span in the file
*/
exportinterfaceEncodedSemanticClassificationsRequestextendsFileRequest{
arguments: EncodedSemanticClassificationsRequestArgs;
}
/**
* Arguments for EncodedSemanticClassificationsRequest request.
*/
exportinterfaceEncodedSemanticClassificationsRequestArgsextendsFileRequestArgs{
/**
* Start position of the span.
*/
start: number;
/**
* Length of the span.
*/
length: number;
/**
* Optional parameter for the semantic highlighting response, if absent it
* defaults to "original".
*/
format?: "original"|"2020";
}
/** The response for a EncodedSemanticClassificationsRequest */
exportinterfaceEncodedSemanticClassificationsResponseextendsResponse{
body?: EncodedSemanticClassificationsResponseBody;
}
/**
* Implementation response message. Gives series of text spans depending on the format ar.
*/
exportinterfaceEncodedSemanticClassificationsResponseBody{
endOfLineState: EndOfLineState;
spans: number[];
}
/**
* Arguments in document highlight request; include: filesToSearch, file,
* line, offset.
*/
exportinterfaceDocumentHighlightsRequestArgsextendsFileLocationRequestArgs{
/**
* List of files to search for document highlights.
*/
filesToSearch: string[];
}
/**
* Go to definition request; value of command field is
* "definition". Return response giving the file locations that
* define the symbol found in file at location line, col.
*/
exportinterfaceDefinitionRequestextendsFileLocationRequest{
command: CommandTypes.Definition;
}
exportinterfaceDefinitionAndBoundSpanRequestextendsFileLocationRequest{
readonlycommand: CommandTypes.DefinitionAndBoundSpan;
}
exportinterfaceFindSourceDefinitionRequestextendsFileLocationRequest{
readonlycommand: CommandTypes.FindSourceDefinition;
}
exportinterfaceDefinitionAndBoundSpanResponseextendsResponse{
readonlybody: DefinitionInfoAndBoundSpan;
}
/** @internal */
exportinterfaceEmitOutputRequestextendsFileRequest{
command: CommandTypes.EmitOutput;
arguments: EmitOutputRequestArgs;
}
/** @internal */
exportinterfaceEmitOutputRequestArgsextendsFileRequestArgs{
includeLinePosition?: boolean;
/** if true - return response as object with emitSkipped and diagnostics */
richResponse?: boolean;
}
/** @internal */
exportinterfaceEmitOutputResponseextendsResponse{
readonlybody: EmitOutput|ts.EmitOutput;
}