Skip to content

Vscode / Visual Studio tips for Rust Analyzer with cargo fuzz #352

Open
@cameronelliott

Description

Hey, thanks contributors for making and maintaining this awesome project!

I had an issue with vscode where editing files inside ProjectZ/fuzz/fuzz_targets/targetX.rs
wasn't working with or providing me any Rust Analyzer feedback.
At least when I would open the ProjectZ folder inside vscode.
I would get Rust Analyzer support when opening the fuzz folder, but that seemed to me
as a less than ideal workaround. I wanted to open the ProjectZ folder and work on both my project
and my fuzz_targets.

It turns out there is a solution by editing this into the end of my vscode settings.json,
I get Rust Analyzer support for both my parent project, and inside the fuzz/fuzz_targets folder.

    "rust-analyzer.linkedProjects": [
        "Cargo.toml",
        "fuzz/Cargo.toml"
    ]
}

At the moment I have that in my vscode user settings, and from a quick test, that global setting seems to work
fine with Rust projects without a fuzz folder.
You might want to put it in your vscode workspace settings if you want to control this on a project by project basis.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions