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

Function createProgram

internal/testutil/harnessutil/harnessutil.go:939–957  ·  view source on GitHub ↗
(host compiler.CompilerHost, config *tsoptions.ParsedCommandLine)

Source from the content-addressed store, hash-verified

937}
938
939func createProgram(host compiler.CompilerHost, config *tsoptions.ParsedCommandLine) compiler.ProgramLike {
940 var singleThreaded core.Tristate
941 if testutil.TestProgramIsSingleThreaded() {
942 singleThreaded = core.TSTrue
943 }
944
945 programOptions := compiler.ProgramOptions{
946 Config: config,
947 Host: host,
948 SingleThreaded: singleThreaded,
949 }
950 program := compiler.NewProgram(programOptions)
951 if config.CompilerOptions().Incremental.IsTrue() {
952 oldProgram := incremental.ReadBuildInfoProgram(config, getTestBuildInfoReader(host), host)
953 incrementalProgram := incremental.NewProgram(program, oldProgram, incremental.CreateHost(host), false)
954 return incrementalProgram
955 }
956 return program
957}
958
959func EnumerateFiles(folder string, testRegex *regexp.Regexp, recursive bool) ([]string, error) {
960 files, err := listFiles(folder, testRegex, recursive)

Callers 1

compileFilesWithHostFunction · 0.85

Calls 8

NewProgramFunction · 0.92
ReadBuildInfoProgramFunction · 0.92
NewProgramFunction · 0.92
CreateHostFunction · 0.92
getTestBuildInfoReaderFunction · 0.85
IsTrueMethod · 0.80
CompilerOptionsMethod · 0.65

Tested by

no test coverage detected