feat(language-server): flag the removed data blocks

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-20 18:40:08 +05:30
co-authored by Claude Opus 5
parent ba957e861e
commit 861444b8a3
5 changed files with 126 additions and 6 deletions
+1 -1
View File
@@ -685,7 +685,7 @@ export function parse(source: string): PageAst {
}
if (lx.peek().type === "lbrace") {
throw new ParseError(
`"${rawMode} { … }" data blocks were removed. Declare API calls in a page-level "apis { }" block, and move mode-scoped helpers into "functions { shared function … }".`,
`"${rawMode} { … }" data blocks were removed. Declare API calls in a page-level "apis { }" block, and move mode-scoped helpers into "functions { shared function … }" (at offset ${kw.pos}).`,
);
}
throw new ParseError(`Expected a ${rawMode} state block or hydrate assignment`);