(content string, extractTools bool)
| 57 | } |
| 58 | |
| 59 | func 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 | |
| 75 | type includeDirectiveResolution struct { |
| 76 | filePath string |
no test coverage detected