(ctx context.Context)
| 112 | } |
| 113 | |
| 114 | func (w *Watcher) start(ctx context.Context) { |
| 115 | w.wm.Lock() |
| 116 | w.extendedConfigCache = &tsc.ExtendedConfigCache{} |
| 117 | host := compiler.NewCompilerHost(w.sys.GetCurrentDirectory(), w.sys.FS(), w.sys.DefaultLibraryPath(), w.extendedConfigCache, getTraceFromSys(w.sys, w.config.Locale(), w.testing)) |
| 118 | w.program = incremental.ReadBuildInfoProgram(w.config, incremental.NewBuildInfoReader(host), host) |
| 119 | |
| 120 | if w.configFileName != "" { |
| 121 | w.configFilePaths = append([]string{w.configFileName}, w.config.ExtendedSourceFiles()...) |
| 122 | } |
| 123 | |
| 124 | if w.sys.GetEnvironmentVariable("TS_WATCH_DEBUG") != "" { |
| 125 | w.wm.DebugLog = w.sys.Writer() |
| 126 | } |
| 127 | |
| 128 | if w.testing == nil { |
| 129 | w.wm.EnsureDefaultBackend() |
| 130 | } |
| 131 | |
| 132 | w.reportWatchStatus(ast.NewCompilerDiagnostic(diagnostics.Starting_compilation_in_watch_mode)) |
| 133 | if err := w.doBuild(); err != nil { |
| 134 | w.wm.ForceOverflow() |
| 135 | } |
| 136 | w.wm.Unlock() |
| 137 | |
| 138 | if w.testing == nil { |
| 139 | w.wm.RunLoop(ctx, w.DoCycle) |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | func (w *Watcher) computeDesiredWatches(seenFilePaths []string) map[string]bool { |
| 144 | cwd := w.sys.GetCurrentDirectory() |
nothing calls this directly
no test coverage detected