# Implement \`inspector\` flag \(\#62920\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 91bf967e279fba3b326c096aeb66053cb2373547

Requested commit: 91bf967e279fba3b326c096aeb66053cb2373547

Commit: 91bf967e279fba3b326c096aeb66053cb2373547

Tree: 311cfa78a0eb71b7f21ba03ccb0b52c004b10870

Author: Chris Biscardi

Committer: GitHub

## Message

````
Implement `inspector` flag (#62920)

# Objective

Make it easy to conditionally enable the gpui inspector, with a goal of
eventually turning it on in nightly.

## Solution

The new `zed/inspector` flag (and supporting flags in other crates)
enables the relevant inspector features in `gpui`, `ui`, and
`inspector_ui` to be able to display the gpui inspector.

## Testing

- Enabling the inspector adds about 5mb to the binary, and for context
the zed binary is > 400mb at this time.
- Observationally, the inspector doesn't affect performance in a
meaningful way, but I did not run profiling.

```
# release with inspector (inspector on)
cargo run --release --features inspector
# release without inspector (inspector off)
cargo run --release
# dev build with debug assertions (inspector on)
cargo run
```

then trigger `dev::ToggleInspector`.

- linux: `ctrl-alt-i`
- windows: `shift-alt-i`
- macos: `cmd-alt-i`

## 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 adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
````

## Parents

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

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