Skip to content

feat: runFilesでのリアルタイムdiagnostic出力機能およびエディタ表示を追加 - #239

Draft
na-trium-144 wants to merge 1 commit into
mainfrom
feat/runtime-diagnostics
Draft

feat: runFilesでのリアルタイムdiagnostic出力機能およびエディタ表示を追加#239
na-trium-144 wants to merge 1 commit into
mainfrom
feat/runtime-diagnostics

Conversation

@na-trium-144

Copy link
Copy Markdown
Contributor

close #83

  1. 共通の Diagnostic 型の定義
    • interface.ts: DiagnosticSchema / interface.ts:154-163 および DiagnosticSeverity を追加し、interface.ts:15 の interface.ts:132-137 に onDiagnostic?: (diagnostic: Diagnostic) => void
      コールバックを追加。
  2. 言語別ランタイムの Diagnostic 出力
    • TypeScript: runtime.tsx で構文・意味診断(getSyntacticDiagnostics, getSemanticDiagnostics)から interface.ts:154-163 を生成し、出力と同時に onDiagnostic に送信。
    • Python: python.ts でスタックトレースや SyntaxError の位置・メッセージをパースし、pyodide.worker.ts でエラー発生時に onDiagnostic に送信。
    • Ruby: ruby.ts でスタックトレースや SyntaxError をパースし、ruby.worker.ts でエラー発生時に onDiagnostic に送信。
    • C++ / Rust: 型とインターフェースのみ整合させ、処理はスキップ。
  3. EmbedContext でのファイル別 Diagnostic 保存 & 実行時の制御
    • embedContext.tsx: diagnostics state、addDiagnostic、clearDiagnostics を追加。
    • exec.tsx: 実行開始時に対象ファイルの clearDiagnostics を行い、interface.ts:132-137 の onDiagnostic コールバックでリアルタイムに addDiagnostic を呼び出し保存。
  4. Editor での Annotation および Marker 表示
    • editor.tsx: diagnostics[props.filename] から annotations および markers を算出して AceEditor に渡すように設定。
    • globals.css: .ace_error-marker / .ace_warning-marker / .ace_info-marker のスタイルを追加。
  5. テストの追加と検証
    • diagnostics.test.ts: Python / Ruby のエラートレースバックパース処理の単体テストを追加。
    • fileExecution.ts: ファイル実行時の diagnostic 取得テストケースを追加。
    • node:test、TypeScript型チェック(tsc)、Linter(eslint)がすべて正常に通ることを確認済みです。

@na-trium-144
na-trium-144 marked this pull request as draft August 18, 2026 05:36
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
my-code c8e5f94 Commit Preview URL

Branch Preview URL
Aug 18 2026, 05:37 AM

Base automatically changed from sandbox-page to main August 18, 2026 19:25
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

Successfully merging this pull request may close these issues.

エラー発生時にスタックトレースからエディターの該当行をハイライト

1 participant