mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-04 03:33:21 +01:00
Remove dead code, orphaned files, and unused config entries (#67664)
## Summary Removes code, files and config entries that nothing in the repository uses. Follow-up to the cleanups in #67126 through #67219. No behavior changes. - `project`: removes `SshLspAdapter`, which nothing has constructed since language server adapters moved to the remote server. Also removes `RepositorySnapshot::diff_stat_for_path` and its `Repository` wrapper, `BufferStore::loading_buffers` and `LocalLspStore::running_language_server_for_id`. - `git_ui`: removes `move_to_project_path` from `ProjectDiff` and `DiffMultibuffer`. #67149 removed their last caller. - `editor`: removes `DisplaySnapshot::reverse_text_chunks` and `DisplaySnapshot::excerpt_header_height`, and `BlockSnapshot`'s copy of the excerpt header height, which only the latter read. - `copilot`: removes the `setEditorInfo`, `notifyAccepted` and `notifyRejected` request types, which Zed no longer sends. - Removes unused helpers in `acp_thread`, `agent`, `client`, `collab`, `fs`, `git`, `markdown`, `settings_ui`, `text`, `ui`, `util` and `workspace`. `util` drops its `serde_json_lenient` dependency. - `edit_prediction_cli` drops its library target, which only held a private module. `cli` drops an uncalled `wait_for_socket` on Linux. - Deletes orphaned files: - 12 vim Neovim recordings for tests that were removed or don't use `NeovimBackedTestContext` - `script/seed-db`, which runs a removed `collab` subcommand, and `crates/collab/seed/github_users.json`, which only seeding read - `script/squawk` and its config, `script/upload-nightly.ps1` and its helper, and the dev drive scripts, which no workflow or script calls - `Dockerfile-cross.dockerignore`, `crates/db/README.md` and `assets/themes/.gitkeep` - Removes config entries for things that no longer exist: typos excludes and an ignore pattern, a clippy entry for the removed `cocoa` crate, license clarifications for crates no longer in `Cargo.lock`, `ci.yml` references in actionlint and `check-todos`, AGENTS.md links to deleted crash tooling, a dependency line in the `new-crate` template for a crate that no longer exists, and the unread `repl.output_max_width_columns` default with its docs. ### Suggested AGENTS.md additions > For `crates/vim`: `NeovimBackedTestContext` reads `test_data/<test name>.json`. When you remove or rename a Neovim-backed test, delete or rename its recording too; nothing flags orphaned recordings. ## Testing - No references to the removed items, files or settings key remain in the tree, including in other platforms' cfg-gated code, docs and scripts. - `./script/clippy` - `cargo check --workspace --all-targets` with `-D warnings`, with default features and with `--all-features` - `cargo fmt --all -- --check` - `cargo test -p xtask -- workspace::` - `cargo test -p vim -p util -p git -p text -p markdown -p fs` ## Self-review - [x] I've reviewed my diff for quality, security, reliability, and performance. - [x] UI changes follow the [checklist](https://zed.dev/docs/development/ui-checklist). - [x] Tests cover the new or changed behavior. Release Notes: - N/A
This commit is contained in:
1 parent
b2b7331710
commit
eadffde6e9
58 files changed
+7
-2041
No files matched your search
@@ -1,32 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Squawk is a linter for database migrations. It helps identify dangerous patterns, and suggests alternatives.
|
||||
# Squawk flagging an error does not mean that you need to take a different approach, but it does indicate you need to think about what you're doing.
|
||||
# See also: https://squawkhq.com
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$GITHUB_BASE_REF" ]; then
|
||||
echo 'Not a pull request, skipping squawk modified migrations linting'
|
||||
exit
|
||||
fi
|
||||
|
||||
SQUAWK_VERSION=0.26.0
|
||||
SQUAWK_BIN="./target/squawk-$SQUAWK_VERSION"
|
||||
SQUAWK_ARGS="--assume-in-transaction --config script/lib/squawk.toml"
|
||||
|
||||
pkgutil --pkg-info com.apple.pkg.RosettaUpdateAuto || /usr/sbin/softwareupdate --install-rosetta --agree-to-license
|
||||
# When bootstrapping a brand new CI machine, the `target` directory may not exist yet.
|
||||
mkdir -p "./target"
|
||||
curl -L -o "$SQUAWK_BIN" "https://github.com/sbdchd/squawk/releases/download/v$SQUAWK_VERSION/squawk-darwin-x86_64"
|
||||
chmod +x "$SQUAWK_BIN"
|
||||
|
||||
if [ -n "$SQUAWK_GITHUB_TOKEN" ]; then
|
||||
export SQUAWK_GITHUB_REPO_OWNER=$(echo $GITHUB_REPOSITORY | awk -F/ '{print $1}')
|
||||
export SQUAWK_GITHUB_REPO_NAME=$(echo $GITHUB_REPOSITORY | awk -F/ '{print $2}')
|
||||
export SQUAWK_GITHUB_PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
|
||||
|
||||
$SQUAWK_BIN $SQUAWK_ARGS upload-to-github $(git diff --name-only origin/$GITHUB_BASE_REF...origin/$GITHUB_HEAD_REF 'crates/collab/migrations/*.sql' 'crates/collab/migrations_llm/*.sql')
|
||||
else
|
||||
$SQUAWK_BIN $SQUAWK_ARGS $(git ls-files --others crates/collab/migrations/*.sql crates/collab/migrations_llm/*.sql) $(git diff --name-only main crates/collab/migrations/*.sql crates/collab/migrations_llm/*.sql)
|
||||
fi
|
||||
Reference in new issue
Block a user