Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>cargo-appraiserNew to Visual Studio Code? Get it now.
cargo-appraiser

cargo-appraiser

washan

|
331 installs
| (0) | Free
LSP for Cargo.toml
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

cargo-appraiser

Features

  • Workspace
    • hover on members will show the list of members
  • Dependencies
    • version decorations CleanShot 2025-01-14 at 11 55 18@2x
    • hover on version will show the available versions CleanShot 2025-01-14 at 11 56 04@2x
    • hover on git dependency will show the git reference and commit CleanShot 2025-01-14 at 11 56 55@2x
    • hover on features will show available features, hover on a feature name will show its values CleanShot 2025-01-14 at 11 57 37@2x CleanShot 2025-01-14 at 11 58 26@2x
    • code action on dependency's version CleanShot 2025-01-14 at 12 00 57@2x
    • cargo update code action on dependency's version and workspace
    • goto definition on workspace dependency
  • Audit
    • Show warining and vulnerability on dependencies

Audit Feature

Audit feature is enabled by default, to disable this feature, check audit.disabled config.

The audit feature requires cargo audit command, you can install it by running cargo install cargo-audit --locked.

Check cargo-audit for detail.

Config

VSCode specific config

{
  //vscode decoration color config, for example `cargo-appraiser.decorationColor.light: {latest: "#006400"}`
  "decorationColor": {
    //the default for light and highContrastLight
    "light": {
      "notParsed": "#808080",
      "latest": "#006400",
      "local": "#00008B",
      "notInstalled": "#808080",
      "mixedUpgradeable": "#B8860B",
      "compatibleLatest": "#B8860B",
      "nonCompatibleLatest": "#B8860B",
      "yanked": "#FF0000",
      "git": "#800080"
    },
    //the default for dark and highContrast
    "dark": {
      "notParsed": "#808080",
      "latest": "#006400",
      "local": "#00008B",
      "notInstalled": "#808080",
      "mixedUpgradeable": "#FF8C00",
      "compatibleLatest": "#FF8C00",
      "nonCompatibleLatest": "#FF8C00",
      "yanked": "#FF0000",
      "git": "#800080"
    },
    "highContrast": {
      //same as dark
    },
    "highContrastLight": {
      //same as light
    }
  }
}

lsp initialization options

To apply these config, you need to restart the lsp.

Examples

  • VSCode
{
  "cargo-appraiser.decorationFormatter": {}, //see below
  "cargo-appraiser.audit": {} //see below
}
  • Zed
{
    "lsp": {
        "cargo-appraiser": {
            "initialization_options": {
                "decorationFormatter": {}, //see below
                "audit": {} //see below
            }
        }
    }
}

Default values

{
  /// the formatter has 7 fields:
  /// latest: the dependency has the latest version installed
  /// local: the dependency is a local path dependency
  /// not_installed: the dependency is not installed maybe because of platform mismatch
  /// loading: the dependency is loading
  /// mixed_upgradeable: the installed version has an compatible upgrade, but the latest version is not compatible with the current version requirement
  /// compatible_latest: the installed version can update to latest version
  /// noncompatible_latest: the installed version can't upate to latest version and there is no compatible upgrade
  /// yanked: the installed version is yanked
  /// git: the dependency is a git dependency, support {{ref}}, {{commit}} template strings
  ///
  /// a dependency is in `waiting` state for 2 possible reasons:
  /// 1. wait for `cargo` to run. `Cargo.toml` is not saved, so `cargo` haven't picked up the change.
  /// 2. wait for `cargo` to finish. `cargo` is running in process to resolve the dependency.
  ///
  /// each field's value may has 3 template strings:
  /// - installed: the installed version
  /// - latest_matched: the latest compatible version
  /// - latest: the latest version, the latest version may or may not be compatilbe with the version requirement
  ///
  /// the default formatter is:
  "decorationFormatter": {
    "latest": "✅ {{installed}}",
    "local": "Local",
    "not_installed": "Not installed",
    "waiting": "Waiting...",
    "mixed_upgradeable": "🚀🔒 {{installed}} -> {{latest_matched}},  {{latest}}",
    "compatible_latest": "🚀 {{installed}} -> {{latest}}",
    "noncompatible_latest": "🔒 {{installed}}, {{latest}}",
    "yanked": "❌ yanked {{installed}}, {{latest_matched}}",
    "git": "🐙 {{commit}}"
  },
  "audit":{
    "disabled": false,
    // "warning" will show warning and vulnerability
    // "vulnerability" will only show vulnerability
    "level": "warning"
  }
}

Supported Editors

VS Code

VSCode is the main supported editor.

Zed

Enable inlay_hints in settings.

"inlay_hints": {
	"enabled": true
}

Vim

Vim has minimal support for now.

Thanks to

  • taplo
  • rust analyzer
  • cargo
  • rustsec
  • cargotom
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft