745
746
for (const customization of customizations) {
748
continue;
749
}
751
>
const childUri = URI.parse(customization.uri);
752
>
let bestParent = outputDirectories.find(d => extUriBiasedIgnorePathCase.isEqualOrParent(childUri, d.uri));
753
>
if (!bestParent && customization.type === CustomizationType.Rule && customization.alwaysApply && customization.name.match(/\.md$/i)) {
754
bestParent = outputDirectories.find(d =>
755
d.type === DiscoveredType.AgentInstruction && extUriBiasedIgnorePathCase.isEqualOrParent(childUri, d.uri)
756
) ?? outputDirectories.find(d => d.type === DiscoveredType.AgentInstruction);
757
}
759
for (const candidate of outputDirectories) {
760
if (extUriBiasedIgnorePathCase.isEqualOrParent(childUri, candidate.uri) && candidate.uri.path.length > bestParent.uri.path.length) {