@@ -520,8 +520,10 @@ namespace ts.server {
520520 }
521521
522522 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 ) ;
525527 this . refreshInferredProjects ( ) ;
526528 }
527529
@@ -1015,6 +1017,9 @@ namespace ts.server {
10151017 return ;
10161018 }
10171019
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.
10181023 const { success, projectOptions, configFileErrors } = this . convertConfigFileContentToProjectOptions ( project . getConfigFilePath ( ) ) ;
10191024 if ( ! success ) {
10201025 // reset project settings to default
@@ -1026,7 +1031,7 @@ namespace ts.server {
10261031 project . setCompilerOptions ( projectOptions . compilerOptions ) ;
10271032 if ( ! project . languageServiceEnabled ) {
10281033 // language service is already disabled
1029- return ;
1034+ return configFileErrors ;
10301035 }
10311036 project . disableLanguageService ( ) ;
10321037 project . stopWatchingDirectory ( ) ;
@@ -1038,6 +1043,7 @@ namespace ts.server {
10381043 this . watchConfigDirectoryForProject ( project , projectOptions ) ;
10391044 this . updateNonInferredProject ( project , projectOptions . files , fileNamePropertyReader , projectOptions . compilerOptions , projectOptions . typingOptions , projectOptions . compileOnSave , configFileErrors ) ;
10401045 }
1046+ return configFileErrors ;
10411047 }
10421048
10431049 createInferredProjectWithRootFileIfNecessary ( root : ScriptInfo ) {
0 commit comments