Skip to content

Support multiple snippets locations per extension#45829

Merged
MrSubidubi merged 2 commits intomainfrom
multiple-snippets-per-extension
Jan 23, 2026
Merged

Support multiple snippets locations per extension#45829
MrSubidubi merged 2 commits intomainfrom
multiple-snippets-per-extension

Conversation

@MrSubidubi
Copy link
Member

This allows extensions to add more than one snippet file whilst keeping it backwards compatible.

Release Notes:

  • Added support for specifying multiple snippets paths in extensions.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 29, 2025
Comment on lines +58 to +63
pub enum ExtensionSnippets {
Single(PathBuf),
Multiple(Vec<PathBuf>),
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why having a Single and a Multiple when everything could be included in the Vec? Is there any benefit of not using a Vec when there's only a single snippet file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, there currently is, and that is backwards compatibility for older Zed versions. We'd keep that for extensions pulished with the old format and they would continue to work in older versions. It still is not optimal, because newer extensions with the new format would not work in older versions but we'd try to load these, so I'll need to think about whether there might be a better approach and/or whether it's worth it to keep that around.

@MrSubidubi MrSubidubi marked this pull request as ready for review January 19, 2026 13:04
@MrSubidubi MrSubidubi force-pushed the multiple-snippets-per-extension branch from 931285e to 10139af Compare January 21, 2026 22:50
@MrSubidubi MrSubidubi merged commit da3847a into main Jan 23, 2026
27 checks passed
@MrSubidubi MrSubidubi deleted the multiple-snippets-per-extension branch January 23, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants