@@ -210,7 +210,7 @@ export class Session {
210
210
const { configFileName} = this . projectService . openClientFile ( scriptInfo . fileName ) ;
211
211
if ( ! configFileName ) {
212
212
// Failed to find a config file. There is nothing we could do.
213
- this . connection . console . error ( `No config file for ${ scriptInfo . fileName } ` ) ;
213
+ this . error ( `No config file for ${ scriptInfo . fileName } ` ) ;
214
214
return ;
215
215
}
216
216
project = this . projectService . findProject ( configFileName ) ;
@@ -270,7 +270,7 @@ export class Session {
270
270
const { configFileName, configFileErrors} = result ;
271
271
if ( configFileErrors && configFileErrors . length ) {
272
272
// configFileErrors is an empty array even if there's no error, so check length.
273
- this . connection . console . error ( configFileErrors . map ( e => e . messageText ) . join ( '\n' ) ) ;
273
+ this . error ( configFileErrors . map ( e => e . messageText ) . join ( '\n' ) ) ;
274
274
}
275
275
if ( ! configFileName ) {
276
276
// It is not really an error if there is no config file, because the
@@ -284,7 +284,7 @@ export class Session {
284
284
}
285
285
const project = this . projectService . findProject ( configFileName ) ;
286
286
if ( ! project ) {
287
- this . connection . console . error ( `Failed to find project for ${ filePath } ` ) ;
287
+ this . error ( `Failed to find project for ${ filePath } ` ) ;
288
288
return ;
289
289
}
290
290
if ( project . languageServiceEnabled ) {
@@ -319,7 +319,7 @@ export class Session {
319
319
}
320
320
const scriptInfo = this . projectService . getScriptInfo ( filePath ) ;
321
321
if ( ! scriptInfo ) {
322
- this . connection . console . log ( `Failed to get script info for ${ filePath } ` ) ;
322
+ this . error ( `Failed to get script info for ${ filePath } ` ) ;
323
323
return ;
324
324
}
325
325
for ( const change of contentChanges ) {
@@ -415,7 +415,7 @@ export class Session {
415
415
const filePath = uriToFilePath ( textDocument . uri ) ;
416
416
const scriptInfo = this . projectService . getScriptInfo ( filePath ) ;
417
417
if ( ! scriptInfo ) {
418
- this . connection . console . log ( `Script info not found for ${ filePath } ` ) ;
418
+ this . error ( `Script info not found for ${ filePath } ` ) ;
419
419
return ;
420
420
}
421
421
@@ -528,35 +528,31 @@ export class Session {
528
528
const NG_CORE = '@angular/core/core.d.ts' ;
529
529
const { projectName} = project ;
530
530
if ( ! project . languageServiceEnabled ) {
531
- const msg = `Language service is already disabled for ${ projectName } . ` +
531
+ this . info (
532
+ `Language service is already disabled for ${ projectName } . ` +
532
533
`This could be due to non-TS files that exceeded the size limit (${
533
- ts . server . maxProgramSizeForNonTsFiles } bytes).` +
534
- `Please check log file for details.` ;
535
- this . connection . console . info ( msg ) ; // log to remote console to inform users
536
- project . log ( msg ) ; // log to file, so that it's easier to correlate with ts entries
534
+ ts . server . maxProgramSizeForNonTsFiles } bytes).` +
535
+ `Please check log file for details.` ) ;
537
536
538
537
return ;
539
538
}
540
539
if ( ! isAngularProject ( project , NG_CORE ) ) {
541
540
project . disableLanguageService ( ) ;
542
- const msg =
541
+ this . info (
543
542
`Disabling language service for ${ projectName } because it is not an Angular project ` +
544
543
`('${ NG_CORE } ' could not be found). ` +
545
- `If you believe you are seeing this message in error, please reinstall the packages in your package.json.` ;
546
- this . connection . console . info ( msg ) ;
547
- project . log ( msg ) ;
544
+ `If you believe you are seeing this message in error, please reinstall the packages in your package.json.` ) ;
545
+
548
546
if ( project . getExcludedFiles ( ) . some ( f => f . endsWith ( NG_CORE ) ) ) {
549
- const msg =
550
- `Please check your tsconfig.json to make sure 'node_modules' directory is not excluded.` ;
551
- this . connection . console . info ( msg ) ;
552
- project . log ( msg ) ;
547
+ this . info (
548
+ `Please check your tsconfig.json to make sure 'node_modules' directory is not excluded.` ) ;
553
549
}
554
550
555
551
return ;
556
552
}
557
553
558
554
// The language service should be enabled at this point.
559
- this . connection . console . info ( `Enabling language service for ${ projectName } .` ) ;
555
+ this . info ( `Enabling language service for ${ projectName } .` ) ;
560
556
}
561
557
}
562
558
0 commit comments