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

Function tscBuildCompilation

internal/execute/tsc.go:90–119  ·  view source on GitHub ↗
(ctx context.Context, sys tsc.System, buildCommand *tsoptions.ParsedBuildCommandLine, testing tsc.CommandLineTesting)

Source from the content-addressed store, hash-verified

88}
89
90func tscBuildCompilation(ctx context.Context, sys tsc.System, buildCommand *tsoptions.ParsedBuildCommandLine, testing tsc.CommandLineTesting) tsc.CommandLineResult {
91 locale := buildCommand.Locale()
92 reportDiagnostic := tsc.CreateDiagnosticReporter(sys, sys.Writer(), locale, buildCommand.CompilerOptions)
93
94 if len(buildCommand.Errors) > 0 {
95 for _, err := range buildCommand.Errors {
96 reportDiagnostic(err)
97 }
98 return tsc.CommandLineResult{Status: tsc.ExitStatusDiagnosticsPresent_OutputsSkipped}
99 }
100
101 if pprofDir := buildCommand.CompilerOptions.PprofDir; pprofDir != "" {
102 // !!! stderr?
103 profileSession := pprof.BeginProfiling(pprofDir, sys.Writer())
104 defer profileSession.Stop()
105 }
106
107 if buildCommand.CompilerOptions.Help.IsTrue() {
108 tsc.PrintVersion(sys, locale)
109 tsc.PrintBuildHelp(sys, locale, tsoptions.BuildOpts)
110 return tsc.CommandLineResult{Status: tsc.ExitStatusSuccess}
111 }
112
113 orchestrator := build.NewOrchestrator(build.Options{
114 Sys: sys,
115 Command: buildCommand,
116 Testing: testing,
117 })
118 return orchestrator.Start(ctx)
119}
120
121func tscCompilation(ctx context.Context, sys tsc.System, commandLine *tsoptions.ParsedCommandLine, testing tsc.CommandLineTesting) tsc.CommandLineResult {
122 configFileName := ""

Callers 1

CommandLineFunction · 0.85

Calls 9

CreateDiagnosticReporterFunction · 0.92
BeginProfilingFunction · 0.92
PrintVersionFunction · 0.92
PrintBuildHelpFunction · 0.92
lenFunction · 0.85
StopMethod · 0.80
IsTrueMethod · 0.80
WriterMethod · 0.65
LocaleMethod · 0.45

Tested by

no test coverage detected