@@ -108,7 +108,6 @@ import {
108
108
TypeParameter ,
109
109
typeToDisplayParts ,
110
110
VariableDeclaration ,
111
- WriterContextOut ,
112
111
} from "./_namespaces/ts.js" ;
113
112
114
113
const symbolDisplayNodeBuilderFlags = NodeBuilderFlags . OmitParameterModifiers | NodeBuilderFlags . IgnoreErrors | NodeBuilderFlags . UseAliasDefinedOutsideCurrentScope ;
@@ -255,20 +254,9 @@ export interface SymbolDisplayPartsDocumentationAndSymbolKind {
255
254
documentation : SymbolDisplayPart [ ] ;
256
255
symbolKind : ScriptElementKind ;
257
256
tags : JSDocTagInfo [ ] | undefined ;
258
- canIncreaseVerbosityLevel ?: boolean ;
259
257
}
260
258
261
- function getSymbolDisplayPartsDocumentationAndSymbolKindWorker (
262
- typeChecker : TypeChecker ,
263
- symbol : Symbol ,
264
- sourceFile : SourceFile ,
265
- enclosingDeclaration : Node | undefined ,
266
- location : Node ,
267
- type : Type | undefined ,
268
- semanticMeaning : SemanticMeaning ,
269
- alias ?: Symbol ,
270
- verbosityLevel ?: number ,
271
- ) : SymbolDisplayPartsDocumentationAndSymbolKind {
259
+ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker ( typeChecker : TypeChecker , symbol : Symbol , sourceFile : SourceFile , enclosingDeclaration : Node | undefined , location : Node , type : Type | undefined , semanticMeaning : SemanticMeaning , alias ?: Symbol ) : SymbolDisplayPartsDocumentationAndSymbolKind {
272
260
const displayParts : SymbolDisplayPart [ ] = [ ] ;
273
261
let documentation : SymbolDisplayPart [ ] = [ ] ;
274
262
let tags : JSDocTagInfo [ ] = [ ] ;
@@ -279,7 +267,6 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
279
267
let documentationFromAlias : SymbolDisplayPart [ ] | undefined ;
280
268
let tagsFromAlias : JSDocTagInfo [ ] | undefined ;
281
269
let hasMultipleSignatures = false ;
282
- const typeWriterOut : WriterContextOut | undefined = verbosityLevel !== undefined ? { couldUnfoldMore : false } : undefined ;
283
270
284
271
if ( location . kind === SyntaxKind . ThisKeyword && ! isThisExpression ) {
285
272
return { displayParts : [ keywordPart ( SyntaxKind . ThisKeyword ) ] , documentation : [ ] , symbolKind : ScriptElementKind . primitiveType , tags : undefined } ;
@@ -475,17 +462,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
475
462
displayParts . push ( spacePart ( ) ) ;
476
463
displayParts . push ( operatorPart ( SyntaxKind . EqualsToken ) ) ;
477
464
displayParts . push ( spacePart ( ) ) ;
478
- addRange (
479
- displayParts ,
480
- typeToDisplayParts (
481
- typeChecker ,
482
- location . parent && isConstTypeReference ( location . parent ) ? typeChecker . getTypeAtLocation ( location . parent ) : typeChecker . getDeclaredTypeOfSymbol ( symbol ) ,
483
- enclosingDeclaration ,
484
- TypeFormatFlags . InTypeAlias ,
485
- verbosityLevel ,
486
- typeWriterOut ,
487
- ) ,
488
- ) ;
465
+ addRange ( displayParts , typeToDisplayParts ( typeChecker , location . parent && isConstTypeReference ( location . parent ) ? typeChecker . getTypeAtLocation ( location . parent ) : typeChecker . getDeclaredTypeOfSymbol ( symbol ) , enclosingDeclaration , TypeFormatFlags . InTypeAlias ) ) ;
489
466
}
490
467
if ( symbolFlags & SymbolFlags . Enum ) {
491
468
prefixNextMeaning ( ) ;
@@ -673,30 +650,13 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
673
650
// If the type is type parameter, format it specially
674
651
if ( type . symbol && type . symbol . flags & SymbolFlags . TypeParameter && symbolKind !== ScriptElementKind . indexSignatureElement ) {
675
652
const typeParameterParts = mapToDisplayParts ( writer => {
676
- const param = typeChecker . typeParameterToDeclaration (
677
- type as TypeParameter ,
678
- enclosingDeclaration ,
679
- symbolDisplayNodeBuilderFlags ,
680
- /*internalFlags*/ undefined ,
681
- /*tracker*/ undefined ,
682
- verbosityLevel ,
683
- ) ! ;
653
+ const param = typeChecker . typeParameterToDeclaration ( type as TypeParameter , enclosingDeclaration , symbolDisplayNodeBuilderFlags ) ! ;
684
654
getPrinter ( ) . writeNode ( EmitHint . Unspecified , param , getSourceFileOfNode ( getParseTreeNode ( enclosingDeclaration ) ) , writer ) ;
685
655
} ) ;
686
656
addRange ( displayParts , typeParameterParts ) ;
687
657
}
688
658
else {
689
- addRange (
690
- displayParts ,
691
- typeToDisplayParts (
692
- typeChecker ,
693
- type ,
694
- enclosingDeclaration ,
695
- /*flags*/ undefined ,
696
- verbosityLevel ,
697
- typeWriterOut ,
698
- ) ,
699
- ) ;
659
+ addRange ( displayParts , typeToDisplayParts ( typeChecker , type , enclosingDeclaration ) ) ;
700
660
}
701
661
if ( isTransientSymbol ( symbol ) && symbol . links . target && isTransientSymbol ( symbol . links . target ) && symbol . links . target . links . tupleLabelDeclaration ) {
702
662
const labelDecl = symbol . links . target . links . tupleLabelDeclaration ;
@@ -782,13 +742,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
782
742
tags = tagsFromAlias ;
783
743
}
784
744
785
- return {
786
- displayParts,
787
- documentation,
788
- symbolKind,
789
- tags : tags . length === 0 ? undefined : tags ,
790
- canIncreaseVerbosityLevel : typeWriterOut ?. couldUnfoldMore ,
791
- } ;
745
+ return { displayParts, documentation, symbolKind, tags : tags . length === 0 ? undefined : tags } ;
792
746
793
747
function getPrinter ( ) {
794
748
return createPrinterWithRemoveComments ( ) ;
@@ -920,9 +874,8 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(
920
874
location : Node ,
921
875
semanticMeaning : SemanticMeaning = getMeaningFromLocation ( location ) ,
922
876
alias ?: Symbol ,
923
- verbosityLevel ?: number ,
924
877
) : SymbolDisplayPartsDocumentationAndSymbolKind {
925
- return getSymbolDisplayPartsDocumentationAndSymbolKindWorker ( typeChecker , symbol , sourceFile , enclosingDeclaration , location , /*type*/ undefined , semanticMeaning , alias , verbosityLevel ) ;
878
+ return getSymbolDisplayPartsDocumentationAndSymbolKindWorker ( typeChecker , symbol , sourceFile , enclosingDeclaration , location , /*type*/ undefined , semanticMeaning , alias ) ;
926
879
}
927
880
928
881
function isLocalVariableOrFunction ( symbol : Symbol ) {
0 commit comments