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

n KeyCode for 'next exercise' not working #2111

Open
ndom91 opened this issue Sep 14, 2024 · 5 comments
Open

n KeyCode for 'next exercise' not working #2111

ndom91 opened this issue Sep 14, 2024 · 5 comments

Comments

@ndom91
Copy link

ndom91 commented Sep 14, 2024

So I've installed rustlings successfully and generated the directory of files. I then started and tried to move on from the first exercise, however pressing n is not having any effect. The first exercise doesn't really require any changes to be able to move on, right? And the second one is just printline -> println, right? I hope I'm not just missing something simple haha.

Anyway, the other keycodes defined here all do work, like h for help or l for list. Once in the list, I can navigate up and down, press c to continue from various exercises, etc.

I tried 6.3.0 with the automatic input recognition as well as 6.2.0 where you apparently have to confirm with Enter, both do not work as expected 🤔

I'm normally using the latest kitty as a terminal with tmux. But I tried it in kitty without tmux as well as in the latest alacritty with and without tmux, all with the same issue.

Anything else I can provide to help debug?

@ndom91
Copy link
Author

ndom91 commented Sep 14, 2024

Okay, I got it working, but I am not any smarter because of it 😂

So I'm using NixOS and I had rustc and cargo manually installed initially. When I removed those and installed rustup from nixpkgs and installed the latest stable rust toolchain from rustup, and then tried rustlings (latest version, 6.3.0) again, it worked!

Previously I also wasn't even shown the n button hint below the progress bar, but now I am and it works as expected.

@ndom91 ndom91 closed this as completed Sep 14, 2024
@mo8it
Copy link
Contributor

mo8it commented Sep 15, 2024

Huh, weird. If we can reproduce it, maybe we could exit with a helpful message.

@FlafyDev
Copy link

FlafyDev commented Sep 27, 2024

you probably didn't have clippy in PATH (it shows an error while its running). nix shell nixpkgs#clippy fixed it. (at least that was the problem for me)

@thkoch2001
Copy link

I have the same issue.
I installed cargo, rust-analyzer and rustc from nixpkgs and did not install clippy. I installed rustlings via cargo install rustlings.

Some notes for myself:

  1. rust-analyzer is only mentioned once in the README under 'Working Environment' / 'Editor' and the wording suggests, that it is not a requirement. clippy is not mentioned at all in the README.
  2. I don't understand, how the availability of clippy can influence the working of the 'n' key.
  3. cargo search cargo-clippy finds cargo-clippy with version 0.0.0 which looks very dubious.
  4. cargo info cargo-clippy gives:
    error: could not find cargo-clippy in registry `https://github.com/rust-lang/crates.io-index
  5. https://crates.io/crates/cargo-clippy says it has been yanked.
  6. This resource seem to be up to date: https://github.com/rust-lang/rust-clippy
  7. After installing clippy from nixpkgs, and going to exercise 2 and back to 1, the next key was advertised and worked, even without restarting the rustlings binary.

@mo8it
Copy link
Contributor

mo8it commented Nov 24, 2024

A quick search for "Clippy install Rust" in DuckDuckGo leads to https://doc.rust-lang.org/clippy/installation.html which shows you the default installation method:

rustup component add clippy [--toolchain=<name>]

There is a link to how to compile it from source. Could be helpful if you don't want to use rustup.

You don't even need to do that if you installed Rust with rustup, the recommended way of installing Rust (also mentioned in the README). rustup installs Clippy by default.

Now, the problem is that you aren't using rustup. I am not familiar with Nix and will not solve problems related to it. This is not a Rustlings issue.

I am reopening the issue to check for the availability of Clippy on initialization. I won't be able to get to it before 04.12. though.

@mo8it mo8it reopened this Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants