Repository navigation
feat: carry diagnostic severity and codes through collected-error channel - #142
jonkwheeler wants to merge 1 commit into
Conversation
…nnel
CompileError gains an optional severity ('error' | 'warning') so consumer
compilers can publish warning-severity diagnostics; error() accepts it as a
trailing parameter. tsrx-tsc now prints collected diagnostics in tsc
convention — [tsrx-tsc] file(line,col): <error|warning> <code>: message —
instead of dropping the code. The language server's compile-diagnostic plugin
maps severity 'warning' to real editor warnings.
Re-cut from feat/diagnostic-code-propagation (slice T-A, tracked in
octanejs/octane#1204; the fatal-stub emit, exit-path, and class-map emit pins
land in a follow-up).
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@jonkwheeler is attempting to deploy a commit to the Ripple Team Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4463ac7. Configure here.
| const position = | ||
| typeof start?.line === 'number' && typeof start?.column === 'number' | ||
| ? `(${start.line},${start.column + 1})` | ||
| : ''; |
There was a problem hiding this comment.
Parse errors skip tsc position
Medium Severity
logTSRXErrors only reads loc.start.line and loc.start.column, so Acorn-raised fatals (this.raise) that attach loc as { line, column } omit the new file(line,col) prefix. Typical parse failures therefore never become greppable tsc-style positions, even though they carry loc.
Reviewed by Cursor Bugbot for commit 4463ac7. Configure here.
|
Closing this slice draft for now: the typed-styling work is moving to an RFC first so the approach can be discussed with maintainers before asking for slice review. The branch and this re-cut remain intact; slices may be reopened or re-cut once the RFC settles the direction. Still tracked in the decomposition index (octanejs/octane#1204). |


Summary
Slice T-A of the typed-native-styling decomposition (tracked in octanejs/octane#1204). Re-cut from #141 — this PR carries severity/code transport only; the fatal-failure stub emit, exit-path behavior, and class-map emit/type pins land in a follow-up slice (T-B) once this merges.
CompileErrorgains an optionalseverity: 'error' | 'warning'(absent means error) anderror()accepts it as a trailing parameter, so consumer compilers (Octane's style analyzer) can publish warning-severity diagnostics instead of everything being an error.tsrx-tscprints collected diagnostics in tsc convention —[tsrx-tsc] file(line,col): <error|warning> <code>: message— instead of droppingcode.severity: 'warning'entries to real editor warnings.Why: Octane's typed-styling work emits warning-severity diagnostics (
octane-css-unused-selector, unresolved token contracts). Without severity transport they surface as errors in the editor andtsrx-tsc, which would make the warnings unshippable.Test plan
pnpm test --project typescript-plugin(incl. newtsc-error-logging.test.js— 262 tests)pnpm test --project language-serverpackages/tsrx/tests/utils/errors.test.jspnpm typecheck,pnpm format:checkProvenance
agent-authored)Re-cut mechanically from the validated diff in #141; no redesign.
Note
Low Risk
Additive API on the diagnostic collection path and presentation-only changes in the language server and tsrx-tsc logging; no auth or build-failure semantics changed unless callers opt into warning severity.
Overview
Extends the collected-diagnostics pipeline so warning-severity issues from consumer compilers (e.g. Octane style analysis) are not forced to show as errors in the editor or CLI.
CompileErroranderror()now support an optionalseverity: 'error' | 'warning'(omitted still means error). Types and JSDoc on compile results document thaterrorsmay include warnings.The language server compile-error plugin maps
severity: 'warning'toDiagnosticSeverity.Warninginstead of always using Error.tsrx-tscstderr output follows tsc-style lines:[tsrx-tsc] file(line,col): <error|warning> <code>: message, including diagnostic codes and 1-based positions whenlocis present; dedupe keys now account for position, severity, code, and message.Tests cover
error()passthrough, plugin warning surfacing, andlogTSRXErrorsformatting/deduping.Reviewed by Cursor Bugbot for commit 4463ac7. Bugbot is set up for automated code reviews on this repo. Configure here.