Skip to content

zed-rx: snippets - #5

Draft
oddcelot wants to merge 1 commit into
zed-rxfrom
zed-rx-snippets
Draft

oddcelot wants to merge 1 commit into
zed-rxfrom
zed-rx-snippets

Conversation

@oddcelot

@oddcelot oddcelot commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to solidjs#92.

This adds snippets in snippets/reactivescript.json, registered through the snippets field in extension.toml. Zed matches a snippet file to a language by its lowercased name, hence the file name.

Prefix Expands to
source source name: number := 0
sourceq source user = await fetchUser(id)
action action save() { … }
component component Item(props: { title: string }) { <div>…</div> }
app export default component App() { <main>…</main> }
effect effect (count) { … }
fn fn area(w: number, h: number): number => w * h
for {for it in items { … }}
if {if cond { … } else { … }}

The forms and most placeholder names come from guide/language.md. sourceq and app are prefixes I made up, happy to rename them.

I expanded every snippet into one .rx file and parsed it with the pinned grammar: no ERROR or MISSING nodes. I haven't tried them in Zed yet.

Based on zed-rx, so the diff only shows this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant