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

Function fastPathForNoIncludes

pkg/parser/include_processor.go:59–73  ·  view source on GitHub ↗
(content string, extractTools bool)

Source from the content-addressed store, hash-verified

57}
58
59func fastPathForNoIncludes(content string, extractTools bool) (string, bool) {
60 // Fast path: skip scanner allocation when no include/import directives are present.
61 // ParseImportDirective only matches lines starting with '@' or '{{#import'.
62 // For content mode, preserve the scanner's trailing-newline normalization behavior.
63 if !hasIncludeDirectives(content) {
64 if extractTools {
65 return "", true
66 }
67 if !strings.HasSuffix(content, "\n") {
68 return content + "\n", true
69 }
70 return content, true
71 }
72 return "", false
73}
74
75type includeDirectiveResolution struct {
76 filePath string

Callers 1

Calls 1

hasIncludeDirectivesFunction · 0.85

Tested by

no test coverage detected