@@ -108,7 +108,6 @@ import {
108108 TypeParameter ,
109109 typeToDisplayParts ,
110110 VariableDeclaration ,
111- WriterContextOut ,
112111} from "./_namespaces/ts.js" ;
113112
114113const symbolDisplayNodeBuilderFlags = NodeBuilderFlags . OmitParameterModifiers | NodeBuilderFlags . IgnoreErrors | NodeBuilderFlags . UseAliasDefinedOutsideCurrentScope ;
@@ -255,20 +254,9 @@ export interface SymbolDisplayPartsDocumentationAndSymbolKind {
255254 documentation : SymbolDisplayPart [ ] ;
256255 symbolKind : ScriptElementKind ;
257256 tags : JSDocTagInfo [ ] | undefined ;
258- canIncreaseVerbosityLevel ?: boolean ;
259257}
260258
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 {
272260 const displayParts : SymbolDisplayPart [ ] = [ ] ;
273261 let documentation : SymbolDisplayPart [ ] = [ ] ;
274262 let tags : JSDocTagInfo [ ] = [ ] ;
@@ -279,7 +267,6 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
279267 let documentationFromAlias : SymbolDisplayPart [ ] | undefined ;
280268 let tagsFromAlias : JSDocTagInfo [ ] | undefined ;
281269 let hasMultipleSignatures = false ;
282- const typeWriterOut : WriterContextOut | undefined = verbosityLevel !== undefined ? { couldUnfoldMore : false } : undefined ;
283270
284271 if ( location . kind === SyntaxKind . ThisKeyword && ! isThisExpression ) {
285272 return { displayParts : [ keywordPart ( SyntaxKind . ThisKeyword ) ] , documentation : [ ] , symbolKind : ScriptElementKind . primitiveType , tags : undefined } ;
@@ -475,17 +462,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
475462 displayParts . push ( spacePart ( ) ) ;
476463 displayParts . push ( operatorPart ( SyntaxKind . EqualsToken ) ) ;
477464 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 ) ) ;
489466 }
490467 if ( symbolFlags & SymbolFlags . Enum ) {
491468 prefixNextMeaning ( ) ;
@@ -673,30 +650,13 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
673650 // If the type is type parameter, format it specially
674651 if ( type . symbol && type . symbol . flags & SymbolFlags . TypeParameter && symbolKind !== ScriptElementKind . indexSignatureElement ) {
675652 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 ) ! ;
684654 getPrinter ( ) . writeNode ( EmitHint . Unspecified , param , getSourceFileOfNode ( getParseTreeNode ( enclosingDeclaration ) ) , writer ) ;
685655 } ) ;
686656 addRange ( displayParts , typeParameterParts ) ;
687657 }
688658 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 ) ) ;
700660 }
701661 if ( isTransientSymbol ( symbol ) && symbol . links . target && isTransientSymbol ( symbol . links . target ) && symbol . links . target . links . tupleLabelDeclaration ) {
702662 const labelDecl = symbol . links . target . links . tupleLabelDeclaration ;
@@ -782,13 +742,7 @@ function getSymbolDisplayPartsDocumentationAndSymbolKindWorker(
782742 tags = tagsFromAlias ;
783743 }
784744
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 } ;
792746
793747 function getPrinter ( ) {
794748 return createPrinterWithRemoveComments ( ) ;
@@ -920,9 +874,8 @@ export function getSymbolDisplayPartsDocumentationAndSymbolKind(
920874 location : Node ,
921875 semanticMeaning : SemanticMeaning = getMeaningFromLocation ( location ) ,
922876 alias ?: Symbol ,
923- verbosityLevel ?: number ,
924877) : 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 ) ;
926879}
927880
928881function isLocalVariableOrFunction ( symbol : Symbol ) {
0 commit comments