How to have completion in inactive target blocks when using rust-analyzer?

Can I enable completion and other LSP features when working on an inactive block of different targets?

On macOS block (default target on my MacBook)

On windows block

On VSCode, it's the same

I read the documentation of RA and try the following config in Zed, but does not seem to work.

{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "allTargets": true,
          "features": "all"
        },
        "check": {
          "targets": ["x86_64-pc-windows-gnu", "aarch64-apple-darwin"]
        }
      }
    }
  }
}

The current workable way I found is to set

{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "allTargets": true,
          "features": "all",
          "target": "x86_64-pc-windows-gnu" // <- This!
        },
        "check": {
          "allTargets": true,
          "targets": ["x86_64-pc-windows-gnu", "aarch64-apple-darwin"]
        }
      }
    }
  }
}

But then I can not have completion on the macOS block.

Is there a way to have RA work on both blocks? Thanks!

It may work better if you move the use std::process::Command; out of the functions.

It may work better if you move the use std::process::Command; out of the functions.

That changes nothing. Still can not make it work for both sides. It seems that this is not currently well supported?