@@ -14,12 +14,13 @@ import (
1414)
1515
1616type Watcher struct {
17- sys tsc.System
18- configFileName string
19- config * tsoptions.ParsedCommandLine
20- reportDiagnostic tsc.DiagnosticReporter
21- reportErrorSummary tsc.DiagnosticsReporter
22- testing tsc.CommandLineTesting
17+ sys tsc.System
18+ configFileName string
19+ config * tsoptions.ParsedCommandLine
20+ compilerOptionsFromCommandLine * core.CompilerOptions
21+ reportDiagnostic tsc.DiagnosticReporter
22+ reportErrorSummary tsc.DiagnosticsReporter
23+ testing tsc.CommandLineTesting
2324
2425 host compiler.CompilerHost
2526 program * incremental.Program
@@ -29,13 +30,21 @@ type Watcher struct {
2930
3031var _ tsc.Watcher = (* Watcher )(nil )
3132
32- func createWatcher (sys tsc.System , configParseResult * tsoptions.ParsedCommandLine , reportDiagnostic tsc.DiagnosticReporter , reportErrorSummary tsc.DiagnosticsReporter , testing tsc.CommandLineTesting ) * Watcher {
33+ func createWatcher (
34+ sys tsc.System ,
35+ configParseResult * tsoptions.ParsedCommandLine ,
36+ compilerOptionsFromCommandLine * core.CompilerOptions ,
37+ reportDiagnostic tsc.DiagnosticReporter ,
38+ reportErrorSummary tsc.DiagnosticsReporter ,
39+ testing tsc.CommandLineTesting ,
40+ ) * Watcher {
3341 w := & Watcher {
34- sys : sys ,
35- config : configParseResult ,
36- reportDiagnostic : reportDiagnostic ,
37- reportErrorSummary : reportErrorSummary ,
38- testing : testing ,
42+ sys : sys ,
43+ config : configParseResult ,
44+ compilerOptionsFromCommandLine : compilerOptionsFromCommandLine ,
45+ reportDiagnostic : reportDiagnostic ,
46+ reportErrorSummary : reportErrorSummary ,
47+ testing : testing ,
3948 // reportWatchStatus: createWatchStatusReporter(sys, configParseResult.CompilerOptions().Pretty),
4049 }
4150 if configParseResult .ConfigFile != nil {
@@ -108,7 +117,7 @@ func (w *Watcher) hasErrorsInTsConfig() bool {
108117 extendedConfigCache := & tsc.ExtendedConfigCache {}
109118 if w .configFileName != "" {
110119 // !!! need to check that this merges compileroptions correctly. This differs from non-watch, since we allow overriding of previous options
111- configParseResult , errors := tsoptions .GetParsedCommandLineOfConfigFile (w .configFileName , & core. CompilerOptions {} , w .sys , extendedConfigCache )
120+ configParseResult , errors := tsoptions .GetParsedCommandLineOfConfigFile (w .configFileName , w . compilerOptionsFromCommandLine , w .sys , extendedConfigCache )
112121 if len (errors ) > 0 {
113122 for _ , e := range errors {
114123 w .reportDiagnostic (e )
0 commit comments