Navigate to editor lines from compiler diagnostics
メンテナーはふだん 1 日以内に返信
@yujoulai がすでに取り組んでいます。
2026年10月25日 から。
評価
この issue はまだ評価されていません。
説明
Who is affected
Candidates debugging C, C++ or Java code after Run tests reports compilation errors. The output already shows editor-relative line numbers, but candidates must manually locate each line in the editor. With several diagnostics, this means repeatedly switching between the output and the code.
Desired outcome
Make candidate-code source locations such as <source>:2:17 in the existing compilation-error output keyboard- and mouse-operable. Activating a location focuses the editor, places the caret at the beginning of the corresponding line, and scrolls that line into view using the existing active-line highlight. Each location in a multi-diagnostic result can be activated independently.
Present workaround
Read the reported line number, then manually scroll through the editor to find it.
Observed behavior
I tested Marquee Letter Tiles (marquee-letter-tiles) on codetrial 0.1.0 (c44768f), macOS 15.6.1 and Google Chrome 155.0.8059.85 (arm64). For example, running this C code displays two errors with valid editor-relative locations, but neither location provides navigation:
bool canSpellFromTiles(char* message, char* tiles) {
int first = missing_one;
int second = missing_two;
return true;
}
<source>:2:17: error: use of undeclared identifier 'missing_one'
2 | int first = missing_one;
| ^
<source>:3:18: error: use of undeclared identifier 'missing_two'
3 | int second = missing_two;
| ^
2 errors generated.
Equivalent C++ and Java tests also display both errors. Inserting three blank lines before the first failing statement shifts both reported locations by three in each language. This proposal adds navigation to those existing locations; it does not change how many diagnostics the compiler produces.
Scope and implementation direction
- Support C, C++ and Java compilation diagnostics in the current Test results panel. Navigate to the line start, even when a column is available.
- Reuse the editor-line mapping and harness distinction in
web/compiler-explorer.js; do not apply the offset again. Harness locations, external-header locations and invalid or out-of-range positions stay plain text. web/render.js::resultsMarkupcurrently renders escaped diagnostic text in a<pre>. Preserve the complete text, order and excerpts, while making only verified candidate-source locations operable. Compiler text must remain escaped.web/interview.js::runTestsalready captures code and language snapshots. Use the snapshot associated with the displayed result to guard navigation, and reuse the editor's selection, highlighting and scroll synchronization. Navigation must not dispatch a code-input event.- If the current code or language differs from that run's snapshot, refuse navigation and show a brief message such as "Code or language has changed. Run tests again to navigate to this location." This also applies to edits made while the run is pending; it does not introduce a general stale-results feature.
- Keep navigation metadata local to the browser. Preserve the diagnostic text sent to Jim and leave test judging, scoring and interview contracts unchanged.
- Python, JavaScript, runtime stack traces, column navigation and a separate Problems panel are outside this first version.
Acceptance criteria and tests
- Both source locations in the C example can be activated separately and move the caret to the correct editor line. Automated coverage includes multiple C/C++/Java diagnostics and Java diagnostics without columns.
- Each location can be reached and activated with the keyboard and has an accessible name identifying the target line. Activation focuses the editor and makes the target visible with synchronized syntax and line-number layers.
- Harness positions, external-header positions, malformed or out-of-range locations and unsupported messages remain non-navigable. Diagnostic text containing HTML special characters is displayed safely.
- If code or language differs from the associated run snapshot, activation shows the rerun message without moving the caret. Tests cover edits during a pending run and subsequent runs replacing older results.
- Navigation leaves code and undo/redo content history unchanged and does not publish a code edit. The full diagnostic output remains available after rendering or rerendering.
Add focused parser/rendering tests and browser interaction tests for these behaviors, retain the existing remapping regression coverage, and manually check a second problem with a different harness.
Related work
#217 and PR #272 correct compiler line numbers and distinguish harness diagnostics. This proposal builds on that behavior by adding editor navigation. I searched open and closed issues and PRs for clickable diagnostics, error navigation, go to line and related navigation terms on 2026-10-25 and did not find a directly matching proposal in the returned results.
- 主要言語
- Rust
- スター
- 215
- フォーク
- 141
- 平均マージ
- 1日 10時間
- マージ済み PR(30日)
- 220
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
Audio output can be confirmed without playing a test sound対応中かも @ChenYingHan1121 が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
sysprog21/codetrial#359 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Web lobby cannot reopen Setup after configuration対応中かも @YEH-YU-YANG が今日担当しました。 オープン
sysprog21/codetrial#525 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Offer a way back to Setup from the lobby対応中かも @Patriciaath999 が 1 日前に担当しました。 オープン
sysprog21/codetrial#513 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Jim's stage covers the editor, and Hide avatar does not free the space対応中かも @Phonlin が 1 日前に担当しました。 オープン
sysprog21/codetrial#512 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Add LeetCode problem numbers to UI problem mappings対応中かも @seallllllllll が 1 日前に担当しました。 オープン
sysprog21/codetrial#507 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
component:benchmark
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
agentic-os-org/ANOLISA#9177 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
oracle/rust-oracledb#61 ·
-
bug priority-medium to-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
Databricks tool-only response crashes in resolve_reasoning_and_content with KeyError: content対応中かも @1divyanshdev が今日担当しました。 オープンllm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
BerriAI/litellm#48637 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信