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

REPL - (CMD | CTRL) + / for commenting code out #72

Open
JasonSooter opened this issue May 23, 2018 · 4 comments
Open

REPL - (CMD | CTRL) + / for commenting code out #72

JasonSooter opened this issue May 23, 2018 · 4 comments

Comments

@JasonSooter
Copy link

I often find myself wanting to comment code out in the REPL. I think this is a standard keyboard shortcut for commenting code as it works is every REPL I can think of. I'd be glad to dig into it if it something that would be approved.

@CrossEye
Copy link
Member

I think it would be very nice to have. I don't know if that is the standard, but it's certainly a version I've seen before. If you feel like digging into it, by all means, please do.

@JasonSooter
Copy link
Author

@CrossEye Well, I have been unable to get it figured out. Here's what I know:

The functionality related to commenting with CodeMirror is accomplished with the comment addon.

Adding this line import 'codemirror/addon/comment/comment'; to the REPL repository CodeMirror config file, lib/js/codemirror/codemirror.js, includes the addon.

The (CMD | CTRL) + / shortcut key for commenting appears to get turned on when giving the CodeMirror config object keyMap: 'sublime'. Adding import 'codemirror/keymap/sublime'; to the config file enables the keymap.

But I have been unable to get the commenting functionality to happen. My assumption is that it is getting blocked or ignored by the part of the REPL that is processing the code being typed and I can't seem to figure out where that is. I looked over the graphql/graphiql REPL repository which has a similar CodeMirror setup as the Ramda REPL. It has the commenting feature enabled in what I'd consider a convenient way (line and block).

I can submit the PR with the above code changes for now. And I'd be happy to keep working on it but I am at a wall with it. Maybe some insight from you or someone else might help. Thanks!

@CrossEye
Copy link
Member

I don't have much experience with the REPL code, so I probably won't be much help, but if you post a partial PR, someone who does know might be able to chip in.

Please make it clear in the PR that the code is not ready for merging.

Thanks! Sorry you hit a wall here.

@JasonSooter
Copy link
Author

@CrossEye Ok. Partial PR made. See PR. I hope you are right in that someone comes along to chip in. Thanks!

@customcommander customcommander transferred this issue from ramda/ramda.github.io Jan 18, 2022
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

2 participants