Skip to content

Add Active-Exercise-File Mode #709

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

Closed
zottelsheep opened this issue Apr 18, 2021 · 3 comments
Closed

Add Active-Exercise-File Mode #709

zottelsheep opened this issue Apr 18, 2021 · 3 comments

Comments

@zottelsheep
Copy link

I think it's a hassle to always open a new file for each new exercise in watch mode. It would be great, to only have one file where the exercise is located. Then if you delete the //I'm not done comment, the contents of the file changes to the next exercise. I am new to Rust so I don't have to much insight of how this could be implemented, but I have come up with two possible solutions:

Solution 1

Create one file where the contents of the active exercise gets copied into. Maybe it could be an extra option to the watch command

Solution 2

Use a symbolic link, that gets updated to the active exercise. This could be simply used alongside the original behaviour, without changing much, as far as I am aware.

@calebmeyer
Copy link

Solution 3:
Allow rustlings to call a shell command of your choosing with the full path of the next exercise. Default it to $EDITOR. So if you want to do atom path/to/next or code path/to/next or clion path/to/next or vim path/to/next or whatever.

Suggested syntax:
rustlings watch -e atom or rustlings watch --editor atom

@kitesi
Copy link

kitesi commented Jun 30, 2021

Why not just open the entire exercises folder?

@mo8it
Copy link
Contributor

mo8it commented Mar 27, 2024

Closing because that can be very problematic depending on the used editor. There is also a potential for a race condition here.

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