@@ -520,8 +520,10 @@ namespace ts.server {
520
520
}
521
521
522
522
private onConfigChangedForConfiguredProject ( project : ConfiguredProject ) {
523
- this . logger . info ( `Config file changed: ${ project . getConfigFilePath ( ) } ` ) ;
524
- this . updateConfiguredProject ( project ) ;
523
+ const configFileName = project . getConfigFilePath ( ) ;
524
+ this . logger . info ( `Config file changed: ${ configFileName } ` ) ;
525
+ const configFileErrors = this . updateConfiguredProject ( project ) ;
526
+ this . reportConfigFileDiagnostics ( configFileName , configFileErrors , /*triggerFile*/ configFileName ) ;
525
527
this . refreshInferredProjects ( ) ;
526
528
}
527
529
@@ -1015,6 +1017,9 @@ namespace ts.server {
1015
1017
return ;
1016
1018
}
1017
1019
1020
+ // note: the returned "success" is true does not mean the "configFileErrors" is empty.
1021
+ // because we might have tolerated the errors and kept going. So always return the configFileErrors
1022
+ // regardless the "success" here is true or not.
1018
1023
const { success, projectOptions, configFileErrors } = this . convertConfigFileContentToProjectOptions ( project . getConfigFilePath ( ) ) ;
1019
1024
if ( ! success ) {
1020
1025
// reset project settings to default
@@ -1026,7 +1031,7 @@ namespace ts.server {
1026
1031
project . setCompilerOptions ( projectOptions . compilerOptions ) ;
1027
1032
if ( ! project . languageServiceEnabled ) {
1028
1033
// language service is already disabled
1029
- return ;
1034
+ return configFileErrors ;
1030
1035
}
1031
1036
project . disableLanguageService ( ) ;
1032
1037
project . stopWatchingDirectory ( ) ;
@@ -1038,6 +1043,7 @@ namespace ts.server {
1038
1043
this . watchConfigDirectoryForProject ( project , projectOptions ) ;
1039
1044
this . updateNonInferredProject ( project , projectOptions . files , fileNamePropertyReader , projectOptions . compilerOptions , projectOptions . typingOptions , projectOptions . compileOnSave , configFileErrors ) ;
1040
1045
}
1046
+ return configFileErrors ;
1041
1047
}
1042
1048
1043
1049
createInferredProjectWithRootFileIfNecessary ( root : ScriptInfo ) {
0 commit comments