Skip to content

Commit 793b81b

Browse files
dncrewsCopilot
andauthored
Update src/workflow/syntax/syntax-test-utils.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 24281e8 commit 793b81b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/workflow/syntax/syntax-test-utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ export function analyzeTopLevelInjectionContexts(
143143
const contexts: RunShellContext[] = grammar.patterns.map(pattern => {
144144
const repoKey = pattern.include.replace(/^#/, "");
145145
const rule = grammar.repository[repoKey];
146+
if (!rule) {
147+
throw new Error(`Repository rule not found for ${repoKey}`);
148+
}
146149
const embeddedRule = rule.patterns.find(p => p.contentName?.startsWith("meta.embedded.block."));
147150
if (!embeddedRule?.begin || !embeddedRule.end || !embeddedRule.contentName) {
148151
throw new Error(`Embedded run rule not found for ${repoKey}`);

0 commit comments

Comments
 (0)