Skip to content

Use rust-project.json instead of patching Cargo.toml #5803

Closed
@ragne

Description

@ragne

Preface

I've noticed that to use rust-analyzer with clippy you need to run cargo dev ra-setup, which'll patch existing Cargo.toml for workspace and clippy-lints.
After that it was cumbersome (maybe just for me) to run compile/test because now cargo basically tries to compile parts of the rust.
And of course you need to get rid of those bits before submitting a PR.

Proposal

Nowadays rust-analyzer has a different way to define a project, mostly intended for projects that don't use Cargo. One can write a rust-project.json and point rust-analyzer to that file instead.
Could it be used instead and put into .gitignore for example? I think it should be more convenient than current solution.

I probably can take the ticket on the next week and try to come with PR.
Main questions (assuming approach works):

  • Should it replace existing ra-setup or add a feature flag?
  • Should it try to locate .vscode settings and specify rust-analyzer.linkedProjects for user?
  • Support for any other editors if previous is true?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-infraArea: CI issues and issues that require full access for GitHub/CIC-an-interesting-projectCategory: Interesting projects, that usually are more involved design/code wise.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions