Skip to content

Add Riverpod and Freezed snippets - #4581

Merged
MrSubidubi merged 22 commits into
zed-industries:mainfrom
OppositeDragon:main
Feb 23, 2026
Merged

Add Riverpod and Freezed snippets#4581
MrSubidubi merged 22 commits into
zed-industries:mainfrom
OppositeDragon:main

Conversation

@OppositeDragon

Copy link
Copy Markdown
Contributor

No description provided.

@cla-bot

cla-bot Bot commented Jan 22, 2026

Copy link
Copy Markdown

We require contributors to sign our Contributor License Agreement, and we don't have @OppositeDragon on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@OppositeDragon

Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed label Jan 22, 2026
@cla-bot

cla-bot Bot commented Jan 22, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! It seems the snippets in the freezed extension are broken. Please fix this and update the submodule here. You can test these locally, see https://zed.dev/docs/extensions/developing-extensions#developing-an-extension-locally

@OppositeDragon

Copy link
Copy Markdown
Contributor Author

Hello @MrSubidubi, I reviewed the apparent error, and found why it is marking the snippets as broken.
I need the character $ to be used no only to place a cursor, but also to be used as the actual character.

For example: abstract class Person with _$Person
Freezed Docs

So when I do: "abstract class ${1:Class} with _$${1:Class} {"
the first $ after 'with' is being marked as needing a number(int), thus failling parsing.

I tried this as a workaround, but also fails
"abstract class ${1:Class} with _\u0024${1:Class} {"

Do you think something can be made to make this possible, or is there a different direction I can take?

@MrSubidubi

Copy link
Copy Markdown
Member

You should be able to just escape the dollar sign, I think by just adding a backslash but could be wrong. There is documentation somewhere I believe, if not happy to add that. Dollar signs are definitely supported already though.

@OppositeDragon

Copy link
Copy Markdown
Contributor Author

Sorry for the late response.
I haven't been able to find the documentation you mentioned.

I did try to use backslah to escape the $(dollar sign), but zed warns againt it, and even if I try to reinstall/build dev extension like that, it fails.

image

If at all possible, could you point me to the documentation, or a workaround for this.

Thanks.

@MrSubidubi

Copy link
Copy Markdown
Member

Well, you'll need to properly escape within the JSON string (https://stackoverflow.com/a/27516892 for more context I suppose) so that we can parse and then escape the symbol within Zed. So two backslashes should probably do it

@OppositeDragon

Copy link
Copy Markdown
Contributor Author

Thank you for taking the time and pointing me in the right direction.

You were right, \\ (double backslash) did it.

I'll update the snippets and retry submitting.

I appreciate your help.

@MrSubidubi MrSubidubi changed the title Initial release of Riverpod snippets Add Riverpod and Freezed snippets Feb 23, 2026

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now, thanks!

Last question: Would you be opposed to adding a -dart in the ID of both extensions? I am not strongly enforcing this, just curious. So you'd have riverpod-dart-snippets and freezed-dart-snippets. I'd prefer that for the latter at least to be changed, yet I do not really insist tbh.

That would require you to change that in the repositories, then update the submodules and stuff here. Would that be fine with you?

@MrSubidubi

Copy link
Copy Markdown
Member

(And sorry for the delay, was unfortunately sick)

@OppositeDragon

Copy link
Copy Markdown
Contributor Author

Thank you @MrSubidubi. Hope you are feeling much better now.

Although they are for Dart, and some of these snippets can be used in pure Dart projects, most are specific to Flutter (specially in riverpod_snippets). So, I didn't add -dart because I did not want users to think these only contain snippets for dart and not flutter.

@MrSubidubi

Copy link
Copy Markdown
Member

Appreciate the context. Can we go for flutter then or would you have similar concerns there?

Also, to be sure, just talking about the ID here, Name can stay as it currently is

@OppositeDragon

Copy link
Copy Markdown
Contributor Author

What about riverpod-dart-flutter-snippets and freezed-dart-flutter-snippets?

@MrSubidubi

Copy link
Copy Markdown
Member

Perfectly fine with me!

@MrSubidubi MrSubidubi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you and thanks for bearing with me!

@MrSubidubi
MrSubidubi enabled auto-merge February 23, 2026 21:24
@MrSubidubi
MrSubidubi added this pull request to the merge queue Feb 23, 2026
Merged via the queue into zed-industries:main with commit aa14442 Feb 23, 2026
4 checks passed
@OppositeDragon

Copy link
Copy Markdown
Contributor Author

Thank you!!!

MrSubidubi added a commit that referenced this pull request Feb 24, 2026
tahayvr pushed a commit to tahayvr/zed-extensions that referenced this pull request Feb 24, 2026
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: MrSubidubi <dev@bahn.sh>
PasqualeMainolfi pushed a commit to PasqualeMainolfi/extensions that referenced this pull request Feb 26, 2026
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: MrSubidubi <dev@bahn.sh>
cramhead pushed a commit to cramhead/extensions that referenced this pull request Mar 31, 2026
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: MrSubidubi <dev@bahn.sh>
loczek pushed a commit to loczek/zed-extensions that referenced this pull request May 4, 2026
Co-authored-by: Finn Evers <finn@zed.dev>
Co-authored-by: MrSubidubi <dev@bahn.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants