@@ -536,11 +536,16 @@ namespace FourSlash {
536536 Harness . IO . log ( "Unexpected error(s) found. Error list is:" ) ;
537537 }
538538
539- for ( const { start, length, messageText } of errors ) {
540- Harness . IO . log ( " minChar : " + start +
541- ", limChar : " + ( start + length ) +
539+ for ( const { start, length, messageText, file } of errors ) {
540+ Harness . IO . log ( " from : " + showPosition ( file , start ) +
541+ ", to : " + showPosition ( file , start + length ) +
542542 ", message: " + ts . flattenDiagnosticMessageText ( messageText , Harness . IO . newLine ( ) ) + "\n" ) ;
543543 }
544+
545+ function showPosition ( file : ts . SourceFile , pos : number ) {
546+ const { line, character } = ts . getLineAndCharacterOfPosition ( file , pos ) ;
547+ return `${ line } :${ character } ` ;
548+ }
544549 }
545550
546551 public verifyNoErrors ( ) {
@@ -2671,6 +2676,13 @@ namespace FourSlash {
26712676 this . rangesByText ( ) . forEach ( ranges => this . verifyRangesAreDocumentHighlights ( ranges ) ) ;
26722677 }
26732678
2679+ public verifyDocumentHighlightsOf ( startRange : Range , ranges : Range [ ] ) {
2680+ ts . Debug . assert ( ts . contains ( ranges , startRange ) ) ;
2681+ const fileNames = unique ( ranges , range => range . fileName ) ;
2682+ this . goToRangeStart ( startRange ) ;
2683+ this . verifyDocumentHighlights ( ranges , fileNames ) ;
2684+ }
2685+
26742686 public verifyRangesAreDocumentHighlights ( ranges ?: Range [ ] ) {
26752687 ranges = ranges || this . getRanges ( ) ;
26762688 const fileNames = unique ( ranges , range => range . fileName ) ;
@@ -3885,6 +3897,10 @@ namespace FourSlashInterface {
38853897 this . state . verifyRangesWithSameTextAreDocumentHighlights ( ) ;
38863898 }
38873899
3900+ public documentHighlightsOf ( startRange : FourSlash . Range , ranges : FourSlash . Range [ ] ) {
3901+ this . state . verifyDocumentHighlightsOf ( startRange , ranges ) ;
3902+ }
3903+
38883904 public completionEntryDetailIs ( entryName : string , text : string , documentation ?: string , kind ?: string , tags ?: ts . JSDocTagInfo [ ] ) {
38893905 this . state . verifyCompletionEntryDetails ( entryName , text , documentation , kind , tags ) ;
38903906 }
0 commit comments