appendMatchingRules appends path-specific rules for any file-like hints, mirroring the rule-loading logic shared by the prefix builders.
(rules *RulesLoader, hints []string, parts []string)
| 226 | // appendMatchingRules appends path-specific rules for any file-like hints, |
| 227 | // mirroring the rule-loading logic shared by the prefix builders. |
| 228 | func appendMatchingRules(rules *RulesLoader, hints []string, parts []string) []string { |
| 229 | if rules == nil || len(hints) == 0 { |
| 230 | return parts |
| 231 | } |
| 232 | var pathHints []string |
| 233 | for _, h := range hints { |
| 234 | if strings.Contains(h, ".") || strings.Contains(h, "/") { |
| 235 | pathHints = append(pathHints, h) |
| 236 | } |
| 237 | } |
| 238 | if len(pathHints) == 0 { |
| 239 | return parts |
| 240 | } |
| 241 | if rc := rules.LoadMatchingRules(pathHints); rc != "" { |
| 242 | parts = append(parts, rc) |
| 243 | } |
| 244 | return parts |
| 245 | } |
| 246 | |
| 247 | // BuildDynamicContext returns time-sensitive and session-aware context. |
| 248 | // Includes current time, working directory, and disambiguation instructions |
no test coverage detected