1078
// hooks are recursively discovered as `*.json` under the root.
1079
const findHooks = async (directoryStat: IFileStatWithMetadata, recursionLevel: number): Promise<void> => {
1081
>
1082
>
for (const child of directoryStat.children ?? []) {
1083
>
throwIfCancelled(token);
1084
>
1085
>
if (child.isFile) {
1086
>
const name = child.name.toLowerCase();
1087
>
if (name.endsWith(HOOK_FILE_SUFFIX) && !seen.has(child.resource)) {
1088
>
seen.add(child.resource);
1089
>
files.push({ uri: child.resource, etag: child.etag });
1090
>
}
1091
>
} else if (child.isDirectory && recursionLevel < MAX_HOOKS_RECURSION_DEPTH) {
1092
let childStat: IFileStatWithMetadata | undefined = undefined;
1093
try {