@@ -1587,7 +1587,9 @@ namespace ts {
1587
1587
kind : ScriptElementKind . unknown ,
1588
1588
kindModifiers : ScriptElementKindModifier . none ,
1589
1589
textSpan : createTextSpanFromNode ( nodeForQuickInfo , sourceFile ) ,
1590
- displayParts : typeChecker . runWithCancellationToken ( cancellationToken , typeChecker => typeToDisplayParts ( typeChecker , type , getContainerNode ( nodeForQuickInfo ) ) ) ,
1590
+ displayParts : prefixWithApproximation (
1591
+ typeChecker . runWithCancellationToken ( cancellationToken , typeChecker => typeToDisplayParts ( typeChecker , type , getContainerNode ( nodeForQuickInfo ) ) )
1592
+ ) ,
1591
1593
documentation : type . symbol ? type . symbol . getDocumentationComment ( typeChecker ) : undefined ,
1592
1594
tags : type . symbol ? type . symbol . getJsDocTags ( ) : undefined
1593
1595
} ;
@@ -1600,7 +1602,7 @@ namespace ts {
1600
1602
kind : symbolKind ,
1601
1603
kindModifiers : SymbolDisplay . getSymbolModifiers ( symbol ) ,
1602
1604
textSpan : createTextSpanFromNode ( nodeForQuickInfo , sourceFile ) ,
1603
- displayParts,
1605
+ displayParts : prefixWithApproximation ( displayParts ) ,
1604
1606
documentation,
1605
1607
tags,
1606
1608
} ;
@@ -1630,6 +1632,13 @@ namespace ts {
1630
1632
}
1631
1633
}
1632
1634
1635
+ function prefixWithApproximation ( displayParts : SymbolDisplayPart [ ] ) : SymbolDisplayPart [ ] {
1636
+ if ( languageServiceMode === LanguageServiceMode . Semantic ) {
1637
+ return displayParts ;
1638
+ }
1639
+ return [ textPart ( "(approximation)" ) , spacePart ( ) , ...displayParts ] ;
1640
+ }
1641
+
1633
1642
/// Goto definition
1634
1643
function getDefinitionAtPosition ( fileName : string , position : number ) : readonly DefinitionInfo [ ] | undefined {
1635
1644
synchronizeHostData ( ) ;
0 commit comments