Repository navigation
feat(effect): native Effect diagnostics in tsc-rs - #4
Conversation
Port of Effect-TS/tsgo at @effect/tsgo@0.46.1 (f1a7cad0): the type parser, all 116 diagnostic rules, @effect/language-service config parsing with the extends deep merge and per-file overrides, @effect-diagnostics directives, and the tsc exit-code options. Rules run after the checker checks a file and add their diagnostics to it, so one program and one checker produce ordinary and Effect diagnostics. Projects without the plugin run nothing. Adds focused fixtures and differential scripts under scripts/effect, and docs/effect-diagnostics.md. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Macroscope skipped reviewing this pull request. Per-review cost limit exceeded (workspace setting). This review would cost an estimated $53.18, which exceeds your per-review limit of $15.00. The top 3 files driving up this estimate:
Tip To get this pull request reviewed, you can:
|
Rustdoc compiled the indented TypeScript examples in ported Go comments as Rust doctests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- get_relation_errors checks an unchecked file even when the checker has no current context, as Go does with a nil context. - The exit-code filter borrows the diagnostics when there are no Effect options, so projects without the plugin copy nothing. - Docs: a plugin entry with only a name runs every rule at its default. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Note 🤖 Claude Opus 5.5 responding on behalf of Theo Independent review of the hand-written integration layer (hooks, options, merge, directives, runner, build info) found no behavior differences from the Go reference. Projects without the plugin are unchanged. Three small items are fixed in cd9c04b:
Left as is, on purpose:
After the fixes: 529/529 reference cases, 13/13 fixtures and 8/8 incremental and watch steps still match the reference. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lugin Since PR #4 the effect training config lists @effect/language-service, so PGO trained only the Effect path there. Training it both ways (pgotrain2 study, PGO-only bins on alvin) is 0.5% faster with and without the plugin; dropping the plugin from training instead makes plugin runs 2.3% slower. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…gain tsc-rs from Theo PR pingdotgg#4, before effectfix2, wrote build info with the Effect options and diagnostics but the plain version. A standalone API process (no Effect rules) took that version as its own and reused the Effect diagnostics. effect-tsgo sees another version there and builds again. is_valid_version now also asks for no Effect options when the reader runs no rules, so the API and plain tsc-rs build again too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Projects that use Effect need a second compiler for its diagnostics. T3 Code runs
tsc-rs --noEmitand theneffect-tsgo diagnostics, a second full Go check of the same project. That makes a complete check 2x slower than Effect-patched TypeScript alone.This PR adds the Effect language service diagnostics (
@effect/language-service, TS377xxx) to tsc-rs itself. They come from the same program and checker pass as the ordinary TypeScript diagnostics.How
crates/ts_goport/src/effectis a line-by-line port of Effect-TS/tsgo at the@effect/tsgo@0.46.1release commitf1a7cad0: the type parser, all 116 rules, plugin config parsing (defaults,extendsdeep merge, per-fileoverrides),@effect-diagnosticsdirectives, and the exit-code options.checkSourceFile, and relation-error capture@ts-ignoredoes not hide Effect diagnosticsnoEmitOnErrorfilters.tsbuildinfoholds the Effect options, so a config change invalidates cached diagnostics@effect/language-serviceplugin entry, nothing runs. The language server shows the same diagnostics, because the hook is in the checker.--versionis unchanged.Verification
All against the reference Effect-patched tsc (TypeScript 7.0.2 +
@effect/tsgo0.46.1):a7ce09c3, 14 workspacescrates/ts_goport/tests/effect_fixtures)--incrementaland--watchafter source, imported type, config and directive edits--prettyoutputThe scripts are in
scripts/effect;docs/effect-diagnostics.mddescribes them.Timing (T3 Code, Mac ARM64)
Medians of 5 sequential runs in rotated order. Both Rust builds use the
goportprofile. Seconds:A complete check is about 2x faster than Go + Effect and 4-5x faster than the current two-pass setup. Each rule walks the file, as in the reference, so a shared walk is a possible later speedup.
Notes
Nonecheck.--noEmitand errors, tsc-rs exits 2 where TS 7.0.2 exits 1. That is the pinned TypeScript Go behavior, not part of this change.🤖 Generated with Claude Code. Opus 5.5 in Claude Code (T3 Code harness), with Opus 5.5 subagents for the rule and type parser port lanes.
Note
Add native Effect diagnostics to tsc-rs compiler
effect.after_check_source_fileafter ordinary type checking.@effect-diagnosticscomment directives (line, next-line, file-level,*:skip-file) plus unused-directive reporting; TypeScript@ts-ignoreno longer suppresses Effect codes.ignoreEffectErrorsInTscExitCodeetc.), persisted Effect options in incremental build info, and a large fixture suite plus benchmark/parity/LSP scripts under scripts/effect.check_source_filein checker_p03.rs) now clears prior Effect relation errors and runs the Effect pass on every check;get_diagnostics_with_preceding_directivesin program.rs exempts 377xxx codes from ordinary ignore-directive suppression.Macroscope summarized cd9c04b.