MCPcopy Create free account
hub / github.com/github/gh-aw / processIncludeDirectiveWithVisited

Function processIncludeDirectiveWithVisited

pkg/parser/include_processor.go:81–102  ·  view source on GitHub ↗
(
	directive *ImportDirectiveMatch,
	baseDir string,
	extractTools bool,
	visited map[string]struct {
	})

Source from the content-addressed store, hash-verified

79}
80
81func processIncludeDirectiveWithVisited(
82 directive *ImportDirectiveMatch,
83 baseDir string,
84 extractTools bool,
85 visited map[string]struct {
86 }) (string, bool, error) {
87 emitIncludeDirectiveDeprecationWarning(directive)
88 resolution, shouldSkip, err := resolveDirectiveWithVisited(directive, baseDir, extractTools, visited)
89 if err != nil || shouldSkip {
90 return "", shouldSkip, err
91 }
92
93 includeLog.Printf("Processing include file: %s", resolution.fullPath)
94 visited[resolution.fullPath] = struct {
95 }{}
96
97 includedContent, err := processIncludedFileWithVisited(resolution.fullPath, resolution.sectionName, extractTools, visited)
98 if err != nil {
99 return "", false, fmt.Errorf("failed to process included file '%s': %w", resolution.fullPath, err)
100 }
101 return includedContent, false, nil
102}
103
104func emitIncludeDirectiveDeprecationWarning(directive *ImportDirectiveMatch) {
105 if !directive.IsLegacy {

Callers 1

Calls 5

PrintfMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected