@@ -1859,17 +1859,41 @@ namespace FourSlash {
18591859
18601860 const unsatisfiedRanges : Range [ ] = [ ] ;
18611861
1862+ const delayedErrors : string [ ] = [ ] ;
18621863 for ( const range of ranges ) {
18631864 const length = range . end - range . start ;
18641865 const matchingImpl = ts . find ( implementations , impl =>
18651866 range . fileName === impl . fileName && range . start === impl . textSpan . start && length === impl . textSpan . length ) ;
18661867 if ( matchingImpl ) {
1868+ if ( range . marker && range . marker . data ) {
1869+ const expected = < { displayParts ?: ts . SymbolDisplayPart [ ] , parts : string [ ] , kind ?: string } > range . marker . data ;
1870+ if ( expected . displayParts ) {
1871+ if ( ! ts . arrayIsEqualTo ( expected . displayParts , matchingImpl . displayParts , displayPartIsEqualTo ) ) {
1872+ delayedErrors . push ( `Mismatched display parts: expected ${ JSON . stringify ( expected . displayParts ) } , actual ${ JSON . stringify ( matchingImpl . displayParts ) } ` ) ;
1873+ }
1874+ }
1875+ else if ( expected . parts ) {
1876+ const actualParts = matchingImpl . displayParts . map ( p => p . text ) ;
1877+ if ( ! ts . arrayIsEqualTo ( expected . parts , actualParts ) ) {
1878+ delayedErrors . push ( `Mismatched non-tagged display parts: expected ${ JSON . stringify ( expected . parts ) } , actual ${ JSON . stringify ( actualParts ) } ` ) ;
1879+ }
1880+ }
1881+ if ( expected . kind !== undefined ) {
1882+ if ( expected . kind !== matchingImpl . kind ) {
1883+ delayedErrors . push ( `Mismatched kind: expected ${ JSON . stringify ( expected . kind ) } , actual ${ JSON . stringify ( matchingImpl . kind ) } ` ) ;
1884+ }
1885+ }
1886+ }
1887+
18671888 matchingImpl . matched = true ;
18681889 }
18691890 else {
18701891 unsatisfiedRanges . push ( range ) ;
18711892 }
18721893 }
1894+ if ( delayedErrors . length ) {
1895+ this . raiseError ( delayedErrors . join ( "\n" ) ) ;
1896+ }
18731897
18741898 const unmatchedImplementations = implementations . filter ( impl => ! impl . matched ) ;
18751899 if ( unmatchedImplementations . length || unsatisfiedRanges . length ) {
@@ -1894,6 +1918,10 @@ namespace FourSlash {
18941918 function implementationsAreEqual ( a : ImplementationLocationInformation , b : ImplementationLocationInformation ) {
18951919 return a . fileName === b . fileName && TestState . textSpansEqual ( a . textSpan , b . textSpan ) ;
18961920 }
1921+
1922+ function displayPartIsEqualTo ( a : ts . SymbolDisplayPart , b : ts . SymbolDisplayPart ) : boolean {
1923+ return a . kind === b . kind && a . text === b . text ;
1924+ }
18971925 }
18981926
18991927 public getMarkers ( ) : Marker [ ] {
0 commit comments