@@ -1700,7 +1700,7 @@ namespace FourSlash {
1700
1700
public goToImplementation ( implIndex ?: number ) {
1701
1701
const implementations = this . languageService . getImplementationAtPosition ( this . activeFile . fileName , this . currentCaretPosition ) ;
1702
1702
if ( ! implementations || ! implementations . length ) {
1703
- this . raiseError ( "goToImplementation failed - expected to at least one implementation location but got 0" ) ;
1703
+ this . raiseError ( "goToImplementation failed - expected to find at least one implementation location but got 0" ) ;
1704
1704
}
1705
1705
1706
1706
if ( implIndex === undefined && implementations . length > 1 ) {
@@ -1719,7 +1719,7 @@ namespace FourSlash {
1719
1719
public verifyRangesInImplementationList ( ) {
1720
1720
const implementations : ImplementationLocationInformation [ ] = this . languageService . getImplementationAtPosition ( this . activeFile . fileName , this . currentCaretPosition ) ;
1721
1721
if ( ! implementations || ! implementations . length ) {
1722
- this . raiseError ( "verifyRangesInImplementationList failed - expected to at least one implementation location but got 0" ) ;
1722
+ this . raiseError ( "verifyRangesInImplementationList failed - expected to find at least one implementation location but got 0" ) ;
1723
1723
}
1724
1724
1725
1725
for ( let i = 0 ; i < implementations . length ; i ++ ) {
@@ -1735,22 +1735,19 @@ namespace FourSlash {
1735
1735
const ranges = this . getRanges ( ) ;
1736
1736
1737
1737
if ( ! ranges || ! ranges . length ) {
1738
- this . raiseError ( "verifyRangesInImplementationList failed - expected to at least one range in test source" ) ;
1738
+ this . raiseError ( "verifyRangesInImplementationList failed - expected to find at least one range in test source" ) ;
1739
1739
}
1740
1740
1741
1741
const unsatisfiedRanges : Range [ ] = [ ] ;
1742
1742
1743
1743
for ( const range of ranges ) {
1744
- let rangeIsPresent = false ;
1745
1744
const length = range . end - range . start ;
1746
- for ( const impl of implementations ) {
1747
- if ( range . fileName === impl . fileName && range . start === impl . textSpan . start && length === impl . textSpan . length ) {
1748
- impl . matched = true ;
1749
- rangeIsPresent = true ;
1750
- break ;
1751
- }
1745
+ const matchingImpl = ts . find ( implementations , impl =>
1746
+ range . fileName === impl . fileName && range . start === impl . textSpan . start && length === impl . textSpan . length ) ;
1747
+ if ( matchingImpl ) {
1748
+ matchingImpl . matched = true ;
1752
1749
}
1753
- if ( ! rangeIsPresent ) {
1750
+ else {
1754
1751
unsatisfiedRanges . push ( range ) ;
1755
1752
}
1756
1753
}
@@ -1765,7 +1762,7 @@ namespace FourSlash {
1765
1762
}
1766
1763
}
1767
1764
1768
- if ( unsatisfiedRanges . length ) {
1765
+ if ( unmatchedImplementations . length ) {
1769
1766
error += "\nUnmatched implementations:" ;
1770
1767
for ( const impl of unmatchedImplementations ) {
1771
1768
const end = impl . textSpan . start + impl . textSpan . length ;
0 commit comments