Let the candidate choose the editor indentation width
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
The code editor always indents by four spaces. INDENT is a constant in web/editor.js:4 (revision b2c2bc9), and both Tab (indentSelection) and auto-indent on Enter (indentNewline) insert it. Shift+Tab removes at most four leading spaces (/^\t|^ {1,4}/ in indentSelection).
This does not match the starter code the candidate is given. Of the 151 problems in web/problems/, 130 JavaScript starters indent by two spaces, while the Python, C, C++ and Java starters indent by four. In a JavaScript interview, the first Tab or Enter inside the starter function therefore produces a body indented at a different width from the line above it. A candidate who writes two-space or tab-indented code has no way to change this.
This falls under the editor settings gap (indentation) in the HackerRank Mock Interviews comparison of the contribution guide.
Proposed behavior
- A new editor option, beside the existing ones in
web/editor-options.js(autoIndent,autoClose, ...), selects the indentation unit: 2 spaces, 4 spaces (the default, so nothing changes for existing users) or a tab. - Tab, Shift+Tab and auto-indent on Enter on the interview page use the selected unit until the buffer has an indented block of its own, then the width that block uses, so a four-space Python starter is not nested at another width (agreed in review on #590).
- Shift+Tab removes one level of the selected unit rather than up to four spaces.
- The choice is saved the same way as the other editor options.
Out of scope: reformatting code the candidate has already written, and the task page, which honors none of the lobby's editor options today.
Acceptance criteria
- With 2 spaces selected, Tab at the start of a line inserts two spaces, Enter after
{indents the new line by two spaces more than the current one, and Shift+Tab removes two. - With tab selected, the same actions insert and remove a single
\t. - With the default, behavior is unchanged, and the existing tests in
tests/browser/editor.test.jspass unmodified. - New cases in
tests/browser/editor.test.jsandtests/browser/editor-options.test.jscover each unit and the saved option, and fail if the unit is ignored.
I am working on this and will open a pull request.
- 主要言語
- Rust
- スター
- 223
- フォーク
- 148
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 224
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
Check C++ starter node comments against the C++ harness対応中かも @bangyou0912 が今日担当しました。 オープン
sysprog21/codetrial#594 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Transcript tab does not scroll to new turns対応中かも @henrylee1003 が 1 日前に担当しました。 オープン
sysprog21/codetrial#592 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Let candidates save and switch between named session setups対応中かも @domin67 が 1 日前に担当しました。 オープン
sysprog21/codetrial#591 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
sysprog21/codetrial#587 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
CODETRIAL_DURATION_MIN does not preselect the interview length in the lobby対応中かも @RWong04 が 2 日前に担当しました。 オープン
sysprog21/codetrial#582 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
higress-group/HiRoute#405 ·
メンテナーはふだん 1 日以内に返信
-
rust_analyzer flycheck: no CLI way to enable clippy from `check.overrideCommand`対応中かも @TrapsterDK が今日担当しました。 オープンneeds-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
bazelbuild/rules_rust#4392 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
🐞 bug 🧩 bevy_gantz_egui
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
nannou-org/gantz#500 ·
メンテナーはふだん 1 日以内に返信