Validate actions in docs (#31073)

Adds a validation step to docs preprocessing so that actions referenced
in docs are checked against the list of all registered actions in GPUI.

In order for this to work properly, all of the crates that register
actions had to be importable by the `docs_preprocessor` crate and
actually used (see [this
comment](ec16e70336 (diff-2674caf14ae6d70752ea60c7061232393d84e7f61a52915ace089c30a797a1c3))
for why this is challenging).

In order to accomplish this I have moved the entry point of zed into a
separate stub file named `zed_main.rs` so that `main.rs` is importable
by the `docs_preprocessor` crate, this is kind of gross, but ensures
that all actions that are registered in the application are registered
when checking them in `docs_preprocessor`. An alternative solution
suggested by @mikayla-maki was to separate out all our `::init()`
functions into a lib entry point in the `zed` crate that can be imported
instead, however, this turned out to be a far bigger refactor and is in
my opinion better to do in a follow up PR with significant testing to
ensure no regressions in behavior occur.

Release Notes:

- N/A
This commit is contained in:
Ben Kunkle 2025-06-04 14:18:12 -05:00 committed by GitHub
parent 52770cd3ad
commit 17c3b741ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 216 additions and 48 deletions

View file

@ -12,6 +12,10 @@ workspace = true
[[bin]]
name = "zed"
path = "src/zed-main.rs"
[lib]
name = "zed"
path = "src/main.rs"
[dependencies]