[Enhancement] C# playground: Roslyn / dotnet formatter for Monaco #38

Closed
opened 2026-04-28 23:48:47 +00:00 by spikerj · 1 comment
Owner

Summary

Provide C# formatting aligned with dotnet format / Roslyn conventions for the Monaco C# playground model.

Approach candidates

A. Roslyn formatter on existing backend compilation path — reuse same service that emits diagnostics (single round-trip).
B. WASM-only path if Mono/.NET toolchain exposes Microsoft.CodeAnalysis.Formatting compatible API in WASM debug story — only if bundled cost acceptable.
C. Degrade gracefully: formatter unavailable offline → tooltip explains.

Integration

  • Register provider for csharp (or our Monaco language id for .cs).
  • Preserve PDB line mapping / project layout context if formatting affects multi-file advanced sandbox (only format active file vs whole solution — specify behavior).

Dependency

Platform Format toolbar + Monaco #24 + #33 WASM/Roslyn context may intersect — coordinate breakpoints vs format ordering.

## Summary Provide **C#** formatting aligned with **`dotnet format`** / **Roslyn** conventions for the Monaco C# playground model. ## Approach candidates **A.** **Roslyn** formatter on **existing backend** compilation path — reuse same service that emits diagnostics (single round-trip). **B.** WASM-only path if Mono/.NET toolchain exposes **`Microsoft.CodeAnalysis.Formatting`** compatible API in WASM debug story — only if bundled cost acceptable. **C.** Degrade gracefully: formatter unavailable offline → tooltip explains. ## Integration - Register provider for **`csharp`** (or our Monaco language id for `.cs`). - Preserve **PDB line mapping** / project layout context if formatting affects multi-file advanced sandbox (only format active file vs whole solution — specify behavior). ## Dependency Platform Format toolbar + Monaco `#24` + `#33` WASM/Roslyn context may intersect — coordinate breakpoints vs format ordering.
Author
Owner

Migrated to spikerj/spikersoft-angular#669 as part of the umbrella-tracker breakup.

Verified 2026-08-07 against spikersoft-angular@8e5a4048 and spikersoft-backend@98102023: no C# Monaco formatter and no Roslyn formatting endpoint (only Roslyn compile/execute exists).

Status: not started — blocked on the shared Format toolbar (#35), which is also still open.

Closing here. Work now lives in the repo that holds the fix, so fixes #<N> in a PR will
auto-close it on merge. The umbrella tracker keeps cross-repo epics only.

— Opus 5 Agent

Migrated to **spikerj/spikersoft-angular#669** as part of the umbrella-tracker breakup. Verified 2026-08-07 against `spikersoft-angular@8e5a4048` and `spikersoft-backend@98102023`: no C# Monaco formatter and no Roslyn formatting endpoint (only Roslyn compile/execute exists). Status: not started — blocked on the shared Format toolbar (#35), which is also still open. Closing here. Work now lives in the repo that holds the fix, so `fixes #<N>` in a PR will auto-close it on merge. The umbrella tracker keeps cross-repo epics only. — Opus 5 Agent
Sign in to join this conversation.