# Refactor workspace notifications to use explicit \`NotificationId\` type \(\#10342\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8cbdd9e0fa7b1fdc9453caefd353468d1df4c1b2

Requested commit: 8cbdd9e0fa7b1fdc9453caefd353468d1df4c1b2

Commit: 8cbdd9e0fa7b1fdc9453caefd353468d1df4c1b2

Tree: 8e186df7b298981301c2c480d3cb7b26884c13e6

Author: Marshall Bowers

Committer: GitHub

## Message

```
Refactor workspace notifications to use explicit `NotificationId` type (#10342)

This PR reworks the way workspace notifications are identified to use a
new `NotificationId` type.

A `NotificationId` is bound to a given type that is used as a unique
identifier. Generally this will be a unit struct that can be used to
uniquely identify this notification.

A `NotificationId` can also accept an optional `ElementId` in order to
distinguish between different notifications of the same type.

This system avoids the issue we had previously of selecting `usize` IDs
somewhat arbitrarily and running the risk of having two independent
notifications collide (and thus interfere with each other).

This also fixes a bug where multiple suggestion notifications for the
same extension could be live at once

Fixes https://github.com/zed-industries/zed/issues/10320.

Release Notes:

- Fixed a bug where multiple extension suggestions for the same
extension could be shown at once
([#10320](https://github.com/zed-industries/zed/issues/10320)).

---------

Co-authored-by: Max <max@zed.dev>
```

## Parents

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

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