# snippet_provider: Fix multiple snippets for same language \(\#58659\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/0968dc60707072e7ea00f500516186121e6356fc)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 0968dc60707072e7ea00f500516186121e6356fc

Requested commit: 0968dc60707072e7ea00f500516186121e6356fc

Commit: 0968dc60707072e7ea00f500516186121e6356fc

Tree: 57693c90814ff74fc764aefb97a4784958390eed

Author: Mathis

Committer: GitHub

## Message

```
snippet_provider: Fix multiple snippets for same language (#58659)

This PR fixes the snippets issue when a user loads multiple snippets for
the same language.
It also adds tests for the snippets register function.

**Note**
I've made the choice to differentiate snippets based on their body.
Thus, two extensions can provide the same snippet with the same prefix
but with different bodies.
WDYT ?

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #51014
Closes #52182 

Release Notes:

- Fixed different snippet extensions for the same language cancel each
other

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
```

## Parents

- [b0db83272f215be4753200687521fd9ce48336a6](https://git.cafe/gitcafe/zed/commit/b0db83272f215be4753200687521fd9ce48336a6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/0968dc60707072e7ea00f500516186121e6356fc?format=markdown)
