Syntax highlighting, snippets, diagnostics, and basic formatting for Axonyx
.asx frontend files and .ax backend files.
This version focuses on making modern Pages ASX files readable and pleasant in VS Code:
- Pages V2 declarations such as
page Home() { return ASX { ... } } component,scope,query,action,guard,state,data,type, andinterfaceimport ... from- JSX-like tags such as
<Head>,<SectionCard>,<Slot /> - strings, numbers, booleans, attributes, and embedded
{expression}blocks - starter snippets for pages, data pages, components, scopes, queries, actions, imports,
Head,Each,If,Slot, routes, and common Foundry UI blocks such asSectionCard,HeroCard,ContentGrid,SiteShell, andCopy - newer Foundry snippets for
Form,FormGroup,Fieldset,Table,TableHead,TableCell,PaginationItem, and layout primitives - parser-backed diagnostics through
cargo ax checkon open/save - basic document formatting through
Format DocumentorAxonyx: Format Document - distinct highlighting for typed props/parameters, bindings, function calls, runtime scopes, operators, and ASX component/HTML tags
Example:
page Home() {
data posts: List<Post> = loadPosts("published")
return ASX {
<Container max="xl">
<Each items={posts} as="post">
<Card title={post.title}>
<Copy>{post.excerpt}</Copy>
</Card>
</Each>
</Container>
}
}
- Open this folder in VS Code.
- Run
Developer: Install Extension from Location...and choose this repo folder. - Open any
.asxpage/component or.axbackend file.
If you are working inside the Axonyx repo family, the extension also looks for a local sibling axonyx-framework checkout and can run diagnostics through that source tree.
For published CLI diagnostics, install the current beta CLI:
cargo install cargo-axonyx --forceTo format on save, enable VS Code formatting for Axonyx files:
{
"[ax]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "vladanpro.axonyx-vscode"
}
}Alternative dev flow:
- Install
vsceif needed:npm install -g @vscode/vsce - Package the extension:
vsce package - Install the generated
.vsixin VS Code.
- faster background diagnostics with a persistent checker process
axonyx-lspas a Rust language server behind the extension- Contract V1-backed component/prop completion and hover details
- go-to-definition for local and
@axonyx/ui/...imports - semantic formatting powered by the future
axonyx-lsp