zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
49.03k stars 2.96k forks source link

`rust-analyzer.linkedProjects` does not work #19897

Open SkymanOne opened 15 hours ago

SkymanOne commented 15 hours ago

Check for existing issues

Describe the bug / provide steps to reproduce it

I have this as a project settings:

{
  "rust-analyzer": {
    "linkedProjects": [
      "./methods/guest/Cargo.toml",
      "./host/Cargo.toml"
    ]
  }
}

However, when openining a rust files in /methods/guest, I get:

rust-analyzer: This file is not included in any crates, so rust-analyzer can't offer IDE services.

Configuring the same in VS Code works perfectly.

Environment

Zed: v0.158.2 (Zed) OS: macOS 14.6.1 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

Screenshot 2024-10-29 at 13 46 50

If applicable, attach your Zed.log file to this issue.

No response

notpeter commented 8 hours ago

I think the settings need to be nested inside initialization_options. Can you try:

{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "linkedProjects": [
          "./methods/guest/Cargo.toml",
          "./host/Cargo.toml"
        ]
      }
    }
  }
}