@@ -97,10 +97,6 @@ export class GoTo {
97
97
this . state . goToEOF ( ) ;
98
98
}
99
99
100
- public implementation ( ) {
101
- this . state . goToImplementation ( ) ;
102
- }
103
-
104
100
public position ( positionOrLineAndCharacter : number | ts . LineAndCharacter , fileNameOrIndex ?: string | number ) : void {
105
101
if ( fileNameOrIndex !== undefined ) {
106
102
this . file ( fileNameOrIndex ) ;
@@ -173,14 +169,6 @@ export class VerifyNegatable {
173
169
this . state . verifyQuickInfoExists ( this . negative ) ;
174
170
}
175
171
176
- public typeDefinitionCountIs ( expectedCount : number ) {
177
- this . state . verifyTypeDefinitionsCount ( this . negative , expectedCount ) ;
178
- }
179
-
180
- public implementationListIsEmpty ( ) {
181
- this . state . verifyImplementationListIsEmpty ( this . negative ) ;
182
- }
183
-
184
172
public isValidBraceCompletionAtPosition ( openingBrace : string ) {
185
173
this . state . verifyBraceCompletionAtPosition ( this . negative , openingBrace ) ;
186
174
}
@@ -310,64 +298,64 @@ export class Verify extends VerifyNegatable {
310
298
this . state . verifyFormatDocumentChangesNothing ( ) ;
311
299
}
312
300
313
- public goToDefinitionIs ( endMarkers : ArrayOrSingle < string > ) {
314
- this . state . verifyGoToDefinitionIs ( endMarkers ) ;
301
+ public verifyGetEmitOutputForCurrentFile ( expected : string ) : void {
302
+ this . state . verifyGetEmitOutputForCurrentFile ( expected ) ;
315
303
}
316
304
317
- public goToDefinition ( startMarkerName : ArrayOrSingle < string > , endMarkerName : ArrayOrSingle < string > , range ?: FourSlash . Range ) : void ;
318
- public goToDefinition ( startsAndEnds : [ ArrayOrSingle < string > , ArrayOrSingle < string > ] [ ] | { [ startMarkerName : string ] : ArrayOrSingle < string > } ) : void ;
319
- public goToDefinition ( arg0 : any , endMarkerName ?: ArrayOrSingle < string > ) {
320
- this . state . verifyGoToDefinition ( arg0 , endMarkerName ) ;
305
+ public verifyGetEmitOutputContentsForCurrentFile ( expected : ts . OutputFile [ ] ) : void {
306
+ this . state . verifyGetEmitOutputContentsForCurrentFile ( expected ) ;
321
307
}
322
308
323
- public goToType ( startMarkerName : ArrayOrSingle < string > , endMarkerName : ArrayOrSingle < string > ) : void ;
324
- public goToType ( startsAndEnds : [ ArrayOrSingle < string > , ArrayOrSingle < string > ] [ ] | { [ startMarkerName : string ] : ArrayOrSingle < string > } ) : void ;
325
- public goToType ( arg0 : any , endMarkerName ?: ArrayOrSingle < string > ) {
326
- this . state . verifyGoToType ( arg0 , endMarkerName ) ;
309
+ public symbolAtLocation ( startRange : FourSlash . Range , ...declarationRanges : FourSlash . Range [ ] ) {
310
+ this . state . verifySymbolAtLocation ( startRange , declarationRanges ) ;
327
311
}
328
312
329
- public goToSourceDefinition ( startMarkerNames : ArrayOrSingle < string > , end : { file : string } | ArrayOrSingle < string > ) {
330
- this . state . verifyGoToSourceDefinition ( startMarkerNames , end ) ;
313
+ public typeOfSymbolAtLocation ( range : FourSlash . Range , symbol : ts . Symbol , expected : string ) {
314
+ this . state . verifyTypeOfSymbolAtLocation ( range , symbol , expected ) ;
331
315
}
332
316
333
- public goToDefinitionForMarkers ( ... markerNames : string [ ] ) {
334
- this . state . verifyGoToDefinitionForMarkers ( markerNames ) ;
317
+ public typeAtLocation ( range : FourSlash . Range , expected : string ) {
318
+ this . state . verifyTypeAtLocation ( range , expected ) ;
335
319
}
336
320
337
- public goToDefinitionName ( name : string , containerName : string ) {
338
- this . state . verifyGoToDefinitionName ( name , containerName ) ;
321
+ public baselineCommands ( ... commands : BaselineCommand [ ] ) {
322
+ this . state . verifyBaselineCommands ( ... commands ) ;
339
323
}
340
324
341
- public verifyGetEmitOutputForCurrentFile ( expected : string ) : void {
342
- this . state . verifyGetEmitOutputForCurrentFile ( expected ) ;
325
+ public baselineFindAllReferences ( ... markerOrRange : FourSlash . MarkerOrNameOrRange [ ] ) {
326
+ this . state . verifyBaselineFindAllReferences ( markerOrRange ) ;
343
327
}
344
328
345
- public verifyGetEmitOutputContentsForCurrentFile ( expected : ts . OutputFile [ ] ) : void {
346
- this . state . verifyGetEmitOutputContentsForCurrentFile ( expected ) ;
329
+ public baselineGetFileReferences ( ... fileName : string [ ] ) {
330
+ this . state . verifyBaselineGetFileReferences ( fileName ) ;
347
331
}
348
332
349
- public symbolAtLocation ( startRange : FourSlash . Range , ... declarationRanges : FourSlash . Range [ ] ) {
350
- this . state . verifySymbolAtLocation ( startRange , declarationRanges ) ;
333
+ public baselineGoToDefinition ( ... markerOrRange : FourSlash . MarkerOrNameOrRange [ ] ) {
334
+ this . state . verifyBaselineGoToDefinition ( markerOrRange ) ;
351
335
}
352
336
353
- public typeOfSymbolAtLocation ( range : FourSlash . Range , symbol : ts . Symbol , expected : string ) {
354
- this . state . verifyTypeOfSymbolAtLocation ( range , symbol , expected ) ;
337
+ public baselineGetDefinitionAtPosition ( ... markerOrRange : FourSlash . MarkerOrNameOrRange [ ] ) {
338
+ this . state . verifyBaselineGetDefinitionAtPosition ( markerOrRange ) ;
355
339
}
356
340
357
- public typeAtLocation ( range : FourSlash . Range , expected : string ) {
358
- this . state . verifyTypeAtLocation ( range , expected ) ;
341
+ public baselineGoToSourceDefinition ( ... markerOrRange : FourSlash . MarkerOrNameOrRange [ ] ) {
342
+ this . state . verifyBaselineGoToSourceDefinition ( markerOrRange ) ;
359
343
}
360
344
361
- public baselineFindAllReferences ( ...markerNames : string [ ] ) {
362
- this . state . verifyBaselineFindAllReferences ( ... markerNames ) ;
345
+ public baselineGoToType ( ...markerOrRange : FourSlash . MarkerOrNameOrRange [ ] ) {
346
+ this . state . verifyBaselineGoToType ( markerOrRange ) ;
363
347
}
364
348
365
- public baselineFindAllReferencesMulti ( seq : number , ...markerNames : string [ ] ) {
366
- this . state . verifyBaselineFindAllReferencesMulti ( seq , ... markerNames ) ;
349
+ public baselineGoToImplementation ( ...markerOrRange : FourSlash . MarkerOrNameOrRange [ ] ) {
350
+ this . state . verifyBaselineGoToImplementation ( markerOrRange ) ;
367
351
}
368
352
369
- public baselineGetFileReferences ( fileName : string ) {
370
- this . state . verifyBaselineGetFileReferences ( fileName ) ;
353
+ public baselineOccurences ( ...markerOrRange : FourSlash . MarkerOrNameOrRange [ ] ) {
354
+ this . state . verifyBaselineOccurences ( markerOrRange ) ;
355
+ }
356
+
357
+ public baselineDocumentHighlights ( markerOrRange : ArrayOrSingle < FourSlash . MarkerOrNameOrRange > , options ?: VerifyDocumentHighlightsOptions ) {
358
+ this . state . verifyBaselineDocumentHighlights ( markerOrRange , options ) ;
371
359
}
372
360
373
361
public findReferencesDefinitionDisplayPartsAtCaretAre ( expected : ts . SymbolDisplayPart [ ] ) {
@@ -508,42 +496,6 @@ export class Verify extends VerifyNegatable {
508
496
this . state . verifyNavigateTo ( options ) ;
509
497
}
510
498
511
- public occurrencesAtPositionContains ( range : FourSlash . Range , isWriteAccess ?: boolean ) {
512
- this . state . verifyOccurrencesAtPositionListContains ( range . fileName , range . pos , range . end , isWriteAccess ) ;
513
- }
514
-
515
- public occurrencesAtPositionCount ( expectedCount : number ) {
516
- this . state . verifyOccurrencesAtPositionListCount ( expectedCount ) ;
517
- }
518
-
519
- public rangesAreOccurrences ( isWriteAccess ?: boolean , ranges ?: FourSlash . Range [ ] ) {
520
- this . state . verifyRangesAreOccurrences ( isWriteAccess , ranges ) ;
521
- }
522
-
523
- public rangesWithSameTextAreRenameLocations ( ...texts : string [ ] ) {
524
- this . state . verifyRangesWithSameTextAreRenameLocations ( ...texts ) ;
525
- }
526
-
527
- public rangesAreRenameLocations ( options ?: FourSlash . Range [ ] | { findInStrings ?: boolean , findInComments ?: boolean , ranges ?: FourSlash . Range [ ] , providePrefixAndSuffixTextForRename ?: boolean } ) {
528
- this . state . verifyRangesAreRenameLocations ( options ) ;
529
- }
530
-
531
- public rangesAreDocumentHighlights ( ranges ?: FourSlash . Range [ ] , options ?: VerifyDocumentHighlightsOptions ) {
532
- this . state . verifyRangesAreDocumentHighlights ( ranges , options ) ;
533
- }
534
-
535
- public rangesWithSameTextAreDocumentHighlights ( ) {
536
- this . state . verifyRangesWithSameTextAreDocumentHighlights ( ) ;
537
- }
538
-
539
- public documentHighlightsOf ( startRange : FourSlash . Range , ranges : FourSlash . Range [ ] , options ?: VerifyDocumentHighlightsOptions ) {
540
- this . state . verifyDocumentHighlightsOf ( startRange , ranges , options ) ;
541
- }
542
-
543
- public noDocumentHighlights ( startRange : FourSlash . Range ) {
544
- this . state . verifyNoDocumentHighlights ( startRange ) ;
545
- }
546
-
547
499
/**
548
500
* This method *requires* a contiguous, complete, and ordered stream of classifications for a file.
549
501
*/
@@ -585,12 +537,8 @@ export class Verify extends VerifyNegatable {
585
537
this . state . verifyRenameInfoFailed ( message , preferences ) ;
586
538
}
587
539
588
- public renameLocations ( startRanges : ArrayOrSingle < FourSlash . Range > , options : RenameLocationsOptions ) {
589
- this . state . verifyRenameLocations ( startRanges , options ) ;
590
- }
591
-
592
- public baselineRename ( marker : string , options : RenameOptions ) {
593
- this . state . baselineRename ( marker , options ) ;
540
+ public baselineRename ( markerOrRange : ArrayOrSingle < FourSlash . MarkerOrNameOrRange > , options ?: RenameOptions ) {
541
+ this . state . baselineRename ( markerOrRange , options ) ;
594
542
}
595
543
596
544
public verifyQuickInfoDisplayParts ( kind : string , kindModifiers : string , textSpan : FourSlash . TextSpan ,
@@ -614,10 +562,6 @@ export class Verify extends VerifyNegatable {
614
562
this . state . verifyProjectInfo ( expected ) ;
615
563
}
616
564
617
- public allRangesAppearInImplementationList ( markerName : string ) {
618
- this . state . verifyRangesInImplementationList ( markerName ) ;
619
- }
620
-
621
565
public getEditsForFileRename ( options : GetEditsForFileRenameOptions ) {
622
566
this . state . getEditsForFileRename ( options ) ;
623
567
}
@@ -642,6 +586,9 @@ export class Verify extends VerifyNegatable {
642
586
export class Edit {
643
587
constructor ( private state : FourSlash . TestState ) {
644
588
}
589
+ public caretPosition ( ) {
590
+ return this . state . caretPosition ( ) ;
591
+ }
645
592
public backspace ( count ?: number ) {
646
593
this . state . deleteCharBehindMarker ( count ) ;
647
594
}
@@ -1846,7 +1793,7 @@ export interface VerifyCompletionListContainsOptions extends ts.UserPreferences
1846
1793
}
1847
1794
1848
1795
export interface VerifyDocumentHighlightsOptions {
1849
- filesToSearch ? : readonly string [ ] ;
1796
+ filesToSearch : readonly string [ ] ;
1850
1797
}
1851
1798
1852
1799
export type NewFileContent = string | { readonly [ filename : string ] : string } ;
@@ -1912,18 +1859,29 @@ export interface MoveToNewFileOptions {
1912
1859
readonly preferences ?: ts . UserPreferences ;
1913
1860
}
1914
1861
1915
- export type RenameLocationsOptions = readonly RenameLocationOptions [ ] | {
1916
- readonly findInStrings ?: boolean ;
1917
- readonly findInComments ?: boolean ;
1918
- readonly ranges : readonly RenameLocationOptions [ ] ;
1919
- readonly providePrefixAndSuffixTextForRename ?: boolean ;
1920
- } ;
1921
1862
export interface DiagnosticIgnoredInterpolations {
1922
1863
template : string
1923
1864
}
1924
- export type RenameLocationOptions = FourSlash . Range | { readonly range : FourSlash . Range , readonly prefixText ?: string , readonly suffixText ?: string } ;
1925
1865
export interface RenameOptions {
1926
1866
readonly findInStrings ?: boolean ;
1927
1867
readonly findInComments ?: boolean ;
1928
1868
readonly providePrefixAndSuffixTextForRename ?: boolean ;
1929
1869
}
1870
+ export type BaselineCommand = {
1871
+ type : "findAllReferences" | "goToDefinition" | "getDefinitionAtPosition" | "goToSourceDefinition" | "goToType" | "goToImplementation" | "occurences" ;
1872
+ markerOrRange : ArrayOrSingle < FourSlash . MarkerOrNameOrRange > ;
1873
+ } | {
1874
+ type : "getFileReferences" ;
1875
+ fileName : ArrayOrSingle < string > ;
1876
+ } | {
1877
+ type : "findRenameLocations" ;
1878
+ markerOrRange : ArrayOrSingle < FourSlash . MarkerOrNameOrRange > ;
1879
+ options ?: RenameOptions ;
1880
+ } | {
1881
+ type : "documentHighlights" ;
1882
+ markerOrRange : ArrayOrSingle < FourSlash . MarkerOrNameOrRange > ;
1883
+ options ?: VerifyDocumentHighlightsOptions ;
1884
+ } | {
1885
+ type : "customWork" ;
1886
+ work : ( ) => string | undefined ;
1887
+ } ;
0 commit comments