Repository navigation
Fix runEffectInsideEffect for Exit runners and Effect.context, update Effect v4 to 4.0.5 - #781
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compiler diagnostics have no `source`, so filtering on it dropped every error from the v4 initial-code and quick-fix output checks. Filter on the diagnostic file instead, flatten chained messages, and let the mock host enumerate the harness type roots so @types/node resolves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Effect 4 exports Effect.context, not Effect.services, so the inserted binding failed to typecheck and an existing context binding was never reused. Fixes #779 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Effect.runPromiseExit and Effect.runSyncExit start a separate fiber just like their non-Exit forms, so they now get the same diagnostic and fix. Fixes #780 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 913a497 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merged
mattiamanzati
added a commit
to Effect-TS/tsgo
that referenced
this pull request
Oct 19, 2026
…romiseExit (#876) * test(runEffectInsideEffect): add Exit runner and existing context examples Ports runEffectInsideEffect_exit.ts (v3, v4) and runEffectInsideEffect_existingContext.ts (v4) from Effect-TS/language-service#781. The baselines record current behavior: Effect.runSyncExit and Effect.runPromiseExit are not reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(runEffectInsideEffect): report Effect.runSyncExit and Effect.runPromiseExit The Exit runners start a separate fiber just like runSync and runPromise, but the rule only matched four runner names. Port of Effect-TS/language-service#781. Fixes #873 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #779
Closes #780
Summary
This updates Effect v4 support from
4.0.0-rc.118to4.0.5and fixes two bugs inrunEffectInsideEffect.Exit runners are reported (#780)
Effect.runPromiseExitandEffect.runSyncExitstart a separate fiber, just likerunPromiseandrunSync. The rule only matched four runner names, so the Exit forms were never reported. They now get the same diagnostic and quick fix.In v4 the quick fix rewrites the call to
Effect.runPromiseExitWith(effectContext)(child). In v3 it rewrites it toRuntime.runPromiseExit(effectRuntime, child).The v4 quick fix uses
Effect.context(#779)Effect 4 exports
Effect.context, notEffect.services. The quick fix still insertedyield* Effect.services<never>(), so the fixed file no longer typechecked. It also looked for an existingservicesbinding, so an existingcontextbinding was never reused.The fix now inserts
yield* Effect.context<never>()and reuses an existing binding:Test harness
The v4 suite type-checks each example and each quick-fix output, but it filtered TypeScript diagnostics on
_.source. Compiler diagnostics have nosource, so every error was dropped. That is why #779 went unnoticed. The filter now matches on_.file?.fileName. Two other changes were needed so the check works:getDirectoriesand setstypeRootsto the harnessnode_modules/@types, so@types/noderesolves. Without this, thenodeBuiltinImportexamples fail withCannot find module 'fs'.[object Object].With the filter fixed, two unrelated quick fixes turn out to produce code that does not typecheck. Their snapshots now show the errors, and they are not fixed in this PR:
effectFnOpportunity_plainMany.ts, on a generic function that returns a union of Effects, fails with "No overload matches this call".overriddenSchemaConstructor_static.tsandoverriddenSchemaConstructor_preview.tsfail with "Property 'b' has no initializer and is not definitely assigned in the constructor".Effect 4.0.5
The version bump touches only
package.jsonfiles and the lockfile. It changed no snapshots in the v4 suite.Commits
The commits are ordered so each failing state lands before its fix:
runEffectInsideEffectfix outputs now show theProperty 'services' does not existerror from runEffectInsideEffect: v4 quick fix still emitsEffect.services, so the fixed code fails to typecheck on effect 4.x #779.Effect.contextin the v4 quick fix (runEffectInsideEffect: v4 quick fix still emitsEffect.services, so the fixed code fails to typecheck on effect 4.x #779).Effect.runPromiseExitandEffect.runSyncExitinside an Effect are not reported, unlikerunPromiseandrunSync#780).Verification
pnpm checkandpnpm lint-fixpass.pnpm test:v4: 657 passed, 3 skipped.pnpm test:v3: 653 passed, 2 skipped.🤖 Generated with Claude Code