Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cameronelliott opened this issue Dec 24, 2023 · 1 comment
Open

Comments

@cameronelliott
Copy link

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.

@cameronelliott
Copy link
Author

I wrote this to help future users. It can be closed. I will file a report at the book in case it should be added there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant