MCPcopy Index your code
hub / github.com/microsoft/typescript-go / NewProgram

Function NewProgram

internal/compiler/program.go:274–283  ·  view source on GitHub ↗
(opts ProgramOptions)

Source from the content-addressed store, hash-verified

272}
273
274func NewProgram(opts ProgramOptions) *Program {
275 p := &Program{opts: opts}
276 if p.opts.Tracing != nil {
277 defer p.opts.Tracing.Push(tracing.PhaseProgram, "createProgram", map[string]any{"configFilePath": opts.Config.CompilerOptions().ConfigFilePath}, true)()
278 }
279 p.processedFiles = processAllProgramFiles(p.opts, p.SingleThreaded())
280 p.initCheckerPool()
281 p.verifyCompilerOptions()
282 return p
283}
284
285// Return an updated program for which it is known that only the file with the given path has changed.
286// In addition to a new program, return a boolean indicating whether the data of the old program was reused.

Callers 14

TestProgramFunction · 0.92
BenchmarkNewProgramFunction · 0.92
BenchmarkEmitLongLinesFunction · 0.92
BenchmarkEmitManyFilesFunction · 0.92
CreateProgramMethod · 0.92
TestGetSymbolAtLocationFunction · 0.92
BenchmarkNewCheckerFunction · 0.92
doBuildMethod · 0.92
performCompilationFunction · 0.92

Calls 6

SingleThreadedMethod · 0.95
initCheckerPoolMethod · 0.95
verifyCompilerOptionsMethod · 0.95
processAllProgramFilesFunction · 0.85
CompilerOptionsMethod · 0.65
PushMethod · 0.45

Tested by 8

TestProgramFunction · 0.74
BenchmarkNewProgramFunction · 0.74
BenchmarkEmitLongLinesFunction · 0.74
BenchmarkEmitManyFilesFunction · 0.74
TestGetSymbolAtLocationFunction · 0.74
BenchmarkNewCheckerFunction · 0.74