-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Use Cargo.toml
instead of rust-project.json
#1935
Comments
Done in the |
@mo8it I just tried the I have a question regarding this statement:
If anything, the current state of |
Thanks for your feedback 🥰 Yes, you are right, if you just clone the repository and try to edit the exercises, the language server will not work. This is one downside of the current approach. But this only affects developing exercises. The new method of doing Rustlings is to install Rustlings using I need to add a warning when people try to work on the exercises from the repository. Thanks pointing this out. |
Indeed I spotted one issue though; out of the box, the language server is still showing the following diagnostic for every exercise file:
This is solved by editing the exercises' paths inside bin = [
- { name = "intro1", path = "../exercises/00_intro/intro1.rs" },
+ { name = "intro2", path = "exercises/00_intro/intro2.rs" },
- { name = "intro1", path = "../exercises/00_intro/intro1.rs" },
+ { name = "intro2", path = "exercises/00_intro/intro2.rs" },
... I can open a new issue if you prefer. In this case, feel free to hide my comment as "off topic". |
Good catch! Thank you very much :D It was without the prefix |
@antoineco In case you want to test the beta release of v6, here is the issue for feedback with instruction of how to install it: #1960 |
…e repo directly > Yes, you are right, if you just clone the repository and try to edit the exercises, the language server will not work. This is one downside of the current approach. But this only affects developing exercises. > > The new method of doing Rustlings is to install Rustlings using `cargo install rustlings` (not published yet), then running `rustlings init`. No repo cloning happens. Instead, the directory `rustlings/` will be created where you find the exercises. The language server works there out of the box :) > > I need to add a warning when people try to work on the exercises from the repository. Thanks pointing this out. > > -- @mo8it, rust-lang#1935 (comment) Other references: - Previous `rustlings lsp` command: rust-lang#1026 - The changelog says "LSP support out of the box", https://github.com/rust-lang/rustlings/blob/main/CHANGELOG.md#lsp-support-out-of-the-box
We can generate a
Cargo.toml
file containing a[[bin]]
entry for every exercise.This should make things much smoother and less hacky, especially because we have many issues related to the language server.
This should also enable us to use Cargo instead of rustc to run the exercises. That would especially make Clippy exercises less of a trouble. This approach also allows us to easily add dependencies to the exercises in case we want to do so in the future.
The text was updated successfully, but these errors were encountered: