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

Function emitIncludeDirectiveDeprecationWarning

pkg/parser/include_processor.go:104–127  ·  view source on GitHub ↗
(directive *ImportDirectiveMatch)

Source from the content-addressed store, hash-verified

102}
103
104func emitIncludeDirectiveDeprecationWarning(directive *ImportDirectiveMatch) {
105 if !directive.IsLegacy {
106 return
107 }
108
109 optionalMarker := ""
110 if directive.IsOptional {
111 optionalMarker = "?"
112 }
113
114 var suggestion string
115 if strings.HasPrefix(strings.TrimSpace(directive.Original), "{{") {
116 suggestion = fmt.Sprintf("Use {{#runtime-import%s %s}} for content injection or the 'imports:' frontmatter field for configuration merging.",
117 optionalMarker,
118 directive.Path)
119 } else {
120 suggestion = fmt.Sprintf("Use {{#runtime-import%s %s}} instead.",
121 optionalMarker,
122 directive.Path)
123 }
124 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Deprecated syntax: %q. %s",
125 directive.Original,
126 suggestion)))
127}
128
129func resolveDirectiveWithVisited(
130 directive *ImportDirectiveMatch,

Callers 1

Calls 1

FormatWarningMessageFunction · 0.92

Tested by

no test coverage detected