Toggle line comments in the code editor with Ctrl+/
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
A candidate writing code in the interview editor has no shortcut to comment lines out. Ctrl+/ (Cmd+/ on macOS) does nothing in the editor today, because the editor is a plain <textarea> and web/interview.js handles only Tab, Escape and Ctrl+Enter on it.
This comes up while debugging during the Test step of REACTO: the candidate wants to disable a few lines, run the tests, and bring the lines back. The present workaround is to type # or // at the start of each line by hand and delete them again afterwards, one line at a time, while the interview clock runs.
Proposed behavior, matching what VS Code and the LeetCode editor do:
-
Ctrl+/ or Cmd+/ with a caret comments the current line, and the same chord again uncomments it.
-
With a selection it toggles every line the selection touches. If every non-blank line is already commented, the comment markers are removed; otherwise one is added to each non-blank line.
-
The marker is # for Python and // for JavaScript, C, C++ and Java, followed by one space, and is placed at the smallest indentation among the affected lines so the block stays aligned.
-
Blank lines are left alone, and the selection still covers the same text afterwards.
-
The edit goes through the same path as the existing Tab indent, so undo restores it in one step.
Scope: a pure function in web/editor.js beside indentSelection, a keydown branch in web/interview.js, and cases in tests/browser/editor.test.js. Block comments (/* */) are out of scope.
One open question for a maintainer: the limited editor mode from #252 lets a session turn off auto-indent and bracket auto-close. Should this shortcut follow one of those options, get its own, or stay always on? I would default to always on, since it changes nothing unless the candidate presses the chord.
I checked open and closed issues for "toggle comment", "comment shortcut" and "Ctrl+/" and found no existing thread. I have read web/editor.js and the editor tests and would like to work on this; Could I work on it if the behavior above is acceptable.
- Ngôn ngữ chính
- Rust
- Star
- 144
- Fork
- 41
- Merge trung bình
- 1 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 103
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của sysprog21/codetrial
-
Progress difficulty filter lists Hard before MediumCó thể đã có người làm @Pandamachi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
sysprog21/codetrial#281 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Highlight the active line in the code editorCó thể đã có người làm @ArthurArthurArthur0817 đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
sysprog21/codetrial#247 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
sysprog21/codetrial#291 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Visualize attempt score trends in the progress viewCó thể đã có người làm @onepch đã nhận 1 ngày trước. Đang mở
sysprog21/codetrial#275 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sysprog21/codetrial
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
router-for-me/EasyCLIProxyAPI#406 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-priority/P2 bug db/oracle user-priority/P1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Sweep stale notesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100