# debugger: Add variable watchers \(\#32743\) · gitcafe/zed

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

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

Visibility: public

Requested revision: ad76db7244c4a98dde0d0faeecc6af112c7e4fbf

Requested commit: ad76db7244c4a98dde0d0faeecc6af112c7e4fbf

Commit: ad76db7244c4a98dde0d0faeecc6af112c7e4fbf

Tree: 76a41234ef9351802e21f29e21ddd599f67a4079

Author: Remco Smits

Committer: GitHub

## Message

```
debugger: Add variable watchers (#32743)

### This PR introduces support for adding watchers to specific
expressions (such as variable names or evaluated expressions).

This feature is useful in scenarios where many variables are in scope,
but only a few are of interest—especially when tracking variables that
change frequently. By allowing users to add watchers, it becomes easier
to monitor the values of selected expressions across stack frames
without having to sift through a large list of variables.


https://github.com/user-attachments/assets/c49b470a-d912-4182-8419-7406ba4c8f1e

------

**TODO**:
- [x] make render variable code reusable for render watch method
- [x] use SharedString for watches because of a lot of cloning
- [x] add tests
  - [x] basic test
  - [x] test step debugging

Release Notes:

- Debugger Beta: Add support for variable watchers

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
```

## Parents

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

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