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

Support for non-Cargo based projects #5594

Open
maxim-banaev opened this issue Jun 17, 2020 · 7 comments
Open

Support for non-Cargo based projects #5594

maxim-banaev opened this issue Jun 17, 2020 · 7 comments
Labels
feature subsystem::tools Issues about integration with external tools like rustup, cargo, rustfmt, etc.

Comments

@maxim-banaev
Copy link

maxim-banaev commented Jun 17, 2020

Feature description

The Rust plugin currently only supports projects using Cargo.toml files. For large codebase using a centralized build system, such as Android or Fuchsia, this approach is not practical.

The rust-analyzer project provides an alternative to declare the dependencies (https://rust-analyzer.github.io/manual.html#non-cargo-based-projects). This de facto standard is already generated by Fuchsia and Android.

Would it be possible to add an option to parse this format and automatically generate the dependencies within CLion?

Submitted in CLion tracker: https://youtrack.jetbrains.com/issue/CPP-20821

@tweksteen
Copy link

cc @matklad @benbrittain @woody77

@benbrittain
Copy link

also cc/ @dtolnay who might be using rust-project.json now as well at FB

@Undin Undin added feature subsystem::tools Issues about integration with external tools like rustup, cargo, rustfmt, etc. labels Jun 21, 2020
bors bot added a commit that referenced this issue Jul 25, 2020
5690: Introduce `Crate`, `CrateGraphService` r=undin a=vlad20012

*Crate graph* is a simplified project model (comparing to complex [cargo project model](https://github.com/intellij-rust/intellij-rust/blob/master/ARCHITECTURE.md#project-model)) described in terms of *crates* (mostly from `rustc` point of view).

Crate is usually a `Target` In terms of Cargo project model

This PR solves these problems:
1. It's just simpler to work with Crate graph then with Cargo project model. Some complex code was simplified
2. Sometimes we want to have a (virtual, dummy, fake) crate where there are no cargo targets, e.g. in the case of `doctest`s
3. Now we have API that allows us to get direct/transitive/reverse dependencies of some crate
4. Now we have topological sorting of crates and persistent crate `id`s, both needed for the new name resolution 2.0
5. In theory, this opens a way to support non cargo-based projects (like #5594) 

5758: COMP: true/false completion for bool values r=Undin a=ozkriff

<!--
Hello and thank you for the pull request!

We don't have any strict rules about pull requests, but you might check
https://github.com/intellij-rust/intellij-rust/blob/master/CONTRIBUTING.md
for some hints!

Note that we need an electronic CLA for contributions:
https://github.com/intellij-rust/intellij-rust/blob/master/CONTRIBUTING.md#cla

After you sign the CLA, please add your name to
https://github.com/intellij-rust/intellij-rust/blob/master/CONTRIBUTORS.txt

:)
-->

Fixes #4443 (_"No true/false autocomplete for boolean values"_)

Co-authored-by: vlad20012 <beskvlad@gmail.com>
Co-authored-by: Andrey Lesnikov <Andrey.Lesnikov@jetbrains.com>
bors bot added a commit that referenced this issue Jul 25, 2020
5690: Introduce `Crate`, `CrateGraphService` r=undin a=vlad20012

*Crate graph* is a simplified project model (comparing to complex [cargo project model](https://github.com/intellij-rust/intellij-rust/blob/master/ARCHITECTURE.md#project-model)) described in terms of *crates* (mostly from `rustc` point of view).

Crate is usually a `Target` In terms of Cargo project model

This PR solves these problems:
1. It's just simpler to work with Crate graph then with Cargo project model. Some complex code was simplified
2. Sometimes we want to have a (virtual, dummy, fake) crate where there are no cargo targets, e.g. in the case of `doctest`s
3. Now we have API that allows us to get direct/transitive/reverse dependencies of some crate
4. Now we have topological sorting of crates and persistent crate `id`s, both needed for the new name resolution 2.0
5. In theory, this opens a way to support non cargo-based projects (like #5594) 

Co-authored-by: vlad20012 <beskvlad@gmail.com>
@TomaszWaszczyk
Copy link

Cargo in Idea++;

@nc0fr
Copy link

nc0fr commented Jul 20, 2022

Any update or improvements on this?

Being able to use Rust without Cargo is essential in some code bases that use central build systems.

@nc0fr
Copy link

nc0fr commented Jul 20, 2022

A great starting point could be to support Rust-Analyzer's JSON schema?

@nikhil-marathe-skydio
Copy link

@maxim-banaev any idea of the priority for this?

@mgeisler
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature subsystem::tools Issues about integration with external tools like rustup, cargo, rustfmt, etc.
Projects
None yet
Development

No branches or pull requests

8 participants