Skip to content

Instantly share code, notes, and snippets.

@gyk
Created July 1, 2021 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gyk/119cea7ee8ed6f767df76833d2680cd6 to your computer and use it in GitHub Desktop.
Save gyk/119cea7ee8ed6f767df76833d2680cd6 to your computer and use it in GitHub Desktop.
Accelerate cargo-check in VS Code

Method 1 (Better)

  • .vscode\settings.json

    {
        "rust-analyzer.checkOnSave.overrideCommand": [
            "cargo",
            "+nightly",
            "check",
            "--message-format=json",
            "--package=$YOUR_PACKAGE"
        ]
    }

Method 2

  • .cargo/config.toml

    [alias]
    check2 = "check --message-format=json --package=$YOUR_PACKAGE"

    and in ~\AppData\Roaming\Code\User\settings.json

    {
        "rust-analyzer.checkOnSave.overrideCommand": [
            "cargo",
            "check2"
        ]
    }
  • rustup override set nightly (Stored in ~/.rustup/settings.toml)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment