Skip to content

Add flatMapToMap diagnostic - #760

Merged
mattiamanzati merged 1 commit into
mainfrom
feat/flat-map-to-map
Jul 10, 2026
Merged

mattiamanzati merged 1 commit into
mainfrom
feat/flat-map-to-map

Conversation

@mattiamanzati

Copy link
Copy Markdown
Contributor

Summary

  • add the suggestion-level flatMapToMap style diagnostic for Effect v3 and v4 piping flows
  • provide a quick fix that replaces Effect.flatMap with Effect.map and unwraps Effect.succeed
  • add a shared TypeParser.functionExpression parser and reuse it in catchAllToMapError
  • document the diagnostic and add generated metadata, schema, completion, fixture, and snapshot coverage

Example

Effect.succeed(1).pipe(
  Effect.flatMap((value) => Effect.succeed(value + 1))
)

becomes:

Effect.succeed(1).pipe(
  Effect.map((value) => value + 1)
)

Validation

  • pnpm codegen
  • pnpm lint-fix
  • pnpm check
  • pnpm test
  • pnpm test:v4

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f153304

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 f1fca78 into main Jul 10, 2026
5 checks passed
@mattiamanzati
mattiamanzati deleted the feat/flat-map-to-map branch July 10, 2026 12:13
@github-actions github-actions Bot mentioned this pull request Jul 10, 2026
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