#5814569328 Thanks @mattiamanzati! - Add effectFnOpportunity diagnostic that suggests converting functions returning Effect.gen to Effect.fn for better tracing and concise syntax.
The diagnostic triggers on:
Arrow functions returning Effect.gen(...)
Function expressions returning Effect.gen(...)
Function declarations returning Effect.gen(...)
Functions with Effect.gen(...).pipe(...) patterns
It provides two code fixes:
Convert to Effect.fn (traced) - includes the function name as the span name
Convert to Effect.fnUntraced - without tracing
The diagnostic skips:
Generator functions (can't be converted)
Named function expressions (typically used for recursion)
Functions with multiple call signatures (overloads)
When the original function has a return type annotation, the converted function will use Effect.fn.Return<A, E, R> as the return type.
Example:
// Before
exportconstmyFunction=(a: number)=>Effect.gen(function*(){yield*Effect.succeed(1);returna;});// After (with Effect.fn)
exportconstmyFunction=Effect.fn("myFunction")(function*(a: number){yield*Effect.succeed(1);returna;});// Before (with pipe)
exportconstwithPipe=()=>Effect.gen(function*(){returnyield*Effect.succeed(1);}).pipe(Effect.withSpan("withPipe"));// After (with Effect.fn)
exportconstwithPipe=Effect.fn("withPipe")(function*(){returnyield*Effect.succeed(1);},Effect.withSpan("withPipe"));
#57500aeed0 Thanks @mattiamanzati! - Add effectMapVoid diagnostic that suggests using Effect.asVoid instead of Effect.map(() => void 0), Effect.map(() => undefined), or Effect.map(() => {}).
Also adds two new TypeParser utilities:
lazyExpression: matches zero-argument arrow functions or function expressions that return a single expression
emptyFunction: matches arrow functions or function expressions with an empty block body
And adds isVoidExpression utility to TypeScriptUtils for detecting void 0 or undefined expressions.
Example:
// Before
Effect.succeed(1).pipe(Effect.map(()=>void0));Effect.succeed(1).pipe(Effect.map(()=>undefined));Effect.succeed(1).pipe(Effect.map(()=>{}));// After (suggested fix)
Effect.succeed(1).pipe(Effect.asVoid);
#58294d4a6b Thanks @mattiamanzati! - Added layerinfo CLI command that provides detailed information about a specific exported layer.
Features:
Shows layer type, location, and description
Lists services the layer provides and requires
Suggests optimal layer composition order using Layer.provide, Layer.provideMerge, and Layer.merge
Also added a tip to both overview and layerinfo commands about using Layer.mergeAll(...) to get suggested composition order.
#583b0aa78f Thanks @mattiamanzati! - Add redundantSchemaTagIdentifier diagnostic that suggests removing redundant identifier arguments when they equal the tag value in Schema.TaggedClass, Schema.TaggedError, or Schema.TaggedRequest.
Also updates the completions to not include the redundant identifier when autocompleting Schema.TaggedClass, Schema.TaggedError, and Schema.TaggedRequest.
#5736715f91 Thanks @mattiamanzati! - Rename reportSuggestionsAsWarningsInTsc option to includeSuggestionsInTsc and change default to true.
This option controls whether diagnostics with "suggestion" severity are included in TSC output when using the effect-language-service patch feature. When enabled, suggestions are reported as messages in TSC output, which is useful for LLM-based development tools to see all suggestions.
Breaking change: The option has been renamed and the default behavior has changed:
Old: reportSuggestionsAsWarningsInTsc: false (suggestions not included by default)
New: includeSuggestionsInTsc: true (suggestions included by default)
To restore the previous behavior, set "includeSuggestionsInTsc": false in your tsconfig.json plugin configuration.
The setup command now automatically manages Effect Language Service documentation in AGENTS.md and CLAUDE.md files:
When installing: Adds or updates the Effect Language Service section with markers
When uninstalling: Removes the section if present
Case-insensitive file detection (supports both lowercase and uppercase filenames)
Skips symlinked files to avoid modifying linked content
Shows proper diff view for markdown file changes
Example section added to markdown files:
<!-- effect-language-service:start -->## Effect Language Service
The Effect Language Service comes in with a useful CLI that can help you with commands to get a better understanding your Effect Layers and Services, and to help you compose them correctly.
<!-- effect-language-service:end -->
Patch Changes
#580a45606b Thanks @mattiamanzati! - Add Effect.fn and Effect.fnUntraced support to the piping flows parser.
The piping flows parser now recognizes pipe transformations passed as additional arguments to Effect.fn, Effect.fn("traced"), and Effect.fnUntraced. This enables diagnostics like catchAllToMapError, catchUnfailableEffect, and multipleEffectProvide to work with these patterns.
Example:
// This will now trigger the catchAllToMapError diagnostic
constexample=Effect.fn(function*(){returnyield*Effect.fail("error");},Effect.catchAll((cause)=>Effect.fail(newMyError(cause))));
#5877316859 Thanks @mattiamanzati! - Mark deprecated TypeScript Signature methods and migrate to property accessors
Added @deprecated annotations to TypeScript Signature interface methods (getParameters, getTypeParameters, getDeclaration, getReturnType, getTypeParameterAtPosition) with guidance to use their modern property alternatives. Updated codebase usage of getParameters() to use .parameters property instead.
#584ed12861 Thanks @mattiamanzati! - Fix TypeError in setup command when updating existing diagnosticSeverity configuration
The setup command was throwing TypeError: Cannot read properties of undefined (reading 'text') when trying to update the diagnosticSeverity option of an existing @effect/language-service plugin configuration in tsconfig.json.
This occurred because TypeScript's ChangeTracker formatter needed to compute indentation by traversing the AST tree, which failed when replacing a PropertyAssignment node inside a nested list context.
The fix replaces just the initializer value (ObjectLiteralExpression) instead of the entire PropertyAssignment, avoiding the problematic list indentation calculation.
#5857ebe5db Thanks @mattiamanzati! - Enhanced layerinfo CLI command with output type selection for layer composition.
New Features:
Added --outputs option to select which output types to include in the suggested composition (e.g., --outputs 1,2,3)
Shows all available output types from the layer graph with indexed checkboxes
By default, only types that are in the layer's declared ROut are selected
Composition code now includes export const <name> = ... prefix for easy copy-paste
Example output:
Suggested Composition:
Not sure you got your composition right? Just write all layers inside a Layer.mergeAll(...)
then run this command again and use --outputs to select which outputs to include in composition.
Example: --outputs 1,2,3
[ ] 1. Cache
[x] 2. UserRepository
export const simplePipeIn = UserRepository.Default.pipe(
Layer.provide(Cache.Default)
)
This allows users to see all available outputs from a layer composition and choose which ones to include in the suggested composition order.
#5770ed50c3 Thanks @mattiamanzati! - Refactor catchAllToMapError diagnostic to use the piping flows parser for detecting Effect.catchAll calls.
This change also:
Makes outType optional in ParsedPipingFlowSubject to handle cases where type information is unavailable
Sorts piping flows by position for consistent ordering
#578cab6ce8 Thanks @mattiamanzati! - refactor: use piping flows parser in catchUnfailableEffect diagnostic
#5792a82522 Thanks @mattiamanzati! - refactor: use piping flows parser in multipleEffectProvide diagnostic
#5700db6e28 Thanks @mattiamanzati! - Refactor CLI overview command to extract symbol collection logic into reusable utility
Extract collectSourceFileExportedSymbols into src/cli/utils/ExportedSymbols.ts for reuse across CLI commands
Add --max-symbol-depth option to overview command (default: 3) to control how deep to traverse nested symbol properties
Add tests for the overview command with snapshot testing
#5749d0695e Thanks @mattiamanzati! - Remove deprecated ts-patch documentation from README. The Effect LSP CLI Patch is now the only recommended approach for getting diagnostics at compile time.
#5765017d75 Thanks @mattiamanzati! - Add piping flows parser for caching piping flow analysis per source file.
This internal improvement introduces a pipingFlows function in TypeParser that analyzes and caches all piping flows (both pipe() calls and .pipe() method chains) in a source file. The parser:
Identifies piping flows including nested pipes and mixed call styles (e.g., Effect.map(effect, fn).pipe(...))
Tracks the subject, transformations, and intermediate types for each flow
Enables more efficient diagnostic implementations by reusing cached analysis
The missedPipeableOpportunity diagnostic has been refactored to use this new parser, improving performance when analyzing files with multiple piping patterns.
#568477271d Thanks @mattiamanzati! - Fix auto-import with namespace import packages generating malformed code when the identifier is at the beginning of the file.
When using namespaceImportPackages configuration and auto-completing an export like isAnyKeyword from effect/SchemaAST, the code was incorrectly generated as:
#567dcb3fe5 Thanks @mattiamanzati! - Added new diagnostic catchAllToMapError that suggests using Effect.mapError instead of Effect.catchAll + Effect.fail when the callback only wraps the error.
The diagnostic includes a quick fix that automatically transforms the code.
#5550424000 Thanks @mattiamanzati! - Add globalErrorInEffectCatch diagnostic to detect global Error types in catch callbacks
This new diagnostic warns when catch callbacks in Effect.tryPromise, Effect.try, Effect.tryMap, or Effect.tryMapPromise return the global Error type instead of typed errors.
Using the global Error type in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error cases. Instead, it's better to use tagged errors (like Data.TaggedError) or custom errors with discriminator properties to enable proper type checking and error handling.
Example of code that triggers the diagnostic:
Effect.tryPromise({try:()=>fetch("http://example.com"),catch:()=>newError("Request failed"),// ⚠️ Warning: returns global Error type
});
This diagnostic also improves the clarity message for the leakingRequirements diagnostic by adding additional guidance on how services should be collected in the layer creation body.
#558cc5feb1 Thanks @mattiamanzati! - Add layerMergeAllWithDependencies diagnostic to detect interdependencies in Layer.mergeAll calls
This new diagnostic warns when Layer.mergeAll is called with layers that have interdependencies, where one layer provides a service that another layer in the same call requires.
Layer.mergeAll creates layers in parallel, so dependencies between layers will not be satisfied. This can lead to runtime errors when trying to use the merged layer.
Example of code that triggers the diagnostic:
exportclassDbConnectionextendsEffect.Service<DbConnection>()("DbConnection",{succeed:{},}){}exportclassFileSystemextendsEffect.Service<FileSystem>()("FileSystem",{succeed:{},}){}exportclassCacheextendsEffect.Service<Cache>()("Cache",{effect: Effect.as(FileSystem,{}),// Cache requires FileSystem
}){}// ⚠️ Warning on FileSystem.Default
constlayers=Layer.mergeAll(DbConnection.Default,FileSystem.Default,// This provides FileSystem
Cache.Default// This requires FileSystem
);
Recommended approach:
// Provide FileSystem separately before merging
constlayers=Layer.mergeAll(DbConnection.Default,Cache.Default).pipe(Layer.provideMerge(FileSystem.Default));
The diagnostic correctly handles pass-through layers (layers that both provide and require the same type) and only reports on layers that actually provide dependencies needed by other layers in the same mergeAll call.
#55783ce411 Thanks @mattiamanzati! - Add missingLayerContext diagnostic to detect missing service requirements in Layer definitions
This new diagnostic provides better error readability when you're missing service requirements in your Layer type definitions. It works similarly to the existing missingEffectContext diagnostic but specifically checks the RIn (requirements input) parameter of Layer types.
Example of code that triggers the diagnostic:
import*asEffectfrom"effect/Effect";import*asLayerfrom"effect/Layer";classServiceAextendsEffect.Service<ServiceA>()("ServiceA",{succeed:{a: 1},}){}classServiceBextendsEffect.Service<ServiceB>()("ServiceB",{succeed:{a: 2},}){}declareconstlayerWithServices: Layer.Layer<ServiceA,never,ServiceB>;functiontestFn(layer: Layer.Layer<ServiceA>){returnlayer;}// ⚠️ Error: Missing 'ServiceB' in the expected Layer context.
testFn(layerWithServices);
The diagnostic helps catch type mismatches early by clearly indicating which service requirements are missing when passing layers between functions or composing layers together.
#56257d5af2 Thanks @mattiamanzati! - Add overview CLI command that provides an overview of Effect-related exports in a project.
The command analyzes TypeScript files and reports all exported yieldable errors, services (Context.Tag, Effect.Tag, Effect.Service), and layers with their types, file locations, and JSDoc descriptions. A progress spinner shows real-time file processing status.
#561c3b3bd3 Thanks @mattiamanzati! - Add descriptions to CLI commands using Command.withDescription for improved help output when using --help flag.
#5652274aef Thanks @mattiamanzati! - Fix unnecessaryPipe diagnostic and refactor not working with namespace imports from effect/Function (e.g., Function.pipe() or Fn.pipe())
#56075a480e Thanks @mattiamanzati! - Improve diagnostic message for unsupportedServiceAccessors when used with Effect.Tag
When the unsupportedServiceAccessors diagnostic is triggered on an Effect.Tag class (which doesn't allow disabling accessors), the message now includes a helpful suggestion to use Context.Tag instead:
exportclassMyServiceextendsEffect.Tag("MyService")<MyService,{method:<A>(value: A)=>Effect.Effect<A>;}>(){}// Diagnostic: Even if accessors are enabled, accessors for 'method' won't be available
// because the signature have generic type parameters or multiple call signatures.
// Effect.Tag does not allow to disable accessors, so you may want to use Context.Tag instead.
#5594c1f809 Thanks @mattiamanzati! - Improve Layer Magic refactor ordering by considering both provided and required service counts
The Layer Magic refactor now uses a combined ordering heuristic that considers both:
The number of services a layer provides
The number of services a layer requires
This results in more optimal layer composition order, especially in complex dependency graphs where layers have varying numbers of dependencies.
The diagnostic messages for globalErrorInEffectCatch and globalErrorInEffectFailure now use the more generic term "tagged errors" instead of "tagged errors (Data.TaggedError)" to provide cleaner, more concise guidance.
The CLI now attempts to resolve TypeScript from the current working directory first before falling back to the package's bundled version. This ensures the CLI uses the same TypeScript version as the project being analyzed.
This diagnostic warns when Effect.fail is called with the global Error type. Using the global Error type in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error types.
Instead, the diagnostic recommends using:
Tagged errors with Data.TaggedError
Custom error classes with a discriminator property (like _tag)
Example:
// This will trigger a warning
Effect.fail(newError("global error"));// These are recommended alternatives
Effect.fail(newCustomError());// where CustomError extends Data.TaggedError
Effect.fail(newMyError());// where MyError has a _tag property
This new command provides an interactive wizard to guide users through the complete installation and configuration of the Effect Language Service. The setup command:
Analyzes your repository structure (package.json, tsconfig files)
Guides you through adding the package to devDependencies
Configures the TypeScript plugin in your tsconfig.json
Allows customizing diagnostic severity levels
Optionally adds prepare script for automatic patching
Optionally configures VS Code settings for workspace TypeScript usage
Shows a review of all changes before applying them
Example usage:
effect-language-service setup
The wizard will walk you through each step and show you exactly what changes will be made before applying them.
#5504912ee4 Thanks @mattiamanzati! - Add support for @effect/sql's Model.Class in completions and diagnostics
Added effectSqlModelSelfInClasses completion: Auto-completes the Self type parameter when extending Model.Class from @effect/sql
Extended classSelfMismatch diagnostic: Now detects when the Self type parameter in Model.Class<Self> doesn't match the actual class name
Example:
import{Model}from"@​effect/sql";import*asSchemafrom"effect/Schema";// Completion triggers after "Model." to generate the full class boilerplate
exportclassUserextendsModel.Class<User>("User")({id: Schema.String,}){}// Diagnostic warns when Self type parameter doesn't match class name
exportclassUserextendsModel.Class<WrongName>("User")({// ^^^^^^^^^ Self type should be "User"
id: Schema.String,}){}
This refactoring adds a new getTypeAtLocation function to TypeCheckerUtils that safely retrieves types while filtering out JSX-specific nodes (JSX elements, opening/closing tags, and JSX attributes) that could cause issues when calling typeChecker.getTypeAtLocation.
The utility is now used across multiple diagnostics and features, reducing code duplication and ensuring consistent handling of edge cases:
anyUnknownInErrorContext
catchUnfailableEffect
floatingEffect
globalErrorInEffectFailure
leakingRequirements
missedPipeableOpportunity
missingEffectServiceDependency
missingReturnYieldStar
multipleEffectProvide
nonObjectEffectServiceType
overriddenSchemaConstructor
returnEffectInGen
scopeInLayerEffect
strictBooleanExpressions
strictEffectProvide
unnecessaryFailYieldableError
And other features like quick info, goto definition, and refactors
Previously, Effect., Option., and Either.__ completions were incorrectly suggested inside import statements. This has been fixed by detecting when the completion is requested inside an import declaration and preventing these completions from appearing.
#5394cc88d2 Thanks @mattiamanzati! - Improve layerMagic refactor to prioritize layers with more provided services
The layerMagic refactor now uses a heuristic that prioritizes nodes with more provided services when generating layer composition code. This ensures that telemetry and tracing layers (which typically provide fewer services) are positioned as late as possible in the dependency graph, resulting in more intuitive and correct layer ordering.
Example: When composing layers for services that depend on HttpClient with telemetry, the refactor now correctly places the telemetry layer (which provides fewer services) later in the composition chain.
#537e31c03b Thanks @mattiamanzati! - Fix counter increment timing in structural type to schema refactor to ensure proper naming of conflicting schemas (e.g., User_1 instead of User_0 for the first conflict)
#535361fc1e Thanks @mattiamanzati! - Fix duplicate schema names in "Refactor to Schema (Recursive Structural)" code generation.
When the refactor encountered types with conflicting names, it was generating a unique suffix but not properly tracking the usage count, causing duplicate schema identifiers with different contents to be generated.
This fix ensures that when a name conflict is detected and a unique suffix is added (e.g., Tax, Tax_1, Tax_2), the usage counter is properly incremented to prevent duplicate identifiers in the generated code.
This adds a new // @​effect-codegens typeToSchema codegen that automatically generates Effect Schema classes from TypeScript types. Given a type alias with object members representing schemas to generate (e.g., type ToGenerate = { UserSchema: User, TodoSchema: Todo }), the codegen will create the corresponding Schema class definitions.
The generated schemas:
Automatically detect and reuse existing schema definitions in the file
Support both type aliases and interfaces
Include outdated detection to warn when the source type changes
Work with the outdatedEffectCodegen diagnostic to provide automatic fix actions
Example usage:
typeUser={id: number;name: string;};// @​effect-codegens typeToSchema
exporttypeToGenerate={UserSchema: User;};// Generated by the codegen:
exportclassUserSchemaextendsSchema.Class<UserSchema>("UserSchema")({id: Schema.Number,name: Schema.String,}){}
Patch Changes
#5305ecdc62 Thanks @mattiamanzati! - Fix Refactor to Schema (Recursive Structural) to support exactOptionalPropertyTypes
When exactOptionalPropertyTypes is enabled in tsconfig, optional properties with types like string | undefined are not assignable to types defined as prop?: string. This fix generates Schema.optionalWith(Schema.String, { exact: true }) instead of Schema.optional(Schema.Union(Schema.Undefined, Schema.String)) to maintain type compatibility with external libraries that don't always include undefined in their optional property types.
Example:
// With exactOptionalPropertyTypes enabled
typeUser={name?: string;// External library type (e.g., Stripe API)
};// Generated schema now uses:
Schema.optionalWith(Schema.String,{exact: true});// Instead of:
Schema.optional(Schema.Union(Schema.Undefined,Schema.String));
This ensures the generated schema maintains proper type compatibility with external libraries when using strict TypeScript configurations.
Adds a new "Structural Type to Schema" refactor that converts TypeScript interfaces and type aliases to Effect Schema classes. This refactor analyzes the structure of types and generates appropriate Schema definitions, with intelligent detection and reuse of existing schemas.
Example:
// Before
exportinterfaceUser{id: number;name: string;}// After (using the refactor)
exportclassUserextendsSchema.Class<User>("User")({id: Schema.Number,name: Schema.String,}){}
The refactor supports:
All primitive types and common TypeScript constructs
Automatic reuse of existing Schema definitions for referenced types
Optional properties, unions, intersections, and nested structures
#593665e9e35 Thanks @schickling! - Document subtle CORS middleware allowedHeaders behavior: when empty array (default), it reflects back the client's Access-Control-Request-Headers (permissive), and when non-empty array, it only allows specified headers (restrictive). Added comprehensive JSDoc with examples.
#5940ee69cd7 Thanks @kitlangton! - HttpServerResponse: fix fromWeb to preserve Content-Type header when response has a body
Previously, when converting a web Response to an HttpServerResponse via fromWeb, the Content-Type header was not passed to Body.stream(), causing it to default to application/octet-stream. This affected any code using HttpApp.fromWebHandler to wrap web handlers, as JSON responses would incorrectly have their Content-Type set to application/octet-stream instead of application/json.
This PR contains the following updates:
| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@effect/language-service](https://github.com/Effect-TS/language-service) | [`^0.60.0` → `^0.65.0`](https://renovatebot.com/diffs/npm/@effect%2flanguage-service/0.60.0/0.65.0) |  |  |
| [@effect/platform](https://effect.website) ([source](https://github.com/Effect-TS/effect/tree/HEAD/packages/platform)) | [`^0.93.6` → `^0.94.0`](https://renovatebot.com/diffs/npm/@effect%2fplatform/0.93.8/0.94.1) |  |  |
| [@effect/platform-browser](https://effect.website) ([source](https://github.com/Effect-TS/effect/tree/HEAD/packages/platform-browser)) | [`^0.73.0` → `^0.74.0`](https://renovatebot.com/diffs/npm/@effect%2fplatform-browser/0.73.0/0.74.0) |  |  |
---
### Release Notes
<details>
<summary>Effect-TS/language-service (@​effect/language-service)</summary>
### [`v0.65.0`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0650)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.64.1...v0.65.0)
##### Minor Changes
- [#​581](https://github.com/Effect-TS/language-service/pull/581) [`4569328`](https://github.com/Effect-TS/language-service/commit/456932800d7abe81e14d910b25d91399277a23f5) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `effectFnOpportunity` diagnostic that suggests converting functions returning `Effect.gen` to `Effect.fn` for better tracing and concise syntax.
The diagnostic triggers on:
- Arrow functions returning `Effect.gen(...)`
- Function expressions returning `Effect.gen(...)`
- Function declarations returning `Effect.gen(...)`
- Functions with `Effect.gen(...).pipe(...)` patterns
It provides two code fixes:
- Convert to `Effect.fn` (traced) - includes the function name as the span name
- Convert to `Effect.fnUntraced` - without tracing
The diagnostic skips:
- Generator functions (can't be converted)
- Named function expressions (typically used for recursion)
- Functions with multiple call signatures (overloads)
When the original function has a return type annotation, the converted function will use `Effect.fn.Return<A, E, R>` as the return type.
Example:
```ts
// Before
export const myFunction = (a: number) =>
Effect.gen(function* () {
yield* Effect.succeed(1);
return a;
});
// After (with Effect.fn)
export const myFunction = Effect.fn("myFunction")(function* (a: number) {
yield* Effect.succeed(1);
return a;
});
// Before (with pipe)
export const withPipe = () =>
Effect.gen(function* () {
return yield* Effect.succeed(1);
}).pipe(Effect.withSpan("withPipe"));
// After (with Effect.fn)
export const withPipe = Effect.fn("withPipe")(function* () {
return yield* Effect.succeed(1);
}, Effect.withSpan("withPipe"));
```
- [#​575](https://github.com/Effect-TS/language-service/pull/575) [`00aeed0`](https://github.com/Effect-TS/language-service/commit/00aeed0c8aadcd0b0c521e4339aa6a1a18eae772) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `effectMapVoid` diagnostic that suggests using `Effect.asVoid` instead of `Effect.map(() => void 0)`, `Effect.map(() => undefined)`, or `Effect.map(() => {})`.
Also adds two new TypeParser utilities:
- `lazyExpression`: matches zero-argument arrow functions or function expressions that return a single expression
- `emptyFunction`: matches arrow functions or function expressions with an empty block body
And adds `isVoidExpression` utility to TypeScriptUtils for detecting `void 0` or `undefined` expressions.
Example:
```ts
// Before
Effect.succeed(1).pipe(Effect.map(() => void 0));
Effect.succeed(1).pipe(Effect.map(() => undefined));
Effect.succeed(1).pipe(Effect.map(() => {}));
// After (suggested fix)
Effect.succeed(1).pipe(Effect.asVoid);
```
- [#​582](https://github.com/Effect-TS/language-service/pull/582) [`94d4a6b`](https://github.com/Effect-TS/language-service/commit/94d4a6bcaa39d8b33e66390d1ead5b1da1a8f16f) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Added `layerinfo` CLI command that provides detailed information about a specific exported layer.
Features:
- Shows layer type, location, and description
- Lists services the layer provides and requires
- Suggests optimal layer composition order using `Layer.provide`, `Layer.provideMerge`, and `Layer.merge`
Example usage:
```bash
effect-language-service layerinfo --file ./src/layers/app.ts --name AppLive
```
Also added a tip to both `overview` and `layerinfo` commands about using `Layer.mergeAll(...)` to get suggested composition order.
- [#​583](https://github.com/Effect-TS/language-service/pull/583) [`b0aa78f`](https://github.com/Effect-TS/language-service/commit/b0aa78fb75f2afed944fb062e8e74ec6eb1492c1) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `redundantSchemaTagIdentifier` diagnostic that suggests removing redundant identifier arguments when they equal the tag value in `Schema.TaggedClass`, `Schema.TaggedError`, or `Schema.TaggedRequest`.
**Before:**
```typescript
class MyError extends Schema.TaggedError<MyError>("MyError")("MyError", {
message: Schema.String,
}) {}
```
**After applying the fix:**
```typescript
class MyError extends Schema.TaggedError<MyError>()("MyError", {
message: Schema.String,
}) {}
```
Also updates the completions to not include the redundant identifier when autocompleting `Schema.TaggedClass`, `Schema.TaggedError`, and `Schema.TaggedRequest`.
- [#​573](https://github.com/Effect-TS/language-service/pull/573) [`6715f91`](https://github.com/Effect-TS/language-service/commit/6715f9131059737cf4b2d2988d7981971943ac0e) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Rename `reportSuggestionsAsWarningsInTsc` option to `includeSuggestionsInTsc` and change default to `true`.
This option controls whether diagnostics with "suggestion" severity are included in TSC output when using the `effect-language-service patch` feature. When enabled, suggestions are reported as messages in TSC output, which is useful for LLM-based development tools to see all suggestions.
**Breaking change**: The option has been renamed and the default behavior has changed:
- Old: `reportSuggestionsAsWarningsInTsc: false` (suggestions not included by default)
- New: `includeSuggestionsInTsc: true` (suggestions included by default)
To restore the previous behavior, set `"includeSuggestionsInTsc": false` in your tsconfig.json plugin configuration.
- [#​586](https://github.com/Effect-TS/language-service/pull/586) [`e225b5f`](https://github.com/Effect-TS/language-service/commit/e225b5fb242d269b75eb6a04c89ae6372e53c8ec) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add markdown documentation support to setup command
The setup command now automatically manages Effect Language Service documentation in AGENTS.md and CLAUDE.md files:
- When installing: Adds or updates the Effect Language Service section with markers
- When uninstalling: Removes the section if present
- Case-insensitive file detection (supports both lowercase and uppercase filenames)
- Skips symlinked files to avoid modifying linked content
- Shows proper diff view for markdown file changes
Example section added to markdown files:
```markdown
<!-- effect-language-service:start -->
## Effect Language Service
The Effect Language Service comes in with a useful CLI that can help you with commands to get a better understanding your Effect Layers and Services, and to help you compose them correctly.
<!-- effect-language-service:end -->
```
##### Patch Changes
- [#​580](https://github.com/Effect-TS/language-service/pull/580) [`a45606b`](https://github.com/Effect-TS/language-service/commit/a45606b2b0d64bd06436c1e6c3a1c5410dcda6a9) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `Effect.fn` and `Effect.fnUntraced` support to the piping flows parser.
The piping flows parser now recognizes pipe transformations passed as additional arguments to `Effect.fn`, `Effect.fn("traced")`, and `Effect.fnUntraced`. This enables diagnostics like `catchAllToMapError`, `catchUnfailableEffect`, and `multipleEffectProvide` to work with these patterns.
Example:
```ts
// This will now trigger the catchAllToMapError diagnostic
const example = Effect.fn(
function* () {
return yield* Effect.fail("error");
},
Effect.catchAll((cause) => Effect.fail(new MyError(cause)))
);
```
- [#​587](https://github.com/Effect-TS/language-service/pull/587) [`7316859`](https://github.com/Effect-TS/language-service/commit/7316859ba221a212d3e8adcf458032e5c5d1b354) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Mark deprecated TypeScript Signature methods and migrate to property accessors
Added `@deprecated` annotations to TypeScript Signature interface methods (`getParameters`, `getTypeParameters`, `getDeclaration`, `getReturnType`, `getTypeParameterAtPosition`) with guidance to use their modern property alternatives. Updated codebase usage of `getParameters()` to use `.parameters` property instead.
- [#​584](https://github.com/Effect-TS/language-service/pull/584) [`ed12861`](https://github.com/Effect-TS/language-service/commit/ed12861c12a1fa1298fd53c97a5e01a2d02b96ac) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix TypeError in setup command when updating existing diagnosticSeverity configuration
The setup command was throwing `TypeError: Cannot read properties of undefined (reading 'text')` when trying to update the `diagnosticSeverity` option of an existing `@effect/language-service` plugin configuration in tsconfig.json.
This occurred because TypeScript's ChangeTracker formatter needed to compute indentation by traversing the AST tree, which failed when replacing a PropertyAssignment node inside a nested list context.
The fix replaces just the initializer value (ObjectLiteralExpression) instead of the entire PropertyAssignment, avoiding the problematic list indentation calculation.
- [#​585](https://github.com/Effect-TS/language-service/pull/585) [`7ebe5db`](https://github.com/Effect-TS/language-service/commit/7ebe5db2d60f36510e666e7c816623c0f9be88ab) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Enhanced `layerinfo` CLI command with output type selection for layer composition.
**New Features:**
- Added `--outputs` option to select which output types to include in the suggested composition (e.g., `--outputs 1,2,3`)
- Shows all available output types from the layer graph with indexed checkboxes
- By default, only types that are in the layer's declared `ROut` are selected
- Composition code now includes `export const <name> = ...` prefix for easy copy-paste
**Example output:**
```
Suggested Composition:
Not sure you got your composition right? Just write all layers inside a Layer.mergeAll(...)
then run this command again and use --outputs to select which outputs to include in composition.
Example: --outputs 1,2,3
[ ] 1. Cache
[x] 2. UserRepository
export const simplePipeIn = UserRepository.Default.pipe(
Layer.provide(Cache.Default)
)
```
This allows users to see all available outputs from a layer composition and choose which ones to include in the suggested composition order.
- [#​577](https://github.com/Effect-TS/language-service/pull/577) [`0ed50c3`](https://github.com/Effect-TS/language-service/commit/0ed50c33c08ae6ae81fbd4af49ac4d75fd2b7f74) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Refactor `catchAllToMapError` diagnostic to use the piping flows parser for detecting Effect.catchAll calls.
This change also:
- Makes `outType` optional in `ParsedPipingFlowSubject` to handle cases where type information is unavailable
- Sorts piping flows by position for consistent ordering
- [#​578](https://github.com/Effect-TS/language-service/pull/578) [`cab6ce8`](https://github.com/Effect-TS/language-service/commit/cab6ce85ff2720c0d09cdb0b708d77d1917a50c5) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - refactor: use piping flows parser in catchUnfailableEffect diagnostic
- [#​579](https://github.com/Effect-TS/language-service/pull/579) [`2a82522`](https://github.com/Effect-TS/language-service/commit/2a82522cdbcb59465ccb93dcb797f55d9408752c) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - refactor: use piping flows parser in multipleEffectProvide diagnostic
- [#​570](https://github.com/Effect-TS/language-service/pull/570) [`0db6e28`](https://github.com/Effect-TS/language-service/commit/0db6e28df1caba1bb5bc42faf82f8ffab276a184) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Refactor CLI overview command to extract symbol collection logic into reusable utility
- Extract `collectSourceFileExportedSymbols` into `src/cli/utils/ExportedSymbols.ts` for reuse across CLI commands
- Add `--max-symbol-depth` option to overview command (default: 3) to control how deep to traverse nested symbol properties
- Add tests for the overview command with snapshot testing
- [#​574](https://github.com/Effect-TS/language-service/pull/574) [`9d0695e`](https://github.com/Effect-TS/language-service/commit/9d0695e3c82333400575a9d266cad4ac6af45ccc) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Remove deprecated ts-patch documentation from README. The Effect LSP CLI Patch is now the only recommended approach for getting diagnostics at compile time.
- [#​576](https://github.com/Effect-TS/language-service/pull/576) [`5017d75`](https://github.com/Effect-TS/language-service/commit/5017d75f1db93f6e5d8c1fc0d8ea26c2b2db613a) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add piping flows parser for caching piping flow analysis per source file.
This internal improvement introduces a `pipingFlows` function in `TypeParser` that analyzes and caches all piping flows (both `pipe()` calls and `.pipe()` method chains) in a source file. The parser:
- Identifies piping flows including nested pipes and mixed call styles (e.g., `Effect.map(effect, fn).pipe(...)`)
- Tracks the subject, transformations, and intermediate types for each flow
- Enables more efficient diagnostic implementations by reusing cached analysis
The `missedPipeableOpportunity` diagnostic has been refactored to use this new parser, improving performance when analyzing files with multiple piping patterns.
### [`v0.64.1`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0641)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.64.0...v0.64.1)
##### Patch Changes
- [#​568](https://github.com/Effect-TS/language-service/pull/568) [`477271d`](https://github.com/Effect-TS/language-service/commit/477271d4df19391dca4131a13c8962b134156272) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix auto-import with namespace import packages generating malformed code when the identifier is at the beginning of the file.
When using `namespaceImportPackages` configuration and auto-completing an export like `isAnyKeyword` from `effect/SchemaAST`, the code was incorrectly generated as:
```ts
SchemaAST.import * as SchemaAST from "effect/SchemaAST";
```
Instead of the expected:
```ts
import * as SchemaAST from "effect/SchemaAST";
SchemaAST.isAnyKeyword;
```
The fix ensures the import statement is added before the namespace prefix when both changes target position 0.
### [`v0.64.0`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0640)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.63.2...v0.64.0)
##### Minor Changes
- [#​567](https://github.com/Effect-TS/language-service/pull/567) [`dcb3fe5`](https://github.com/Effect-TS/language-service/commit/dcb3fe5f36f5c2727870e1fbc148e2a935a1a77e) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Added new diagnostic `catchAllToMapError` that suggests using `Effect.mapError` instead of `Effect.catchAll` + `Effect.fail` when the callback only wraps the error.
Before:
```ts
Effect.catchAll((cause) => Effect.fail(new MyError(cause)));
```
After:
```ts
Effect.mapError((cause) => new MyError(cause));
```
The diagnostic includes a quick fix that automatically transforms the code.
- [#​555](https://github.com/Effect-TS/language-service/pull/555) [`0424000`](https://github.com/Effect-TS/language-service/commit/04240003bbcb04db1eda967153d185fd53a3f669) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `globalErrorInEffectCatch` diagnostic to detect global Error types in catch callbacks
This new diagnostic warns when catch callbacks in `Effect.tryPromise`, `Effect.try`, `Effect.tryMap`, or `Effect.tryMapPromise` return the global `Error` type instead of typed errors.
Using the global `Error` type in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error cases. Instead, it's better to use tagged errors (like `Data.TaggedError`) or custom errors with discriminator properties to enable proper type checking and error handling.
Example of code that triggers the diagnostic:
```typescript
Effect.tryPromise({
try: () => fetch("http://example.com"),
catch: () => new Error("Request failed"), // ⚠️ Warning: returns global Error type
});
```
Recommended approach:
```typescript
class FetchError extends Data.TaggedError("FetchError")<{
cause: unknown;
}> {}
Effect.tryPromise({
try: () => fetch("http://example.com"),
catch: (e) => new FetchError({ cause: e }), // ✅ Uses typed error
});
```
This diagnostic also improves the clarity message for the `leakingRequirements` diagnostic by adding additional guidance on how services should be collected in the layer creation body.
- [#​558](https://github.com/Effect-TS/language-service/pull/558) [`cc5feb1`](https://github.com/Effect-TS/language-service/commit/cc5feb146de351a5466e8f8476e5b9d9020c797e) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `layerMergeAllWithDependencies` diagnostic to detect interdependencies in `Layer.mergeAll` calls
This new diagnostic warns when `Layer.mergeAll` is called with layers that have interdependencies, where one layer provides a service that another layer in the same call requires.
`Layer.mergeAll` creates layers in parallel, so dependencies between layers will not be satisfied. This can lead to runtime errors when trying to use the merged layer.
Example of code that triggers the diagnostic:
```typescript
export class DbConnection extends Effect.Service<DbConnection>()(
"DbConnection",
{
succeed: {},
}
) {}
export class FileSystem extends Effect.Service<FileSystem>()("FileSystem", {
succeed: {},
}) {}
export class Cache extends Effect.Service<Cache>()("Cache", {
effect: Effect.as(FileSystem, {}), // Cache requires FileSystem
}) {}
// ⚠️ Warning on FileSystem.Default
const layers = Layer.mergeAll(
DbConnection.Default,
FileSystem.Default, // This provides FileSystem
Cache.Default // This requires FileSystem
);
```
Recommended approach:
```typescript
// Provide FileSystem separately before merging
const layers = Layer.mergeAll(DbConnection.Default, Cache.Default).pipe(
Layer.provideMerge(FileSystem.Default)
);
```
The diagnostic correctly handles pass-through layers (layers that both provide and require the same type) and only reports on layers that actually provide dependencies needed by other layers in the same `mergeAll` call.
- [#​557](https://github.com/Effect-TS/language-service/pull/557) [`83ce411`](https://github.com/Effect-TS/language-service/commit/83ce411288977606f8390641dc7127e36c6f3c5b) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `missingLayerContext` diagnostic to detect missing service requirements in Layer definitions
This new diagnostic provides better error readability when you're missing service requirements in your Layer type definitions. It works similarly to the existing `missingEffectContext` diagnostic but specifically checks the `RIn` (requirements input) parameter of Layer types.
Example of code that triggers the diagnostic:
```typescript
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
class ServiceA extends Effect.Service<ServiceA>()("ServiceA", {
succeed: { a: 1 },
}) {}
class ServiceB extends Effect.Service<ServiceB>()("ServiceB", {
succeed: { a: 2 },
}) {}
declare const layerWithServices: Layer.Layer<ServiceA, never, ServiceB>;
function testFn(layer: Layer.Layer<ServiceA>) {
return layer;
}
// ⚠️ Error: Missing 'ServiceB' in the expected Layer context.
testFn(layerWithServices);
```
The diagnostic helps catch type mismatches early by clearly indicating which service requirements are missing when passing layers between functions or composing layers together.
- [#​562](https://github.com/Effect-TS/language-service/pull/562) [`57d5af2`](https://github.com/Effect-TS/language-service/commit/57d5af251d3e477a8cf4c41dfae4593cede4c960) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `overview` CLI command that provides an overview of Effect-related exports in a project.
The command analyzes TypeScript files and reports all exported yieldable errors, services (Context.Tag, Effect.Tag, Effect.Service), and layers with their types, file locations, and JSDoc descriptions. A progress spinner shows real-time file processing status.
Usage:
```bash
effect-language-service overview --file path/to/file.ts
effect-language-service overview --project tsconfig.json
```
Example output:
```
✔ Processed 3 file(s)
Overview for 3 file(s).
Yieldable Errors (1)
NotFoundError
./src/errors.ts:5:1
NotFoundError
Services (2)
DbConnection
./src/services/db.ts:6:1
Manages database connections
Layers (1)
AppLive
./src/layers/app.ts:39:14
Layer<Cache | UserRepository, never, never>
```
##### Patch Changes
- [#​561](https://github.com/Effect-TS/language-service/pull/561) [`c3b3bd3`](https://github.com/Effect-TS/language-service/commit/c3b3bd364ff3c0567995b3c12e579459b69448e7) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add descriptions to CLI commands using `Command.withDescription` for improved help output when using `--help` flag.
- [#​565](https://github.com/Effect-TS/language-service/pull/565) [`2274aef`](https://github.com/Effect-TS/language-service/commit/2274aef53902f2c31443b7e504d2add0bf24d6e4) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix `unnecessaryPipe` diagnostic and refactor not working with namespace imports from `effect/Function` (e.g., `Function.pipe()` or `Fn.pipe()`)
- [#​560](https://github.com/Effect-TS/language-service/pull/560) [`75a480e`](https://github.com/Effect-TS/language-service/commit/75a480ebce3c5dfe29f22ee9d556ba1a043ba91b) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Improve diagnostic message for `unsupportedServiceAccessors` when used with `Effect.Tag`
When the `unsupportedServiceAccessors` diagnostic is triggered on an `Effect.Tag` class (which doesn't allow disabling accessors), the message now includes a helpful suggestion to use `Context.Tag` instead:
```typescript
export class MyService extends Effect.Tag("MyService")<
MyService,
{
method: <A>(value: A) => Effect.Effect<A>;
}
>() {}
// Diagnostic: Even if accessors are enabled, accessors for 'method' won't be available
// because the signature have generic type parameters or multiple call signatures.
// Effect.Tag does not allow to disable accessors, so you may want to use Context.Tag instead.
```
- [#​559](https://github.com/Effect-TS/language-service/pull/559) [`4c1f809`](https://github.com/Effect-TS/language-service/commit/4c1f809d2f88102652ceea67b93df8909b408d14) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Improve Layer Magic refactor ordering by considering both provided and required service counts
The Layer Magic refactor now uses a combined ordering heuristic that considers both:
1. The number of services a layer provides
2. The number of services a layer requires
This results in more optimal layer composition order, especially in complex dependency graphs where layers have varying numbers of dependencies.
- [#​566](https://github.com/Effect-TS/language-service/pull/566) [`036c491`](https://github.com/Effect-TS/language-service/commit/036c49142581a1ea428205e3d3d1647963c556f9) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Simplify diagnostic messages for global Error type usage
The diagnostic messages for `globalErrorInEffectCatch` and `globalErrorInEffectFailure` now use the more generic term "tagged errors" instead of "tagged errors (Data.TaggedError)" to provide cleaner, more concise guidance.
### [`v0.63.2`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0632)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.63.1...v0.63.2)
##### Patch Changes
- [#​553](https://github.com/Effect-TS/language-service/pull/553) [`e64e3df`](https://github.com/Effect-TS/language-service/commit/e64e3dfe235398af388e7d3ffdd36dbd02422730) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - fix: ensure correct path resolution in CLI setup
- Use `process.cwd()` explicitly in `path.resolve()` for consistent behavior
- Resolve the selected tsconfig path to an absolute path before validation
- Simplify error handling by using direct `yield*` for `TsConfigNotFoundError`
### [`v0.63.1`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0631)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.63.0...v0.63.1)
##### Patch Changes
- [#​551](https://github.com/Effect-TS/language-service/pull/551) [`9b3d807`](https://github.com/Effect-TS/language-service/commit/9b3d8071ec3af88ce219cc5a6a96e792bbdca2a2) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - fix: resolve TypeScript from project's working directory
The CLI now attempts to resolve TypeScript from the current working directory first before falling back to the package's bundled version. This ensures the CLI uses the same TypeScript version as the project being analyzed.
### [`v0.63.0`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0630)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.62.5...v0.63.0)
##### Minor Changes
- [#​548](https://github.com/Effect-TS/language-service/pull/548) [`ef8c2de`](https://github.com/Effect-TS/language-service/commit/ef8c2de288a8450344157f726986a4f35736dd78) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `globalErrorInEffectFailure` diagnostic
This diagnostic warns when `Effect.fail` is called with the global `Error` type. Using the global `Error` type in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error types.
Instead, the diagnostic recommends using:
- Tagged errors with `Data.TaggedError`
- Custom error classes with a discriminator property (like `_tag`)
Example:
```ts
// This will trigger a warning
Effect.fail(new Error("global error"));
// These are recommended alternatives
Effect.fail(new CustomError()); // where CustomError extends Data.TaggedError
Effect.fail(new MyError()); // where MyError has a _tag property
```
- [#​545](https://github.com/Effect-TS/language-service/pull/545) [`c590b5a`](https://github.com/Effect-TS/language-service/commit/c590b5af59cc5b656c02ea6e03ba63d110ea65d3) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `effect-language-service setup` CLI command
This new command provides an interactive wizard to guide users through the complete installation and configuration of the Effect Language Service. The setup command:
- Analyzes your repository structure (package.json, tsconfig files)
- Guides you through adding the package to devDependencies
- Configures the TypeScript plugin in your tsconfig.json
- Allows customizing diagnostic severity levels
- Optionally adds prepare script for automatic patching
- Optionally configures VS Code settings for workspace TypeScript usage
- Shows a review of all changes before applying them
Example usage:
```bash
effect-language-service setup
```
The wizard will walk you through each step and show you exactly what changes will be made before applying them.
- [#​550](https://github.com/Effect-TS/language-service/pull/550) [`4912ee4`](https://github.com/Effect-TS/language-service/commit/4912ee41531dc91ad0ba2828ea555cb79f2c6d9e) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add support for `@effect/sql`'s `Model.Class` in completions and diagnostics
- Added `effectSqlModelSelfInClasses` completion: Auto-completes the `Self` type parameter when extending `Model.Class` from `@effect/sql`
- Extended `classSelfMismatch` diagnostic: Now detects when the `Self` type parameter in `Model.Class<Self>` doesn't match the actual class name
Example:
```ts
import { Model } from "@​effect/sql";
import * as Schema from "effect/Schema";
// Completion triggers after "Model." to generate the full class boilerplate
export class User extends Model.Class<User>("User")({
id: Schema.String,
}) {}
// Diagnostic warns when Self type parameter doesn't match class name
export class User extends Model.Class<WrongName>("User")({
// ^^^^^^^^^ Self type should be "User"
id: Schema.String,
}) {}
```
##### Patch Changes
- [#​547](https://github.com/Effect-TS/language-service/pull/547) [`9058a37`](https://github.com/Effect-TS/language-service/commit/9058a373ba1567a9336d0c3b36de981337757219) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - refactor: simplify `unnecessaryFailYieldableError` diagnostic implementation
Changed the implementation to check if a type extends `Cause.YieldableError` on-demand rather than fetching all yieldable error types upfront.
- [#​549](https://github.com/Effect-TS/language-service/pull/549) [`039f4b2`](https://github.com/Effect-TS/language-service/commit/039f4b21da6e1d6ae695ba26cce0516d09f86643) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `getTypeAtLocation` utility to `TypeCheckerUtils`
This refactoring adds a new `getTypeAtLocation` function to `TypeCheckerUtils` that safely retrieves types while filtering out JSX-specific nodes (JSX elements, opening/closing tags, and JSX attributes) that could cause issues when calling `typeChecker.getTypeAtLocation`.
The utility is now used across multiple diagnostics and features, reducing code duplication and ensuring consistent handling of edge cases:
- `anyUnknownInErrorContext`
- `catchUnfailableEffect`
- `floatingEffect`
- `globalErrorInEffectFailure`
- `leakingRequirements`
- `missedPipeableOpportunity`
- `missingEffectServiceDependency`
- `missingReturnYieldStar`
- `multipleEffectProvide`
- `nonObjectEffectServiceType`
- `overriddenSchemaConstructor`
- `returnEffectInGen`
- `scopeInLayerEffect`
- `strictBooleanExpressions`
- `strictEffectProvide`
- `unnecessaryFailYieldableError`
- And other features like quick info, goto definition, and refactors
### [`v0.62.5`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0625)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.62.4...v0.62.5)
##### Patch Changes
- [#​543](https://github.com/Effect-TS/language-service/pull/543) [`0b13f3c`](https://github.com/Effect-TS/language-service/commit/0b13f3c862b69a84e2b3368ab301a35af8a8bf63) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix unwanted autocompletions inside import declarations
Previously, Effect.**, Option.**, and Either.\_\_ completions were incorrectly suggested inside import statements. This has been fixed by detecting when the completion is requested inside an import declaration and preventing these completions from appearing.
Closes [#​541](https://github.com/Effect-TS/language-service/issues/541)
### [`v0.62.4`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0624)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.62.3...v0.62.4)
##### Patch Changes
- [#​539](https://github.com/Effect-TS/language-service/pull/539) [`4cc88d2`](https://github.com/Effect-TS/language-service/commit/4cc88d2c72535ef7608c4c0b0ecdd8b676699874) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Improve layerMagic refactor to prioritize layers with more provided services
The layerMagic refactor now uses a heuristic that prioritizes nodes with more provided services when generating layer composition code. This ensures that telemetry and tracing layers (which typically provide fewer services) are positioned as late as possible in the dependency graph, resulting in more intuitive and correct layer ordering.
Example: When composing layers for services that depend on HttpClient with telemetry, the refactor now correctly places the telemetry layer (which provides fewer services) later in the composition chain.
### [`v0.62.3`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0623)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.62.2...v0.62.3)
##### Patch Changes
- [#​537](https://github.com/Effect-TS/language-service/pull/537) [`e31c03b`](https://github.com/Effect-TS/language-service/commit/e31c03b086eebb2bb55f23cfb9eb4c26344785d7) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix counter increment timing in structural type to schema refactor to ensure proper naming of conflicting schemas (e.g., `User_1` instead of `User_0` for the first conflict)
### [`v0.62.2`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0622)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.62.1...v0.62.2)
##### Patch Changes
- [#​535](https://github.com/Effect-TS/language-service/pull/535) [`361fc1e`](https://github.com/Effect-TS/language-service/commit/361fc1ee5b6cf7684e0cf1ff8806ef267936b9cd) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix duplicate schema names in "Refactor to Schema (Recursive Structural)" code generation.
When the refactor encountered types with conflicting names, it was generating a unique suffix but not properly tracking the usage count, causing duplicate schema identifiers with different contents to be generated.
This fix ensures that when a name conflict is detected and a unique suffix is added (e.g., `Tax`, `Tax_1`, `Tax_2`), the usage counter is properly incremented to prevent duplicate identifiers in the generated code.
Fixes [#​534](https://github.com/Effect-TS/language-service/issues/534)
### [`v0.62.1`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0621)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.62.0...v0.62.1)
##### Patch Changes
- [#​532](https://github.com/Effect-TS/language-service/pull/532) [`8f189aa`](https://github.com/Effect-TS/language-service/commit/8f189aa7d21b8a638e3bc9cf4fc834c684f1b70f) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix handling of read-only arrays in "Refactor to Schema (Recursive Structural)" code generation.
The refactor now correctly distinguishes between mutable arrays (`Array<T>`) and read-only arrays (`ReadonlyArray<T>` or `readonly T[]`):
- `Array<T>` is now converted to `Schema.mutable(Schema.Array(...))` to preserve mutability
- `ReadonlyArray<T>` and `readonly T[]` are converted to `Schema.Array(...)` (read-only by default)
This fixes compatibility issues with external libraries (like Stripe, BetterAuth) that expect mutable arrays in their API parameters.
Fixes [#​531](https://github.com/Effect-TS/language-service/issues/531)
### [`v0.62.0`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0620)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.61.0...v0.62.0)
##### Minor Changes
- [#​528](https://github.com/Effect-TS/language-service/pull/528) [`7dc14cf`](https://github.com/Effect-TS/language-service/commit/7dc14cfaebe737f4c13ebd55f30e39207a5029bb) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add typeToSchema codegen
This adds a new `// @​effect-codegens typeToSchema` codegen that automatically generates Effect Schema classes from TypeScript types. Given a type alias with object members representing schemas to generate (e.g., `type ToGenerate = { UserSchema: User, TodoSchema: Todo }`), the codegen will create the corresponding Schema class definitions.
The generated schemas:
- Automatically detect and reuse existing schema definitions in the file
- Support both type aliases and interfaces
- Include outdated detection to warn when the source type changes
- Work with the `outdatedEffectCodegen` diagnostic to provide automatic fix actions
Example usage:
```typescript
type User = {
id: number;
name: string;
};
// @​effect-codegens typeToSchema
export type ToGenerate = {
UserSchema: User;
};
// Generated by the codegen:
export class UserSchema extends Schema.Class<UserSchema>("UserSchema")({
id: Schema.Number,
name: Schema.String,
}) {}
```
##### Patch Changes
- [#​530](https://github.com/Effect-TS/language-service/pull/530) [`5ecdc62`](https://github.com/Effect-TS/language-service/commit/5ecdc626dd6dcaad3e866b7e89decb10b99fca2d) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix `Refactor to Schema (Recursive Structural)` to support `exactOptionalPropertyTypes`
When `exactOptionalPropertyTypes` is enabled in tsconfig, optional properties with types like `string | undefined` are not assignable to types defined as `prop?: string`. This fix generates `Schema.optionalWith(Schema.String, { exact: true })` instead of `Schema.optional(Schema.Union(Schema.Undefined, Schema.String))` to maintain type compatibility with external libraries that don't always include `undefined` in their optional property types.
Example:
```typescript
// With exactOptionalPropertyTypes enabled
type User = {
name?: string; // External library type (e.g., Stripe API)
};
// Generated schema now uses:
Schema.optionalWith(Schema.String, { exact: true });
// Instead of:
Schema.optional(Schema.Union(Schema.Undefined, Schema.String));
```
This ensures the generated schema maintains proper type compatibility with external libraries when using strict TypeScript configurations.
### [`v0.61.0`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0610)
[Compare Source](https://github.com/Effect-TS/language-service/compare/v0.60.0...v0.61.0)
##### Minor Changes
- [#​525](https://github.com/Effect-TS/language-service/pull/525) [`e2dbbad`](https://github.com/Effect-TS/language-service/commit/e2dbbad00b06fb576767a5330e1cca048480264a) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add Structural Type to Schema refactor
Adds a new "Structural Type to Schema" refactor that converts TypeScript interfaces and type aliases to Effect Schema classes. This refactor analyzes the structure of types and generates appropriate Schema definitions, with intelligent detection and reuse of existing schemas.
Example:
```typescript
// Before
export interface User {
id: number;
name: string;
}
// After (using the refactor)
export class User extends Schema.Class<User>("User")({
id: Schema.Number,
name: Schema.String,
}) {}
```
The refactor supports:
- All primitive types and common TypeScript constructs
- Automatic reuse of existing Schema definitions for referenced types
- Optional properties, unions, intersections, and nested structures
- Both interface and type alias declarations
</details>
<details>
<summary>Effect-TS/effect (@​effect/platform)</summary>
### [`v0.94.1`](https://github.com/Effect-TS/effect/blob/HEAD/packages/platform/CHANGELOG.md#0941)
[Compare Source](https://github.com/Effect-TS/effect/compare/@effect/platform@0.94.0...@effect/platform@0.94.1)
##### Patch Changes
- [#​5936](https://github.com/Effect-TS/effect/pull/5936) [`65e9e35`](https://github.com/Effect-TS/effect/commit/65e9e35157cbdfb40826ddad34555c4ebcf7c0b0) Thanks [@​schickling](https://github.com/schickling)! - Document subtle CORS middleware `allowedHeaders` behavior: when empty array (default), it reflects back the client's `Access-Control-Request-Headers` (permissive), and when non-empty array, it only allows specified headers (restrictive). Added comprehensive JSDoc with examples.
- [#​5940](https://github.com/Effect-TS/effect/pull/5940) [`ee69cd7`](https://github.com/Effect-TS/effect/commit/ee69cd796feb3d8d1046f52edd8950404cd4ed0e) Thanks [@​kitlangton](https://github.com/kitlangton)! - HttpServerResponse: fix `fromWeb` to preserve Content-Type header when response has a body
Previously, when converting a web `Response` to an `HttpServerResponse` via `fromWeb`, the `Content-Type` header was not passed to `Body.stream()`, causing it to default to `application/octet-stream`. This affected any code using `HttpApp.fromWebHandler` to wrap web handlers, as JSON responses would incorrectly have their Content-Type set to `application/octet-stream` instead of `application/json`.
- Updated dependencies \[[`488d6e8`](https://github.com/Effect-TS/effect/commit/488d6e870eda3dfc137f4940bb69416f61ed8fe3)]:
- effect\@​3.19.14
### [`v0.94.0`](https://github.com/Effect-TS/effect/blob/HEAD/packages/platform/CHANGELOG.md#0940)
[Compare Source](https://github.com/Effect-TS/effect/compare/@effect/platform@0.93.8...@effect/platform@0.94.0)
##### Minor Changes
- [#​5917](https://github.com/Effect-TS/effect/pull/5917) [`ff7053f`](https://github.com/Effect-TS/effect/commit/ff7053f6d8508567b6145239f97aacc5773b0c53) Thanks [@​tim-smart](https://github.com/tim-smart)! - support non-errors in HttpClient.retryTransient
##### Patch Changes
- Updated dependencies \[[`77eeb86`](https://github.com/Effect-TS/effect/commit/77eeb86ddf208e51ec25932af83d52d3b4700371), [`287c32c`](https://github.com/Effect-TS/effect/commit/287c32c9f10da8e96f2b9ef8424316189d9ad4b3)]:
- effect\@​3.19.13
</details>
<details>
<summary>Effect-TS/effect (@​effect/platform-browser)</summary>
### [`v0.74.0`](https://github.com/Effect-TS/effect/blob/HEAD/packages/platform-browser/CHANGELOG.md#0740)
[Compare Source](https://github.com/Effect-TS/effect/compare/@effect/platform-browser@0.73.0...@effect/platform-browser@0.74.0)
##### Patch Changes
- Updated dependencies \[[`77eeb86`](https://github.com/Effect-TS/effect/commit/77eeb86ddf208e51ec25932af83d52d3b4700371), [`ff7053f`](https://github.com/Effect-TS/effect/commit/ff7053f6d8508567b6145239f97aacc5773b0c53), [`287c32c`](https://github.com/Effect-TS/effect/commit/287c32c9f10da8e96f2b9ef8424316189d9ad4b3)]:
- effect\@​3.19.13
- [@​effect/platform](https://github.com/effect/platform)@​0.94.0
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi40Mi4zIiwidXBkYXRlZEluVmVyIjoiNDIuODAuMiIsInRhcmdldEJyYW5jaCI6Im5leHQiLCJsYWJlbHMiOltdfQ==-->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR contains the following updates:
^0.60.0→^0.65.0^0.93.6→^0.94.0^0.73.0→^0.74.0Release Notes
Effect-TS/language-service (@effect/language-service)
v0.65.0Compare Source
Minor Changes
#581
4569328Thanks @mattiamanzati! - AddeffectFnOpportunitydiagnostic that suggests converting functions returningEffect.gentoEffect.fnfor better tracing and concise syntax.The diagnostic triggers on:
Effect.gen(...)Effect.gen(...)Effect.gen(...)Effect.gen(...).pipe(...)patternsIt provides two code fixes:
Effect.fn(traced) - includes the function name as the span nameEffect.fnUntraced- without tracingThe diagnostic skips:
When the original function has a return type annotation, the converted function will use
Effect.fn.Return<A, E, R>as the return type.Example:
#575
00aeed0Thanks @mattiamanzati! - AddeffectMapVoiddiagnostic that suggests usingEffect.asVoidinstead ofEffect.map(() => void 0),Effect.map(() => undefined), orEffect.map(() => {}).Also adds two new TypeParser utilities:
lazyExpression: matches zero-argument arrow functions or function expressions that return a single expressionemptyFunction: matches arrow functions or function expressions with an empty block bodyAnd adds
isVoidExpressionutility to TypeScriptUtils for detectingvoid 0orundefinedexpressions.Example:
#582
94d4a6bThanks @mattiamanzati! - AddedlayerinfoCLI command that provides detailed information about a specific exported layer.Features:
Layer.provide,Layer.provideMerge, andLayer.mergeExample usage:
Also added a tip to both
overviewandlayerinfocommands about usingLayer.mergeAll(...)to get suggested composition order.#583
b0aa78fThanks @mattiamanzati! - AddredundantSchemaTagIdentifierdiagnostic that suggests removing redundant identifier arguments when they equal the tag value inSchema.TaggedClass,Schema.TaggedError, orSchema.TaggedRequest.Before:
After applying the fix:
Also updates the completions to not include the redundant identifier when autocompleting
Schema.TaggedClass,Schema.TaggedError, andSchema.TaggedRequest.#573
6715f91Thanks @mattiamanzati! - RenamereportSuggestionsAsWarningsInTscoption toincludeSuggestionsInTscand change default totrue.This option controls whether diagnostics with "suggestion" severity are included in TSC output when using the
effect-language-service patchfeature. When enabled, suggestions are reported as messages in TSC output, which is useful for LLM-based development tools to see all suggestions.Breaking change: The option has been renamed and the default behavior has changed:
reportSuggestionsAsWarningsInTsc: false(suggestions not included by default)includeSuggestionsInTsc: true(suggestions included by default)To restore the previous behavior, set
"includeSuggestionsInTsc": falsein your tsconfig.json plugin configuration.#586
e225b5fThanks @mattiamanzati! - Add markdown documentation support to setup commandThe setup command now automatically manages Effect Language Service documentation in AGENTS.md and CLAUDE.md files:
Example section added to markdown files:
Patch Changes
#580
a45606bThanks @mattiamanzati! - AddEffect.fnandEffect.fnUntracedsupport to the piping flows parser.The piping flows parser now recognizes pipe transformations passed as additional arguments to
Effect.fn,Effect.fn("traced"), andEffect.fnUntraced. This enables diagnostics likecatchAllToMapError,catchUnfailableEffect, andmultipleEffectProvideto work with these patterns.Example:
#587
7316859Thanks @mattiamanzati! - Mark deprecated TypeScript Signature methods and migrate to property accessorsAdded
@deprecatedannotations to TypeScript Signature interface methods (getParameters,getTypeParameters,getDeclaration,getReturnType,getTypeParameterAtPosition) with guidance to use their modern property alternatives. Updated codebase usage ofgetParameters()to use.parametersproperty instead.#584
ed12861Thanks @mattiamanzati! - Fix TypeError in setup command when updating existing diagnosticSeverity configurationThe setup command was throwing
TypeError: Cannot read properties of undefined (reading 'text')when trying to update thediagnosticSeverityoption of an existing@effect/language-serviceplugin configuration in tsconfig.json.This occurred because TypeScript's ChangeTracker formatter needed to compute indentation by traversing the AST tree, which failed when replacing a PropertyAssignment node inside a nested list context.
The fix replaces just the initializer value (ObjectLiteralExpression) instead of the entire PropertyAssignment, avoiding the problematic list indentation calculation.
#585
7ebe5dbThanks @mattiamanzati! - EnhancedlayerinfoCLI command with output type selection for layer composition.New Features:
--outputsoption to select which output types to include in the suggested composition (e.g.,--outputs 1,2,3)ROutare selectedexport const <name> = ...prefix for easy copy-pasteExample output:
This allows users to see all available outputs from a layer composition and choose which ones to include in the suggested composition order.
#577
0ed50c3Thanks @mattiamanzati! - RefactorcatchAllToMapErrordiagnostic to use the piping flows parser for detecting Effect.catchAll calls.This change also:
outTypeoptional inParsedPipingFlowSubjectto handle cases where type information is unavailable#578
cab6ce8Thanks @mattiamanzati! - refactor: use piping flows parser in catchUnfailableEffect diagnostic#579
2a82522Thanks @mattiamanzati! - refactor: use piping flows parser in multipleEffectProvide diagnostic#570
0db6e28Thanks @mattiamanzati! - Refactor CLI overview command to extract symbol collection logic into reusable utilitycollectSourceFileExportedSymbolsintosrc/cli/utils/ExportedSymbols.tsfor reuse across CLI commands--max-symbol-depthoption to overview command (default: 3) to control how deep to traverse nested symbol properties#574
9d0695eThanks @mattiamanzati! - Remove deprecated ts-patch documentation from README. The Effect LSP CLI Patch is now the only recommended approach for getting diagnostics at compile time.#576
5017d75Thanks @mattiamanzati! - Add piping flows parser for caching piping flow analysis per source file.This internal improvement introduces a
pipingFlowsfunction inTypeParserthat analyzes and caches all piping flows (bothpipe()calls and.pipe()method chains) in a source file. The parser:Effect.map(effect, fn).pipe(...))The
missedPipeableOpportunitydiagnostic has been refactored to use this new parser, improving performance when analyzing files with multiple piping patterns.v0.64.1Compare Source
Patch Changes
#568
477271dThanks @mattiamanzati! - Fix auto-import with namespace import packages generating malformed code when the identifier is at the beginning of the file.When using
namespaceImportPackagesconfiguration and auto-completing an export likeisAnyKeywordfromeffect/SchemaAST, the code was incorrectly generated as:Instead of the expected:
The fix ensures the import statement is added before the namespace prefix when both changes target position 0.
v0.64.0Compare Source
Minor Changes
#567
dcb3fe5Thanks @mattiamanzati! - Added new diagnosticcatchAllToMapErrorthat suggests usingEffect.mapErrorinstead ofEffect.catchAll+Effect.failwhen the callback only wraps the error.Before:
After:
The diagnostic includes a quick fix that automatically transforms the code.
#555
0424000Thanks @mattiamanzati! - AddglobalErrorInEffectCatchdiagnostic to detect global Error types in catch callbacksThis new diagnostic warns when catch callbacks in
Effect.tryPromise,Effect.try,Effect.tryMap, orEffect.tryMapPromisereturn the globalErrortype instead of typed errors.Using the global
Errortype in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error cases. Instead, it's better to use tagged errors (likeData.TaggedError) or custom errors with discriminator properties to enable proper type checking and error handling.Example of code that triggers the diagnostic:
Recommended approach:
This diagnostic also improves the clarity message for the
leakingRequirementsdiagnostic by adding additional guidance on how services should be collected in the layer creation body.#558
cc5feb1Thanks @mattiamanzati! - AddlayerMergeAllWithDependenciesdiagnostic to detect interdependencies inLayer.mergeAllcallsThis new diagnostic warns when
Layer.mergeAllis called with layers that have interdependencies, where one layer provides a service that another layer in the same call requires.Layer.mergeAllcreates layers in parallel, so dependencies between layers will not be satisfied. This can lead to runtime errors when trying to use the merged layer.Example of code that triggers the diagnostic:
Recommended approach:
The diagnostic correctly handles pass-through layers (layers that both provide and require the same type) and only reports on layers that actually provide dependencies needed by other layers in the same
mergeAllcall.#557
83ce411Thanks @mattiamanzati! - AddmissingLayerContextdiagnostic to detect missing service requirements in Layer definitionsThis new diagnostic provides better error readability when you're missing service requirements in your Layer type definitions. It works similarly to the existing
missingEffectContextdiagnostic but specifically checks theRIn(requirements input) parameter of Layer types.Example of code that triggers the diagnostic:
The diagnostic helps catch type mismatches early by clearly indicating which service requirements are missing when passing layers between functions or composing layers together.
#562
57d5af2Thanks @mattiamanzati! - AddoverviewCLI command that provides an overview of Effect-related exports in a project.The command analyzes TypeScript files and reports all exported yieldable errors, services (Context.Tag, Effect.Tag, Effect.Service), and layers with their types, file locations, and JSDoc descriptions. A progress spinner shows real-time file processing status.
Usage:
Example output:
Patch Changes
#561
c3b3bd3Thanks @mattiamanzati! - Add descriptions to CLI commands usingCommand.withDescriptionfor improved help output when using--helpflag.#565
2274aefThanks @mattiamanzati! - FixunnecessaryPipediagnostic and refactor not working with namespace imports fromeffect/Function(e.g.,Function.pipe()orFn.pipe())#560
75a480eThanks @mattiamanzati! - Improve diagnostic message forunsupportedServiceAccessorswhen used withEffect.TagWhen the
unsupportedServiceAccessorsdiagnostic is triggered on anEffect.Tagclass (which doesn't allow disabling accessors), the message now includes a helpful suggestion to useContext.Taginstead:#559
4c1f809Thanks @mattiamanzati! - Improve Layer Magic refactor ordering by considering both provided and required service countsThe Layer Magic refactor now uses a combined ordering heuristic that considers both:
This results in more optimal layer composition order, especially in complex dependency graphs where layers have varying numbers of dependencies.
#566
036c491Thanks @mattiamanzati! - Simplify diagnostic messages for global Error type usageThe diagnostic messages for
globalErrorInEffectCatchandglobalErrorInEffectFailurenow use the more generic term "tagged errors" instead of "tagged errors (Data.TaggedError)" to provide cleaner, more concise guidance.v0.63.2Compare Source
Patch Changes
#553
e64e3dfThanks @mattiamanzati! - fix: ensure correct path resolution in CLI setupprocess.cwd()explicitly inpath.resolve()for consistent behavioryield*forTsConfigNotFoundErrorv0.63.1Compare Source
Patch Changes
#551
9b3d807Thanks @mattiamanzati! - fix: resolve TypeScript from project's working directoryThe CLI now attempts to resolve TypeScript from the current working directory first before falling back to the package's bundled version. This ensures the CLI uses the same TypeScript version as the project being analyzed.
v0.63.0Compare Source
Minor Changes
#548
ef8c2deThanks @mattiamanzati! - AddglobalErrorInEffectFailurediagnosticThis diagnostic warns when
Effect.failis called with the globalErrortype. Using the globalErrortype in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error types.Instead, the diagnostic recommends using:
Data.TaggedError_tag)Example:
#545
c590b5aThanks @mattiamanzati! - Addeffect-language-service setupCLI commandThis new command provides an interactive wizard to guide users through the complete installation and configuration of the Effect Language Service. The setup command:
Example usage:
The wizard will walk you through each step and show you exactly what changes will be made before applying them.
#550
4912ee4Thanks @mattiamanzati! - Add support for@effect/sql'sModel.Classin completions and diagnosticseffectSqlModelSelfInClassescompletion: Auto-completes theSelftype parameter when extendingModel.Classfrom@effect/sqlclassSelfMismatchdiagnostic: Now detects when theSelftype parameter inModel.Class<Self>doesn't match the actual class nameExample:
Patch Changes
#547
9058a37Thanks @mattiamanzati! - refactor: simplifyunnecessaryFailYieldableErrordiagnostic implementationChanged the implementation to check if a type extends
Cause.YieldableErroron-demand rather than fetching all yieldable error types upfront.#549
039f4b2Thanks @mattiamanzati! - AddgetTypeAtLocationutility toTypeCheckerUtilsThis refactoring adds a new
getTypeAtLocationfunction toTypeCheckerUtilsthat safely retrieves types while filtering out JSX-specific nodes (JSX elements, opening/closing tags, and JSX attributes) that could cause issues when callingtypeChecker.getTypeAtLocation.The utility is now used across multiple diagnostics and features, reducing code duplication and ensuring consistent handling of edge cases:
anyUnknownInErrorContextcatchUnfailableEffectfloatingEffectglobalErrorInEffectFailureleakingRequirementsmissedPipeableOpportunitymissingEffectServiceDependencymissingReturnYieldStarmultipleEffectProvidenonObjectEffectServiceTypeoverriddenSchemaConstructorreturnEffectInGenscopeInLayerEffectstrictBooleanExpressionsstrictEffectProvideunnecessaryFailYieldableErrorv0.62.5Compare Source
Patch Changes
#543
0b13f3cThanks @mattiamanzati! - Fix unwanted autocompletions inside import declarationsPreviously, Effect., Option., and Either.__ completions were incorrectly suggested inside import statements. This has been fixed by detecting when the completion is requested inside an import declaration and preventing these completions from appearing.
Closes #541
v0.62.4Compare Source
Patch Changes
#539
4cc88d2Thanks @mattiamanzati! - Improve layerMagic refactor to prioritize layers with more provided servicesThe layerMagic refactor now uses a heuristic that prioritizes nodes with more provided services when generating layer composition code. This ensures that telemetry and tracing layers (which typically provide fewer services) are positioned as late as possible in the dependency graph, resulting in more intuitive and correct layer ordering.
Example: When composing layers for services that depend on HttpClient with telemetry, the refactor now correctly places the telemetry layer (which provides fewer services) later in the composition chain.
v0.62.3Compare Source
Patch Changes
e31c03bThanks @mattiamanzati! - Fix counter increment timing in structural type to schema refactor to ensure proper naming of conflicting schemas (e.g.,User_1instead ofUser_0for the first conflict)v0.62.2Compare Source
Patch Changes
#535
361fc1eThanks @mattiamanzati! - Fix duplicate schema names in "Refactor to Schema (Recursive Structural)" code generation.When the refactor encountered types with conflicting names, it was generating a unique suffix but not properly tracking the usage count, causing duplicate schema identifiers with different contents to be generated.
This fix ensures that when a name conflict is detected and a unique suffix is added (e.g.,
Tax,Tax_1,Tax_2), the usage counter is properly incremented to prevent duplicate identifiers in the generated code.Fixes #534
v0.62.1Compare Source
Patch Changes
#532
8f189aaThanks @mattiamanzati! - Fix handling of read-only arrays in "Refactor to Schema (Recursive Structural)" code generation.The refactor now correctly distinguishes between mutable arrays (
Array<T>) and read-only arrays (ReadonlyArray<T>orreadonly T[]):Array<T>is now converted toSchema.mutable(Schema.Array(...))to preserve mutabilityReadonlyArray<T>andreadonly T[]are converted toSchema.Array(...)(read-only by default)This fixes compatibility issues with external libraries (like Stripe, BetterAuth) that expect mutable arrays in their API parameters.
Fixes #531
v0.62.0Compare Source
Minor Changes
#528
7dc14cfThanks @mattiamanzati! - Add typeToSchema codegenThis adds a new
// @​effect-codegens typeToSchemacodegen that automatically generates Effect Schema classes from TypeScript types. Given a type alias with object members representing schemas to generate (e.g.,type ToGenerate = { UserSchema: User, TodoSchema: Todo }), the codegen will create the corresponding Schema class definitions.The generated schemas:
outdatedEffectCodegendiagnostic to provide automatic fix actionsExample usage:
Patch Changes
#530
5ecdc62Thanks @mattiamanzati! - FixRefactor to Schema (Recursive Structural)to supportexactOptionalPropertyTypesWhen
exactOptionalPropertyTypesis enabled in tsconfig, optional properties with types likestring | undefinedare not assignable to types defined asprop?: string. This fix generatesSchema.optionalWith(Schema.String, { exact: true })instead ofSchema.optional(Schema.Union(Schema.Undefined, Schema.String))to maintain type compatibility with external libraries that don't always includeundefinedin their optional property types.Example:
This ensures the generated schema maintains proper type compatibility with external libraries when using strict TypeScript configurations.
v0.61.0Compare Source
Minor Changes
#525
e2dbbadThanks @mattiamanzati! - Add Structural Type to Schema refactorAdds a new "Structural Type to Schema" refactor that converts TypeScript interfaces and type aliases to Effect Schema classes. This refactor analyzes the structure of types and generates appropriate Schema definitions, with intelligent detection and reuse of existing schemas.
Example:
The refactor supports:
Effect-TS/effect (@effect/platform)
v0.94.1Compare Source
Patch Changes
#5936
65e9e35Thanks @schickling! - Document subtle CORS middlewareallowedHeadersbehavior: when empty array (default), it reflects back the client'sAccess-Control-Request-Headers(permissive), and when non-empty array, it only allows specified headers (restrictive). Added comprehensive JSDoc with examples.#5940
ee69cd7Thanks @kitlangton! - HttpServerResponse: fixfromWebto preserve Content-Type header when response has a bodyPreviously, when converting a web
Responseto anHttpServerResponseviafromWeb, theContent-Typeheader was not passed toBody.stream(), causing it to default toapplication/octet-stream. This affected any code usingHttpApp.fromWebHandlerto wrap web handlers, as JSON responses would incorrectly have their Content-Type set toapplication/octet-streaminstead ofapplication/json.Updated dependencies [
488d6e8]:v0.94.0Compare Source
Minor Changes
ff7053fThanks @tim-smart! - support non-errors in HttpClient.retryTransientPatch Changes
77eeb86,287c32c]:Effect-TS/effect (@effect/platform-browser)
v0.74.0Compare Source
Patch Changes
77eeb86,ff7053f,287c32c]:Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Renovate Bot.
Update dependency @effect/language-service to ^0.62.0to Update bun minor+patch updatesa274fb77f6to9d35e8eef39d35e8eef3to948de593f0