( sys tsc.System, configParseResult *tsoptions.ParsedCommandLine, compilerOptionsFromCommandLine *core.CompilerOptions, commandLineRaw *collections.OrderedMap[string, any], reportDiagnostic tsc.DiagnosticReporter, reportErrorSummary tsc.DiagnosticsReporter, testing tsc.CommandLineTesting, )
| 81 | var _ tsc.Watcher = (*Watcher)(nil) |
| 82 | |
| 83 | func createWatcher( |
| 84 | sys tsc.System, |
| 85 | configParseResult *tsoptions.ParsedCommandLine, |
| 86 | compilerOptionsFromCommandLine *core.CompilerOptions, |
| 87 | commandLineRaw *collections.OrderedMap[string, any], |
| 88 | reportDiagnostic tsc.DiagnosticReporter, |
| 89 | reportErrorSummary tsc.DiagnosticsReporter, |
| 90 | testing tsc.CommandLineTesting, |
| 91 | ) *Watcher { |
| 92 | wm := watchmanager.NewWatchManager(sys.Writer(), sys.FS().DirectoryExists) |
| 93 | if t, ok := testing.(watchmanager.CommandLineTestingWithWatchBackend); ok { |
| 94 | wm.SetBackend(t.WatchBackend()) |
| 95 | } |
| 96 | w := &Watcher{ |
| 97 | sys: sys, |
| 98 | config: configParseResult, |
| 99 | compilerOptionsFromCommandLine: compilerOptionsFromCommandLine, |
| 100 | commandLineRaw: commandLineRaw, |
| 101 | reportDiagnostic: reportDiagnostic, |
| 102 | reportErrorSummary: reportErrorSummary, |
| 103 | reportWatchStatus: tsc.CreateWatchStatusReporter(sys, configParseResult.Locale(), configParseResult.CompilerOptions(), testing), |
| 104 | testing: testing, |
| 105 | sourceFileCache: &collections.SyncMap[tspath.Path, *cachedSourceFile]{}, |
| 106 | wm: wm, |
| 107 | } |
| 108 | if configParseResult.ConfigFile != nil { |
| 109 | w.configFileName = configParseResult.ConfigFile.SourceFile.FileName() |
| 110 | } |
| 111 | return w |
| 112 | } |
| 113 | |
| 114 | func (w *Watcher) start(ctx context.Context) { |
| 115 | w.wm.Lock() |
no test coverage detected