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

Method checkSourceFilesBelongToPath

internal/compiler/program.go:1585–1603  ·  view source on GitHub ↗
(sourceFiles []string, rootDirectory string)

Source from the content-addressed store, hash-verified

1583}
1584
1585func (p *Program) checkSourceFilesBelongToPath(sourceFiles []string, rootDirectory string) bool {
1586 allFilesBelongToPath := true
1587 for _, file := range sourceFiles {
1588 absoluteSourceFilePath := tspath.GetCanonicalFileName(tspath.GetNormalizedAbsolutePath(file, p.GetCurrentDirectory()), p.UseCaseSensitiveFileNames())
1589 if !tspath.ContainsPath(rootDirectory, file, p.comparePathsOptions) {
1590 p.includeProcessor.addProcessingDiagnostic(&processingDiagnostic{
1591 kind: processingDiagnosticKindExplainingFileInclude,
1592 data: &includeExplainingDiagnostic{
1593 file: tspath.Path(absoluteSourceFilePath),
1594 message: diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files,
1595 args: []any{file, rootDirectory},
1596 },
1597 })
1598 allFilesBelongToPath = false
1599 }
1600 }
1601
1602 return allFilesBelongToPath
1603}
1604
1605type WriteFileData struct {
1606 SourceMapUrlPos int

Callers

nothing calls this directly

Calls 7

GetCurrentDirectoryMethod · 0.95
GetCanonicalFileNameFunction · 0.92
ContainsPathFunction · 0.92
PathTypeAlias · 0.92

Tested by

no test coverage detected