MCPcopy Create free account
hub / github.com/microsoft/typescript-go / start

Method start

internal/execute/watcher.go:114–141  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

112}
113
114func (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
143func (w *Watcher) computeDesiredWatches(seenFilePaths []string) map[string]bool {
144 cwd := w.sys.GetCurrentDirectory()

Callers

nothing calls this directly

Calls 15

doBuildMethod · 0.95
NewCompilerHostFunction · 0.92
ReadBuildInfoProgramFunction · 0.92
NewBuildInfoReaderFunction · 0.92
NewCompilerDiagnosticFunction · 0.92
getTraceFromSysFunction · 0.85
ExtendedSourceFilesMethod · 0.80
EnsureDefaultBackendMethod · 0.80
ForceOverflowMethod · 0.80
RunLoopMethod · 0.80
GetCurrentDirectoryMethod · 0.65
FSMethod · 0.65

Tested by

no test coverage detected