@@ -1680,13 +1680,13 @@ namespace FourSlash {
1680
1680
assertFn ( actualCount , expectedCount , this . messageAtLastKnownMarker ( "Type definitions Count" ) ) ;
1681
1681
}
1682
1682
1683
- public verifyImplementationsCount ( negative : boolean , expectedCount : number ) {
1683
+ public verifyImplementationListIsEmpty ( negative : boolean ) {
1684
1684
const assertFn = negative ? assert . notEqual : assert . equal ;
1685
1685
1686
1686
const implementations = this . languageService . getImplementationAtPosition ( this . activeFile . fileName , this . currentCaretPosition ) ;
1687
1687
const actualCount = implementations && implementations . length || 0 ;
1688
1688
1689
- assertFn ( actualCount , expectedCount , this . messageAtLastKnownMarker ( "Implementations Count" ) ) ;
1689
+ assertFn ( actualCount , 0 , this . messageAtLastKnownMarker ( "Implementations Count" ) ) ;
1690
1690
}
1691
1691
1692
1692
public verifyGoToDefinitionName ( expectedName : string , expectedContainerName : string ) {
@@ -1697,26 +1697,22 @@ namespace FourSlash {
1697
1697
assert . equal ( actualDefinitionContainerName , expectedContainerName , this . messageAtLastKnownMarker ( "Definition Info Container Name" ) ) ;
1698
1698
}
1699
1699
1700
- public goToImplementation ( implIndex ?: number ) {
1700
+ public goToImplementation ( ) {
1701
1701
const implementations = this . languageService . getImplementationAtPosition ( this . activeFile . fileName , this . currentCaretPosition ) ;
1702
1702
if ( ! implementations || ! implementations . length ) {
1703
1703
this . raiseError ( "goToImplementation failed - expected to find at least one implementation location but got 0" ) ;
1704
1704
}
1705
-
1706
- if ( implIndex === undefined && implementations . length > 1 ) {
1707
- this . raiseError ( `goToImplementation failed - no index given but more than 1 implementation returned (${ implementations . length } )` ) ;
1708
- }
1709
-
1710
- if ( implIndex >= implementations . length ) {
1711
- this . raiseError ( `goToImplementation failed - implIndex value (${ implIndex } ) exceeds implementation list size (${ implementations . length } )` ) ;
1705
+ if ( implementations . length > 1 ) {
1706
+ this . raiseError ( `goToImplementation failed - more than 1 implementation returned (${ implementations . length } )` ) ;
1712
1707
}
1713
1708
1714
- const implementation = implementations [ implIndex || 0 ] ;
1709
+ const implementation = implementations [ 0 ] ;
1715
1710
this . openFile ( implementation . fileName ) ;
1716
1711
this . currentCaretPosition = implementation . textSpan . start ;
1717
1712
}
1718
1713
1719
- public verifyRangesInImplementationList ( ) {
1714
+ public verifyRangesInImplementationList ( markerName : string ) {
1715
+ this . goToMarker ( markerName ) ;
1720
1716
const implementations : ImplementationLocationInformation [ ] = this . languageService . getImplementationAtPosition ( this . activeFile . fileName , this . currentCaretPosition ) ;
1721
1717
if ( ! implementations || ! implementations . length ) {
1722
1718
this . raiseError ( "verifyRangesInImplementationList failed - expected to find at least one implementation location but got 0" ) ;
@@ -2954,8 +2950,8 @@ namespace FourSlashInterface {
2954
2950
this . state . goToTypeDefinition ( definitionIndex ) ;
2955
2951
}
2956
2952
2957
- public implementation ( implementationIndex ?: number ) {
2958
- this . state . goToImplementation ( implementationIndex ) ;
2953
+ public implementation ( ) {
2954
+ this . state . goToImplementation ( ) ;
2959
2955
}
2960
2956
2961
2957
public position ( position : number , fileIndex ?: number ) : void ;
@@ -3062,8 +3058,8 @@ namespace FourSlashInterface {
3062
3058
this . state . verifyTypeDefinitionsCount ( this . negative , expectedCount ) ;
3063
3059
}
3064
3060
3065
- public implementationCountIs ( expectedCount : number ) {
3066
- this . state . verifyImplementationsCount ( this . negative , expectedCount ) ;
3061
+ public implementationListIsEmpty ( ) {
3062
+ this . state . verifyImplementationListIsEmpty ( this . negative ) ;
3067
3063
}
3068
3064
3069
3065
public isValidBraceCompletionAtPosition ( openingBrace : string ) {
@@ -3319,8 +3315,8 @@ namespace FourSlashInterface {
3319
3315
this . state . verifyProjectInfo ( expected ) ;
3320
3316
}
3321
3317
3322
- public allRangesAppearInImplementationList ( ) {
3323
- this . state . verifyRangesInImplementationList ( ) ;
3318
+ public allRangesAppearInImplementationList ( markerName : string ) {
3319
+ this . state . verifyRangesInImplementationList ( markerName ) ;
3324
3320
}
3325
3321
}
3326
3322
0 commit comments