# project: Track inlay hint / code lens / document symbol registrations by ID \(\#55340\) · gitcafe/zed

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

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

Visibility: public

Requested revision: b64e5dc8861f2a86e9bf12dde3151bd2d58515b4

Requested commit: b64e5dc8861f2a86e9bf12dde3151bd2d58515b4

Commit: b64e5dc8861f2a86e9bf12dde3151bd2d58515b4

Tree: 89a3b53995824168a8a01df9b6abed147af043d2

Author: Tautik Agrahari

Committer: GitHub

## Message

```
project: Track inlay hint / code lens / document symbol registrations by ID (#55340)

extends the precedent set by #43703 (thanks @reflectronic) so that
`textDocument/inlayHint`, `textDocument/codeLens`, and
`textDocument/documentSymbol` correctly track multiple dynamic
registrations by id. previously each register call overwrote the slot on
`ServerCapabilities`, and unregister either silently did nothing
(inlayHint, documentSymbol — no match arm) or wiped the entire
capability (codeLens). now each method keeps its own id-keyed map on
`DynamicRegistrations`; the field on `ServerCapabilities` is cleared
only when the last registration is removed.

textDocument-sync notifications (`didChange`/`didSave`/`willSave`) are
deliberately out of scope — their fan-out semantics are ambiguous in the
spec and were flagged on @smitbarmase's earlier exploration in #36876.

verified with `cargo check -p project -p lsp -p editor`, `cargo test -p
project --test integration -- multi_registration` (3/3 passing), and
`cargo fmt -p project`.

closes part of #37838.

Release Notes:

- Improved support for language servers that dynamically register inlay
hints, code lens, or document symbols multiple times.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
```

## Parents

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

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