# lsp: Reference-count log streams across views \(\#61222\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 4668a4bf09712b126b67d81298eae9b45ead39af

Requested commit: 4668a4bf09712b126b67d81298eae9b45ead39af

Commit: 4668a4bf09712b126b67d81298eae9b45ead39af

Tree: 0b1910be9636b9e58c95f6e883a570cefcb5a838

Author: Shuhei Kadowaki

Committer: GitHub

## Message

```
lsp: Reference-count log streams across views (#61222)

LSP log streams can be consumed by split views and downstream clients.
Treating enablement as a single value lets one consumer disable a stream
that another consumer is still using.

Track the streams enabled by each view and reference-count each exact
server and log kind. Keep in-process view ownership separate from
downstream requests, preserve RPC capture while either has an active
consumer, and notify remote hosts only on the first enable and final
disable.

Represent log kinds independently so split views can consume logs,
traces, and RPC messages without overwriting one another.

---

This PR is a stacked follow-up to #61221. It is split out because
project isolation is independently mergeable, while reference-counting
changes the ownership and lifecycle semantics of LSP log streams and
benefits
from separate review.

---

Release Notes:

- Fixed closing one LSP Logs view stopping streams used by another view
or downstream client

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
```

## Parents

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

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