Skip to content

Rust-analyzer ignores "--locked" modifier and keeps changing the lockfile #19011

Closed as not planned
@Pzixel

Description

@Pzixel

I have Cargo.toml file that doesn't match Cargo.lock file and following .vscode config file:

{
    "rust-analyzer.check.extraArgs": [
        "--locked"
    ],
    "rust-analyzer.cargo.buildScripts.overrideCommand": [
      "cargo",
      "check",
      "--quiet",
      "--workspace",
      "--message-format=json",
      "--all-targets",
      "--keep-going",
      "--locked"
    ],
    "rust-analyzer.cargo.extraArgs": [
      "--locked"
    ]
}

When starting rust-analyzer I expect it to type check the project but not change the lock file. Currently when starting rust-analyzer still changes the lock file even when given the config to not:

rust-analyzer version: rust-analyzer version: 0.3.2273-standalone (248bd51 2025-01-18)

rustc version: rustc 1.85.0-nightly (6d9f6ae36 2024-12-16)

editor or extension: VSCode

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions