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

fix: Include exercises folder in the project structure behind a feature #917

Merged
merged 1 commit into from
Mar 29, 2022
Merged

Conversation

x-hgg-x
Copy link
Contributor

@x-hgg-x x-hgg-x commented Jan 18, 2022

closes #859
closes #913
closes #942

Related to #443 and #289.

This allows rust-analyzer to work normally after adding the setting "rust-analyzer.cargo.features": ["exercises"].

@x-hgg-x x-hgg-x mentioned this pull request Jan 18, 2022
@shadows-withal
Copy link
Member

Does this require an adjustment on the user's side (just to make sure I'm understanding this correctly)? If so, can this specific configuration change for rust-analyzer be done per-project? I'm not too familiar with its configuration.

@x-hgg-x
Copy link
Contributor Author

x-hgg-x commented Jan 19, 2022

Yes you can set this setting per-project.
For Visual Studio Code you create the file .vscode/settings.json with the content:

{
    "rust-analyzer.cargo.features": ["exercises"],
}

It should also work with other IDEs if they allow to set cargo features.

@x-hgg-x
Copy link
Contributor Author

x-hgg-x commented Jan 20, 2022

It also works in IntelliJ Rust without any settings since the plugin seems to run cargo with the --all-features parameter by default.

@fabianlupa
Copy link

Found this PR after having no analysis in CLion and applying the patch seems to have fixed it perfectly without any additional configuration.

@shadows-withal
Copy link
Member

Okay, so as long as you enable running either with all features or specifically that feature it works... I think that's a good enough compromise for us, given that we don't use the standard Rust directory layout in the first place. I'll merge this and document it in the README file.

@shadows-withal shadows-withal merged commit 179a75a into rust-lang:main Mar 29, 2022
@shadows-withal
Copy link
Member

@all-contributors please add @x-hgg-x for code

@allcontributors
Copy link
Contributor

@diannasoreil

I've put up a pull request to add @x-hgg-x! 🎉

@alexrecuenco
Copy link

It seems that this fix was later removed in ed0f278 for 5.x (ed0f278)

Any reason why?

Any documentation in what rustlings expect us to do with intellisense on the 5.x versions?

@shadows-withal
Copy link
Member

@alexrecuenco This was our first implementation of LSP functionality, which we ended up removing in favor of https://github.com/rust-lang/rustlings#enabling-rust-analyzer.

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