Remove zed -> ... -> semantic_index -> zed Cargo dependency cycle (#3127)

rust-analyzer complains about a bunch of dependency cycles:

```
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> assistant(Idx::<CrateData>(35)), alternative path: assistant(Idx::<CrateData>(35)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> breadcrumbs(Idx::<CrateData>(88)), alternative path: breadcrumbs(Idx::<CrateData>(88)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> collab_ui(Idx::<CrateData>(129)), alternative path: collab_ui(Idx::<CrateData>(129)) -> feedback(Idx::<CrateData>(219)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> feedback(Idx::<CrateData>(219)), alternative path: feedback(Idx::<CrateData>(219)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> quick_action_bar(Idx::<CrateData>(480)), alternative path: quick_action_bar(Idx::<CrateData>(480)) -> assistant(Idx::<CrateData>(35)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> search(Idx::<CrateData>(553)), alternative path: search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> semantic_index(Idx::<CrateData>(556)), alternative path: semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> terminal_view(Idx::<CrateData>(643)), alternative path: terminal_view(Idx::<CrateData>(643)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> vim(Idx::<CrateData>(748)), alternative path: vim(Idx::<CrateData>(748)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> welcome(Idx::<CrateData>(775)), alternative path: welcome(Idx::<CrateData>(775)) -> vim(Idx::<CrateData>(748)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> assistant(Idx::<CrateData>(35)), alternative path: assistant(Idx::<CrateData>(35)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> breadcrumbs(Idx::<CrateData>(88)), alternative path: breadcrumbs(Idx::<CrateData>(88)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> collab_ui(Idx::<CrateData>(129)), alternative path: collab_ui(Idx::<CrateData>(129)) -> feedback(Idx::<CrateData>(219)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> feedback(Idx::<CrateData>(219)), alternative path: feedback(Idx::<CrateData>(219)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> quick_action_bar(Idx::<CrateData>(480)), alternative path: quick_action_bar(Idx::<CrateData>(480)) -> assistant(Idx::<CrateData>(35)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> search(Idx::<CrateData>(553)), alternative path: search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> semantic_index(Idx::<CrateData>(556)), alternative path: semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> terminal_view(Idx::<CrateData>(643)), alternative path: terminal_view(Idx::<CrateData>(643)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> vim(Idx::<CrateData>(748)), alternative path: vim(Idx::<CrateData>(748)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
stderr: [ERROR project_model::workspace] cyclic deps: zed(Idx::<CrateData>(791)) -> welcome(Idx::<CrateData>(775)), alternative path: welcome(Idx::<CrateData>(775)) -> vim(Idx::<CrateData>(748)) -> search(Idx::<CrateData>(553)) -> semantic_index(Idx::<CrateData>(556)) -> zed(Idx::<CrateData>(791))
```

so move the example into `zed` instead.
This commit is contained in:
Kirill Bulatov 2023-10-13 10:35:35 +03:00 committed by GitHub
commit 634202340b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View file

@ -6956,7 +6956,6 @@ dependencies = [
"unindent",
"util",
"workspace",
"zed",
]
[[package]]
@ -10049,6 +10048,7 @@ name = "zed"
version = "0.109.0"
dependencies = [
"activity_indicator",
"ai",
"anyhow",
"assistant",
"async-compression",

View file

@ -51,7 +51,6 @@ workspace = { path = "../workspace", features = ["test-support"] }
settings = { path = "../settings", features = ["test-support"]}
rust-embed = { version = "8.0", features = ["include-exclude"] }
client = { path = "../client" }
zed = { path = "../zed"}
node_runtime = { path = "../node_runtime"}
pretty_assertions.workspace = true
@ -70,6 +69,3 @@ tree-sitter-elixir.workspace = true
tree-sitter-lua.workspace = true
tree-sitter-ruby.workspace = true
tree-sitter-php.workspace = true
[[example]]
name = "eval"

View file

@ -15,6 +15,9 @@ doctest = false
name = "Zed"
path = "src/main.rs"
[[example]]
name = "semantic_index_eval"
[dependencies]
audio = { path = "../audio" }
activity_indicator = { path = "../activity_indicator" }
@ -141,6 +144,7 @@ urlencoding = "2.1.2"
uuid.workspace = true
[dev-dependencies]
ai = { path = "../ai" }
call = { path = "../call", features = ["test-support"] }
client = { path = "../client", features = ["test-support"] }
editor = { path = "../editor", features = ["test-support"] }