@@ -29,7 +29,7 @@ namespace ts.codefix {
2929 // Note that this is ultimately derived from a map indexed by symbol names,
3030 // so duplicates cannot occur.
3131 const implementedTypeSymbols = checker . getPropertiesOfType ( implementedType ) ;
32- const nonPrivateMembers = implementedTypeSymbols . filter ( symbolRefersToNonPrivateMember ) ;
32+ const nonPrivateMembers = implementedTypeSymbols . filter ( symbol => ! ( getModifierFlags ( symbol . valueDeclaration ) & ModifierFlags . Private ) ) ;
3333
3434 let insertion = getMissingIndexSignatureInsertion ( implementedType , IndexKind . Number , classDecl , hasNumericIndexSignature ) ;
3535 insertion += getMissingIndexSignatureInsertion ( implementedType , IndexKind . String , classDecl , hasStringIndexSignature ) ;
@@ -47,18 +47,17 @@ namespace ts.codefix {
4747 if ( ! hasIndexSigOfKind ) {
4848 const IndexInfoOfKind = checker . getIndexInfoOfType ( type , kind ) ;
4949 if ( IndexInfoOfKind ) {
50- return checker . indexSignatureToString ( IndexInfoOfKind , kind , enclosingDeclaration ) ;
50+ const writer = getSingleLineStringWriter ( ) ;
51+ checker . getSymbolDisplayBuilder ( ) . buildIndexSignatureDisplay ( IndexInfoOfKind , writer , kind , enclosingDeclaration ) ;
52+ const result = writer . string ( ) ;
53+ releaseStringWriter ( writer ) ;
54+
55+ return result ;
5156 }
5257 }
5358 return "" ;
5459 }
5560
56- function symbolRefersToNonPrivateMember ( symbol : Symbol ) : boolean {
57- const decls = symbol . getDeclarations ( ) ;
58- Debug . assert ( ! ! ( decls && decls . length > 0 ) ) ;
59- return ! ( getModifierFlags ( decls [ 0 ] ) & ModifierFlags . Private ) ;
60- }
61-
6261 function pushAction ( result : CodeAction [ ] , insertion : string , description : string ) : void {
6362 const newAction : CodeAction = {
6463 description : description ,
0 commit comments