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

Function hasIncludeDirectives

pkg/parser/include_expander.go:20–24  ·  view source on GitHub ↗

hasIncludeDirectives reports whether content contains any include/import directive that ParseImportDirective could match. Used as a fast pre-check to avoid scanner allocations. Matches @include, @import (legacy), and {{#import (legacy) forms.

(content string)

Source from the content-addressed store, hash-verified

18// ParseImportDirective could match. Used as a fast pre-check to avoid scanner allocations.
19// Matches @include, @import (legacy), and {{#import (legacy) forms.
20func hasIncludeDirectives(content string) bool {
21 return strings.Contains(content, "@include") ||
22 strings.Contains(content, "@import") ||
23 strings.Contains(content, "{{#import")
24}
25
26// ExpandIncludes recursively expands @include and @import directives until no more remain
27// This matches the bash expand_includes function behavior

Callers 4

fastPathForNoIncludesFunction · 0.85
handleNoIncludeFastPathFunction · 0.85
expandIncludesForFieldFunction · 0.85
processIncludesForFieldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected