Rust: Sub-projects or nested projects? Project renaming?

Answered

I'm working on Wasi-Crypto, which has three Rust projects, documentation not in a project, and other supporting files. What's annoying is that opening a Rust file causes the IDE to not parse it, with a message that the file isn't part of a project. But the projects are three or four levels deep, so not detected. For more complicated projects, it would be nice if CLion worked better.

Another example is the various components of Rust Crypto, which have single projects with multitudes of what CLion would call projects, many of which are interconnected. I'd prefer something like NetBeans or Eclipse, where multiple projects are open in one window, rather than dealing with a dozen instances of CLion.

Finally, it would be nice to rename the project. Some of these projects are in directories called "rust", causing CLion's project name to just be "rust". Then having many "rust" CLion projects in the open programs list is very problematic. Almost enough for me to consider finding a different IDE.

1 comment
Comment actions Permalink
Official comment

I'm working on Wasi-Crypto, which has three Rust projects, documentation not in a project, and other supporting files. What's annoying is that opening a Rust file causes the IDE to not parse it, with a message that the file isn't part of a project. But the projects are three or four levels deep, so not detected. For more complicated projects, it would be nice if CLion worked better.

Yeah, unfortunately, Rust plugin doesn't detect non  top-level cargo projects automatically yet.
But I see two posisble solution in this case:
- merge all such parts into single Cargo workspace (as I can see, you've already done it)
- attach each project to project structure manually via `Attach` action. You can do it via Cargo tool window, context menu or from editor notification


Another example is the various components of Rust Crypto, which have single projects with multitudes of what CLion would call projects, many of which are interconnected. I'd prefer something like NetBeans or Eclipse, where multiple projects are open in one window, rather than dealing with a dozen instances of CLion.

CLion doesn't allow you to do it exactly like NetBeans or Eclipse, so you have to merge them into single project somehow and attach to Cargo project model as described above.

Finally, it would be nice to rename the project. Some of these projects are in directories called "rust", causing CLion's project name to just be "rust". Then having many "rust" CLion projects in the open programs list is very problematic. Almost enough for me to consider finding a different IDE.


It seems it's not a problem if you open the whole project instead of opening each sub Cargo project in `rust` directories separately and attach subprojects as described above. In Cargo tool window they will have names as the corresponding packages

Please sign in to leave a comment.