@@ -22,7 +22,7 @@ namespace ts.server {
2222
2323 export interface ConfigFileDiagEvent {
2424 eventName : typeof ConfigFileDiagEvent ;
25- data : { triggerFile : string , configFileName : string , diagnostics : Diagnostic [ ] } ;
25+ data : { triggerFile : string , configFileName : string , diagnostics : ReadonlyArray < Diagnostic > } ;
2626 }
2727
2828 export interface ProjectLanguageServiceStateEvent {
@@ -200,7 +200,7 @@ namespace ts.server {
200200 /**
201201 * This helper function processes a list of projects and return the concatenated, sortd and deduplicated output of processing each project.
202202 */
203- export function combineProjectOutput < T > ( projects : Project [ ] , action : ( project : Project ) => T [ ] , comparer ?: ( a : T , b : T ) => number , areEqual ?: ( a : T , b : T ) => boolean ) {
203+ export function combineProjectOutput < T > ( projects : ReadonlyArray < Project > , action : ( project : Project ) => ReadonlyArray < T > , comparer ?: ( a : T , b : T ) => number , areEqual ?: ( a : T , b : T ) => boolean ) {
204204 const result = flatMap ( projects , action ) . sort ( comparer ) ;
205205 return projects . length > 1 ? deduplicate ( result , areEqual ) : result ;
206206 }
@@ -220,14 +220,14 @@ namespace ts.server {
220220
221221 interface OpenConfigFileResult {
222222 success : boolean ;
223- errors ?: Diagnostic [ ] ;
223+ errors ?: ReadonlyArray < Diagnostic > ;
224224
225225 project ?: ConfiguredProject ;
226226 }
227227
228228 export interface OpenConfiguredProjectResult {
229229 configFileName ?: NormalizedPath ;
230- configFileErrors ?: Diagnostic [ ] ;
230+ configFileErrors ?: ReadonlyArray < Diagnostic > ;
231231 }
232232
233233 interface FilePropertyReader < T > {
@@ -1100,18 +1100,18 @@ namespace ts.server {
11001100 }
11011101 }
11021102
1103- private reportConfigFileDiagnostics ( configFileName : string , diagnostics : Diagnostic [ ] , triggerFile : string ) {
1103+ private reportConfigFileDiagnostics ( configFileName : string , diagnostics : ReadonlyArray < Diagnostic > , triggerFile : string ) {
11041104 if ( ! this . eventHandler ) {
11051105 return ;
11061106 }
11071107
11081108 this . eventHandler ( < ConfigFileDiagEvent > {
11091109 eventName : ConfigFileDiagEvent ,
1110- data : { configFileName, diagnostics : diagnostics || [ ] , triggerFile }
1110+ data : { configFileName, diagnostics : diagnostics || emptyArray , triggerFile }
11111111 } ) ;
11121112 }
11131113
1114- private createAndAddConfiguredProject ( configFileName : NormalizedPath , projectOptions : ProjectOptions , configFileErrors : Diagnostic [ ] , clientFileName ?: string ) {
1114+ private createAndAddConfiguredProject ( configFileName : NormalizedPath , projectOptions : ProjectOptions , configFileErrors : ReadonlyArray < Diagnostic > , clientFileName ?: string ) {
11151115 const sizeLimitExceeded = this . exceededTotalSizeLimitForNonTsFiles ( configFileName , projectOptions . compilerOptions , projectOptions . files , fileNamePropertyReader ) ;
11161116 const project = new ConfiguredProject (
11171117 configFileName ,
@@ -1143,7 +1143,7 @@ namespace ts.server {
11431143 }
11441144 }
11451145
1146- private addFilesToProjectAndUpdateGraph < T > ( project : ConfiguredProject | ExternalProject , files : T [ ] , propertyReader : FilePropertyReader < T > , clientFileName : string , typeAcquisition : TypeAcquisition , configFileErrors : Diagnostic [ ] ) : void {
1146+ private addFilesToProjectAndUpdateGraph < T > ( project : ConfiguredProject | ExternalProject , files : T [ ] , propertyReader : FilePropertyReader < T > , clientFileName : string , typeAcquisition : TypeAcquisition , configFileErrors : ReadonlyArray < Diagnostic > ) : void {
11471147 let errors : Diagnostic [ ] ;
11481148 for ( const f of files ) {
11491149 const rootFilename = propertyReader . getFileName ( f ) ;
@@ -1456,7 +1456,7 @@ namespace ts.server {
14561456
14571457 openClientFileWithNormalizedPath ( fileName : NormalizedPath , fileContent ?: string , scriptKind ?: ScriptKind , hasMixedContent ?: boolean , projectRootPath ?: NormalizedPath ) : OpenConfiguredProjectResult {
14581458 let configFileName : NormalizedPath ;
1459- let configFileErrors : Diagnostic [ ] ;
1459+ let configFileErrors : ReadonlyArray < Diagnostic > ;
14601460
14611461 let project : ConfiguredProject | ExternalProject = this . findContainingExternalProject ( fileName ) ;
14621462 if ( ! project ) {
0 commit comments