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

Method getCommandLineWithTypingsFiles

internal/project/project.go:287–318  ·  view source on GitHub ↗

getCommandLineWithTypingsFiles returns the command line augmented with typing files if ATA is enabled.

()

Source from the content-addressed store, hash-verified

285
286// getCommandLineWithTypingsFiles returns the command line augmented with typing files if ATA is enabled.
287func (p *Project) getCommandLineWithTypingsFiles() *tsoptions.ParsedCommandLine {
288 if len(p.typingsFiles) == 0 {
289 return p.CommandLine
290 }
291
292 // Check if ATA is enabled for this project
293 typeAcquisition := p.GetTypeAcquisition()
294 if typeAcquisition == nil || !typeAcquisition.Enable.IsTrue() {
295 return p.CommandLine
296 }
297
298 p.commandLineWithTypingsFilesOnce.Do(func() {
299 if p.commandLineWithTypingsFiles == nil {
300 // Create an augmented command line that includes typing files
301 originalRootNames := p.CommandLine.FileNames()
302 newRootNames := make([]string, 0, len(originalRootNames)+len(p.typingsFiles))
303 newRootNames = append(newRootNames, originalRootNames...)
304 newRootNames = append(newRootNames, p.typingsFiles...)
305
306 // Create a new ParsedCommandLine with the augmented root file names
307 p.commandLineWithTypingsFiles = tsoptions.NewParsedCommandLine(
308 p.CommandLine.CompilerOptions(),
309 newRootNames,
310 tspath.ComparePathsOptions{
311 UseCaseSensitiveFileNames: p.host.FS().UseCaseSensitiveFileNames(),
312 CurrentDirectory: p.currentDirectory,
313 },
314 )
315 }
316 })
317 return p.commandLineWithTypingsFiles
318}
319
320func (p *Project) setPotentialProjectReference(configFilePath tspath.Path) {
321 if p.potentialProjectReferences == nil {

Callers 1

CreateProgramMethod · 0.95

Implementers 1

Projectinternal/project/project.go

Calls 10

GetTypeAcquisitionMethod · 0.95
NewParsedCommandLineFunction · 0.92
lenFunction · 0.85
IsTrueMethod · 0.80
FileNamesMethod · 0.80
CompilerOptionsMethod · 0.65
FSMethod · 0.65
makeFunction · 0.50
appendFunction · 0.50

Tested by

no test coverage detected