Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve TypeScript diagnostics for Effect #56

Merged
merged 13 commits into from
Mar 1, 2025
Merged

Conversation

mattiamanzati
Copy link
Contributor

@mattiamanzati mattiamanzati commented Feb 23, 2025

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This PR introduces diagnostic based on the type system that specifically target the Effect type.

image

Rather than completely discard the standard TS errors (which can still be usefull), this PR introduces additional diagnostic that will appear before the TS one, that will try to help to understand following errors.

Plan of action:

  • Error when Context services are missing
  • Error when Errors are missing
  • Error when floating effects are detected
  • Mover error location in Effect.gen calls to the "gen" keyword to improve readability of the body
  • Detect when yield is used instead of yield* inside Effect.gen

Copy link

changeset-bot bot commented Feb 23, 2025

🦋 Changeset detected

Latest commit: 0626062

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/language-service Minor

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

@mattiamanzati mattiamanzati merged commit 5b2b27c into main Mar 1, 2025
3 checks passed
@mattiamanzati mattiamanzati deleted the effect-diagnostics branch March 1, 2025 13:39
@github-actions github-actions bot mentioned this pull request Jan 21, 2025
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