1
1
/* @internal */
2
2
namespace ts {
3
3
export interface CodeFixRegistration {
4
- errorCodes : number [ ] ;
4
+ errorCodes : ReadonlyArray < number > ;
5
5
getCodeActions ( context : CodeFixContext ) : CodeFixAction [ ] | undefined ;
6
- fixIds ?: string [ ] ;
6
+ fixIds ?: ReadonlyArray < string > ;
7
7
getAllCodeActions ?( context : CodeFixAllContext ) : CombinedCodeActions ;
8
8
}
9
9
@@ -27,7 +27,7 @@ namespace ts {
27
27
const errorCodeToFixes = createMultiMap < CodeFixRegistration > ( ) ;
28
28
const fixIdToRegistration = createMap < CodeFixRegistration > ( ) ;
29
29
30
- type DiagnosticAndArguments = DiagnosticMessage | [ DiagnosticMessage , string ] | [ DiagnosticMessage , string , string ] ;
30
+ export type DiagnosticAndArguments = DiagnosticMessage | [ DiagnosticMessage , string ] | [ DiagnosticMessage , string , string ] ;
31
31
function diagnosticToString ( diag : DiagnosticAndArguments ) : string {
32
32
return isArray ( diag )
33
33
? formatStringFromArgs ( getLocaleSpecificMessage ( diag [ 0 ] ) , diag . slice ( 1 ) as ReadonlyArray < string > )
@@ -89,7 +89,7 @@ namespace ts {
89
89
return createCombinedCodeActions ( changes , commands . length === 0 ? undefined : commands ) ;
90
90
}
91
91
92
- export function eachDiagnostic ( { program, sourceFile, cancellationToken } : CodeFixAllContext , errorCodes : number [ ] , cb : ( diag : DiagnosticWithLocation ) => void ) : void {
92
+ export function eachDiagnostic ( { program, sourceFile, cancellationToken } : CodeFixAllContext , errorCodes : ReadonlyArray < number > , cb : ( diag : DiagnosticWithLocation ) => void ) : void {
93
93
for ( const diag of program . getSemanticDiagnostics ( sourceFile , cancellationToken ) . concat ( computeSuggestionDiagnostics ( sourceFile , program , cancellationToken ) ) ) {
94
94
if ( contains ( errorCodes , diag . code ) ) {
95
95
cb ( diag as DiagnosticWithLocation ) ;
0 commit comments