Skip to content

Instantly share code, notes, and snippets.

@vikpe
Last active June 3, 2025 09:16
Show Gist options
  • Save vikpe/7e5b6319f819f900b3a8b1d4a0ce894f to your computer and use it in GitHub Desktop.
Save vikpe/7e5b6319f819f900b3a8b1d4a0ce894f to your computer and use it in GitHub Desktop.
Zed: Rust analyzer - Enable all or specific crate feature flags

Zed: Rust analyzer – Enable all or specific crate feature flags

Instructions for enabling specific or all crate feature flags in the Zed editor using rust-analyzer.

1. Create a Settings File

Create a settings file in your project directory:

.zed/settings.json

2. Enable All Features

To enable all crate features, use the following configuration:

{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "features": "all"
        }
      }
    }
  }
}

3. Enable Specific Features

To enable only selected features, specify them in an array:

{
  "lsp": {
    "rust-analyzer": {
      "initialization_options": {
        "cargo": {
          "features": ["serde", "tokio"]
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment