- #625
422087dThanks @mattiamanzati! - Fix CLI patching to targetemitFilesAndReportErrorsfunction instead ofemitFilesAndReportErrorsAndGetExitStatus, updating the injection approach to replace the diagnostics property in the return statement's object literal.
-
#624
d279457Thanks @mattiamanzati! - AddignoreEffectSuggestionsInTscExitCodeoption (default:true) to control whether Effect-related suggestions affect the TSC exit code. When enabled, suggestions won't causetscto return a non-zero exit code. -
#622
5eab20aThanks @mattiamanzati! - AddignoreEffectWarningsInTscExitCodeoption to allow Effect-related warnings to not affect the TSC exit code. When enabled,tscwill compile successfully even if Effect warnings are emitted. This is useful for CI/CD pipelines where Effect diagnostics should be informational rather than blocking.
-
#619
f171350Thanks @mattiamanzati! - AddeffectSucceedWithVoiddiagnostic to suggest usingEffect.voidinstead ofEffect.succeed(undefined)orEffect.succeed(void 0).The diagnostic detects calls to
Effect.succeedwhere the argument is exactlyundefinedorvoid 0(including parenthesized variants) and suggests replacing them with the more idiomaticEffect.void. A quick fix is provided to automatically apply the replacement.Before:
Effect.succeed(undefined); Effect.succeed(void 0);
After:
Effect.void;
-
#621
74ef937Thanks @mattiamanzati! - Improve diagnostic messages forglobalErrorInEffectFailureandglobalErrorInEffectCatchto be more concise and actionable.Before:
The global Error type is used in an Effect failure channel. It's not recommended to use the global Error type in Effect failures as they can get merged together. Instead, use tagged errors or custom errors with a discriminator property to get properly type-checked errors.After:
Global 'Error' loses type safety as untagged errors merge together in the Effect failure channel. Consider using a tagged error and optionally wrapping the original in a 'cause' property.
-
#618
ed689f8Thanks @mattiamanzati! - ImproveglobalErrorInEffectFailurediagnostic to detect global Error type in any Effect failure channel.The diagnostic now works by finding
new Error()expressions and checking if they end up in an Effect's failure channel, rather than only checkingEffect.failcalls. This means it will now detect global Error usage in:Effect.fail(new Error(...))Effect.genfunctions that fail with global ErrorEffect.mapErrorconverting to global ErrorEffect.flatMapchains that include global Error
The diagnostic now reports at the
new Error()location for better precision.
-
#616
b32da44Thanks @mattiamanzati! - ImprovemissedPipeableOpportunitydiagnostic message to show the suggested subject for.pipe(...).Before:
Nested function calls can be converted to pipeable style for better readability.After:
Nested function calls can be converted to pipeable style for better readability; consider using addOne(5).pipe(...) instead.
-
#612
2b49181Thanks @mattiamanzati! - Improve effectFnIife diagnostic message to suggest Effect.withSpan with the trace name when availableWhen
Effect.fn("traceName")is used as an IIFE, the diagnostic now suggests usingEffect.genwithEffect.withSpan("traceName")piped at the end to maintain tracing spans. ForEffect.fnUntraced, it simply suggests usingEffect.genwithout the span suggestion. -
#615
ae4f054Thanks @mattiamanzati! - Improve effectFnOpportunity diagnostic with more specific messages and configurable fixes- Add new
effectFnconfiguration option to control which code fix variants are offered:"untraced","span","inferred-span","no-span"(defaults to["span"]) - Diagnostic message now shows the exact expected signature for the rewrite
- Distinguish between explicit trace from
Effect.withSpanvs inferred trace from function name - Skip functions with return type annotations to avoid issues with recursive functions
Before:
This function could benefit from Effect.fn's automatic tracing...After:
Can be rewritten as a reusable function: Effect.fn("myFunction")(function*() { ... }) - Add new
- #610
990ccbcThanks @mattiamanzati! - Improve effectFnOpportunity diagnostic message to mention that quickfixes are available in the editor or via the CLI quickfixes command.
-
#608
bc7da1eThanks @mattiamanzati! - AddeffectFnIifediagnostic to warn whenEffect.fnorEffect.fnUntracedis used as an IIFE (Immediately Invoked Function Expression).Effect.fnis designed to create reusable functions that can take arguments and provide tracing. When used as an IIFE,Effect.genis more appropriate.Example:
// Before (triggers warning) const result = Effect.fn("test")(function* () { yield* Effect.succeed(1); })(); // After (using Effect.gen) const result = Effect.gen(function* () { yield* Effect.succeed(1); });
A quick fix is provided to automatically convert
Effect.fnIIFEs toEffect.gen.
-
#603
d747210Thanks @mattiamanzati! - AddedinstanceOfSchemadiagnostic that suggests usingSchema.isinstead ofinstanceoffor Effect Schema types.Example:
import { Schema } from "effect" const MySchema = Schema.Struct({ name: Schema.String }) // Before - triggers diagnostic if (value instanceof MySchema) { ... } // After - using Schema.is if (Schema.is(MySchema)(value)) { ... }
The diagnostic is disabled by default and can be enabled with
instanceOfSchema:suggestionorinstanceOfSchema:warning.
- #605
d63d5dfThanks @mattiamanzati! - ImproveleakingRequirementsdiagnostic message for clarity
-
#599
4c9f5c7Thanks @mattiamanzati! - AddquickfixesCLI command that shows diagnostics with available quick fixes and their proposed code changes.Example usage:
# Check a specific file effect-language-service quickfixes --file ./src/index.ts # Check an entire project effect-language-service quickfixes --project ./tsconfig.json
The command displays each diagnostic along with the available code fixes and a diff preview of the proposed changes, making it easy to see what automatic fixes are available before applying them.
-
#601
c0a6da3Thanks @mattiamanzati! - Reduce over-suggestion of effectFnOpportunity diagnostic for regular functions.The diagnostic now only suggests
Effect.fnfor regular functions (not usingEffect.gen) when:- The function has a block body (not a concise arrow expression)
- The function body has more than 5 statements
Functions using
Effect.genare still always suggested regardless of body size.
-
#597
3833a10Thanks @mattiamanzati! - ImprovedeffectFnOpportunitydiagnostic message to mention that Effect.fn accepts piped transformations as additional arguments when pipe transformations are detected.When a function has
.pipe()calls that would be absorbed by Effect.fn, the message now includes: "Effect.fn also accepts the piped transformations as additional arguments."
-
#594
0b9b37cThanks @mattiamanzati! - AddpreferSchemaOverJsondiagnostic that suggests using Effect Schema for JSON operations instead ofJSON.parse/JSON.stringifyinside Effect contexts (Effect.try,Effect.gen,Effect.fn).// Before - triggers diagnostic const program = Effect.try(() => JSON.parse('{"name":"John"}')); const program2 = Effect.gen(function* () { const parsed = JSON.parse('{"name":"John"}'); return parsed; }); // After - use Effect Schema import { Schema } from "effect"; const Person = Schema.Struct({ name: Schema.String }); const program = Schema.decode(Person)('{"name":"John"}'); const program2 = Effect.gen(function* () { const parsed = yield* Schema.decode(Person)('{"name":"John"}'); return parsed; });
-
#593
f4d888dThanks @mattiamanzati! - AddschemaSyncInEffectdiagnostic that warns when usingSchema.decodeSync,Schema.decodeUnknownSync,Schema.encodeSync, orSchema.encodeUnknownSyncinside Effect generators (Effect.gen,Effect.fn,Effect.fnUntraced), suggesting the use of Effect-based alternatives (Schema.decode,Schema.decodeUnknown,Schema.encode,Schema.encodeUnknown) for properly typedParseErrorin the error channel.// Before - triggers diagnostic const program = Effect.gen(function* () { const person = Schema.decodeSync(Person)(input); return person; }); // After - use Effect-based method const program = Effect.gen(function* () { const person = yield* Schema.decode(Person)(input); return person; });
Also adds
findEnclosingScopeshelper to TypeParser for reusable scope detection logic.
-
#595
f54ef88Thanks @mattiamanzati! - Tone downeffectFnOpportunitydiagnostic to skip suggestions when function parameters are referenced inside pipe transformations. Converting such functions toEffect.fnwould break the code since parameters would no longer be in scope for the pipe arguments.// This no longer triggers the diagnostic because `a` and `b` are used in the pipe export const shouldSkip = (a: number, b: string) => { return Effect.gen(function* () { yield* Effect.succeed(a); return b; }).pipe(Effect.withSpan("withParameters", { attributes: { a, b } })); };
-
#588
689059dThanks @mattiamanzati! - TheeffectFnOpportunitydiagnostic now also supports regular functions that return an Effect, not just those usingEffect.gen. -
#596
8f00287Thanks @mattiamanzati! - ImprovedmissedPipeableOpportunitydiagnostic to check if callees are safe to use in pipes without losingthiscontext.The diagnostic now stops accumulating transformations when it encounters an unsafe callee (like method calls on class instances) and wraps the result with any remaining outer transformations.
Safe callees include:
- Property access on modules/namespaces (e.g.,
Effect.map) - Standalone function identifiers
- Call expressions (already evaluated)
- Arrow functions and function expressions
Example - before this change, the diagnostic would incorrectly suggest:
// Input console.log(Effect.runPromise(Effect.ignore(Effect.log("Hello")))); // Would produce (incorrect - loses console.log wrapper) Effect.log("Hello").pipe(Effect.ignore, Effect.runPromise);
Now it correctly produces:
// Input console.log(Effect.runPromise(Effect.ignore(Effect.log("Hello")))); // Output (correct - preserves console.log wrapper) console.log(Effect.log("Hello").pipe(Effect.ignore, Effect.runPromise));
- Property access on modules/namespaces (e.g.,
-
#581
4569328Thanks @mattiamanzati! - AddeffectFnOpportunitydiagnostic that suggests converting functions returningEffect.gentoEffect.fnfor 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 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"));
- Arrow functions returning
-
#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 body
And adds
isVoidExpressionutility to TypeScriptUtils for detectingvoid 0orundefinedexpressions.Example:
// 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
94d4a6bThanks @mattiamanzati! - AddedlayerinfoCLI 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, andLayer.merge
Example usage:
effect-language-service layerinfo --file ./src/layers/app.ts --name AppLive
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:
class MyError extends Schema.TaggedError<MyError>("MyError")("MyError", { message: Schema.String, }) {}
After applying the fix:
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, 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:
- Old:
reportSuggestionsAsWarningsInTsc: false(suggestions not included by default) - New:
includeSuggestionsInTsc: true(suggestions included by default)
To restore the previous behavior, set
"includeSuggestionsInTsc": falsein your tsconfig.json plugin configuration. - Old:
-
#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:
- 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 -->
-
#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:
// 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
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:
- Added
--outputsoption 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
ROutare 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.
- Added
-
#577
0ed50c3Thanks @mattiamanzati! - RefactorcatchAllToMapErrordiagnostic to use the piping flows parser for detecting Effect.catchAll calls.This change also:
- Makes
outTypeoptional inParsedPipingFlowSubjectto handle cases where type information is unavailable - Sorts piping flows by position for consistent ordering
- Makes
-
#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 utility- Extract
collectSourceFileExportedSymbolsintosrc/cli/utils/ExportedSymbols.tsfor reuse across CLI commands - Add
--max-symbol-depthoption to overview command (default: 3) to control how deep to traverse nested symbol properties - Add tests for the overview command with snapshot testing
- Extract
-
#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:- 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
missedPipeableOpportunitydiagnostic has been refactored to use this new parser, improving performance when analyzing files with multiple piping patterns. - Identifies piping flows including nested pipes and mixed call styles (e.g.,
-
#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:SchemaAST.import * as SchemaAST from "effect/SchemaAST";
Instead of the expected:
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.
-
#567
dcb3fe5Thanks @mattiamanzati! - Added new diagnosticcatchAllToMapErrorthat suggests usingEffect.mapErrorinstead ofEffect.catchAll+Effect.failwhen the callback only wraps the error.Before:
Effect.catchAll((cause) => Effect.fail(new MyError(cause)));
After:
Effect.mapError((cause) => new MyError(cause));
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:
Effect.tryPromise({ try: () => fetch("http://example.com"), catch: () => new Error("Request failed"), // ⚠️ Warning: returns global Error type });
Recommended approach:
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
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:
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:
// 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
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:
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
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:
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>
-
#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: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
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:
- 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.
-
#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.
-
#553
e64e3dfThanks @mattiamanzati! - fix: ensure correct path resolution in CLI setup- Use
process.cwd()explicitly inpath.resolve()for consistent behavior - Resolve the selected tsconfig path to an absolute path before validation
- Simplify error handling by using direct
yield*forTsConfigNotFoundError
- Use
-
#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.
-
#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:
- Tagged errors with
Data.TaggedError - Custom error classes with a discriminator property (like
_tag)
Example:
// 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
- Tagged errors with
-
#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:
- 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.
-
#550
4912ee4Thanks @mattiamanzati! - Add support for@effect/sql'sModel.Classin completions and diagnostics- Added
effectSqlModelSelfInClassescompletion: Auto-completes theSelftype parameter when extendingModel.Classfrom@effect/sql - Extended
classSelfMismatchdiagnostic: Now detects when theSelftype parameter inModel.Class<Self>doesn't match the actual class name
Example:
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, }) {}
- Added
-
#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:
anyUnknownInErrorContextcatchUnfailableEffectfloatingEffectglobalErrorInEffectFailureleakingRequirementsmissedPipeableOpportunitymissingEffectServiceDependencymissingReturnYieldStarmultipleEffectProvidenonObjectEffectServiceTypeoverriddenSchemaConstructorreturnEffectInGenscopeInLayerEffectstrictBooleanExpressionsstrictEffectProvideunnecessaryFailYieldableError- And other features like quick info, goto definition, and refactors
-
#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
-
#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.
- #537
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)
-
#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
-
#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
-
#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:
- 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
outdatedEffectCodegendiagnostic to provide automatic fix actions
Example usage:
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, }) {}
-
#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:
// 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.
-
#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:
// 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
-
#523
46ec3e1Thanks @mattiamanzati! - Add configurable mermaid provider optionAdds a new
mermaidProviderconfiguration option that allows users to choose between different Mermaid diagram providers:"mermaid.com"- Uses mermaidchart.com"mermaid.live"- Uses mermaid.live (default)- Custom URL - Allows specifying a custom provider URL (e.g.,
"http://localhost:8080"for local mermaid-live-editor)
This enhances flexibility for users who prefer different Mermaid visualization services or need to use self-hosted instances.
-
#518
660549dThanks @mattiamanzati! - Add newschemaStructWithTagdiagnostic that suggests usingSchema.TaggedStructinstead ofSchema.Structwhen a_tagfield withSchema.Literalis present. This makes the tag optional in the constructor, improving the developer experience.Example:
// Before (triggers diagnostic) export const User = Schema.Struct({ _tag: Schema.Literal("User"), name: Schema.String, age: Schema.Number, }); // After (applying quick fix) export const User = Schema.TaggedStruct("User", { name: Schema.String, age: Schema.Number, });
The diagnostic includes a quick fix that automatically converts the
Schema.Structcall toSchema.TaggedStruct, extracting the tag value and removing the_tagproperty from the fields.
-
#521
61f28baThanks @mattiamanzati! - Fix auto-completion for directly imported Effect APIs. Completions now work when using direct imports likeimport { Service } from "effect/Effect"instead of only working with fully qualified names likeEffect.Service.This fix applies to:
Effect.ServiceandEffect.Tagfromeffect/EffectSchema.Class,Schema.TaggedError,Schema.TaggedClass, andSchema.TaggedRequestfromeffect/SchemaData.TaggedErrorandData.TaggedClassfromeffect/DataContext.Tagfromeffect/Context
Example:
// Now works with direct imports import { Service } from "effect/Effect" export class MyService extends Service // ✓ Completion available // Still works with fully qualified names import * as Effect from "effect/Effect" export class MyService extends Effect.Service // ✓ Completion available
Fixes #394
-
#515
b77b7e5Thanks @mattiamanzati! - Fix toggle type annotation and toggle return type annotation refactors to handle unnamed/unresolved typesThe refactors now use
ts.NodeBuilderFlags.IgnoreErrorsflag when generating type annotations, allowing them to work correctly with types that have errors or are unnamed (e.g.,Schema.Struct({ ... }).make). This prevents the refactors from failing when the type contains unresolved references or complex type expressions. -
#514
ddabde2Thanks @mattiamanzati! - Fix symbol resolution for aliased module exports. The TypeParser now correctly handles cases where symbols are exported from a module with an alias, improving the accuracy of type analysis for Effect modules.
- #512
e3dc38eThanks @mattiamanzati! - Fix type annotation context resolution in toggle refactors. When toggling type annotations or return type annotations, the refactors now correctly use the enclosing declaration node as context instead of the local node, which improves type resolution and prevents issues with type parameter scope.
-
#510
9064174Thanks @mattiamanzati! - ExtendanyUnknownInErrorContextdiagnostic to also check Layer typesThe
anyUnknownInErrorContextdiagnostic now checks both Effect and Layer types foranyorunknownin their error and requirements channels. This helps catch more cases where type information is being lost in your Effect applications.Example:
const effectUnknown = Effect.context<unknown>(); const layerUnknown = Layer.effectDiscard(effectUnknown); // Now reports: This has unknown in the requirements channel which is not recommended.
The diagnostic also now skips explicit Layer type annotations to avoid false positives on intentional type declarations.
-
#508
1a4446cThanks @mattiamanzati! - FixanyUnknownInErrorContextdiagnostic to exclude JSX elements from reporting false positives. The diagnostic will no longer incorrectly flag JSX tag names, self-closing elements, opening/closing elements, and attribute names.Example:
// Before: Would incorrectly report diagnostic on <MyComponent /> const element = <MyComponent />; // After: No diagnostic, JSX elements are properly excluded const element = <MyComponent />;
-
#505
31cff49Thanks @clayroach! - EnhancediagnosticsCLI command with new options for CI/CD integration and tooling:-
--format: Output format selection (json,pretty,text,github-actions)json: Machine-readable JSON output with structured diagnostics and summarypretty: Colored output with context (default, original behavior)text: Plain text output without colorsgithub-actions: GitHub Actions workflow commands for inline PR annotations
-
--strict: Treat warnings as errors (affects exit code) -
--severity: Filter diagnostics by severity level (comma-separated:error,warning,message) -
Exit codes: Returns exit code 1 when errors are found (or warnings in strict mode)
Example usage:
# JSON output for CI/CD pipelines effect-language-service diagnostics --project tsconfig.json --format json # GitHub Actions with inline annotations effect-language-service diagnostics --project tsconfig.json --format github-actions # Strict mode for CI (fail on warnings) effect-language-service diagnostics --project tsconfig.json --strict # Only show errors effect-language-service diagnostics --project tsconfig.json --severity error
Closes Effect-TS/effect #5180.
-
-
#503
857e43eThanks @mattiamanzati! - Add codefix torunEffectInsideEffectdiagnostic that automatically transformsEffect.run*calls to useRuntime.run*when inside nested Effect contexts. The codefix will extract or reuse an existing Effect runtime and replace the direct Effect run call with the appropriate Runtime method.Example:
// Before Effect.gen(function* () { websocket.onmessage = (event) => { Effect.runPromise(check); }; }); // After applying codefix Effect.gen(function* () { const effectRuntime = yield* Effect.runtime<never>(); websocket.onmessage = (event) => { Runtime.runPromise(effectRuntime, check); }; });
-
#500
acc2d43Thanks @mattiamanzati! - Add newannotatecodegen that automatically adds type annotations to exported constants based on their initializer types. This codegen can be used by adding// @effect-codegens annotatecomments above variable declarations.Example:
// @effect-codegens annotate export const test = Effect.gen(function* () { if (Math.random() < 0.5) { return yield* Effect.fail("error"); } return 1 as const; }); // Becomes: // @effect-codegens annotate:5fce15f7af06d924 export const test: Effect.Effect<1, string, never> = Effect.gen(function* () { if (Math.random() < 0.5) { return yield* Effect.fail("error"); } return 1 as const; });
The codegen automatically detects the type from the initializer and adds the appropriate type annotation, making code more explicit and type-safe.
-
#497
b188b74Thanks @mattiamanzati! - Add new diagnosticunnecessaryFailYieldableErrorthat warns when usingyield* Effect.fail()with yieldable error types. The diagnostic suggests yielding the error directly instead of wrapping it withEffect.fail(), as yieldable errors (likeData.TaggedErrorandSchema.TaggedError) can be yielded directly in Effect generators.Example:
// ❌ Unnecessary Effect.fail wrapper yield * Effect.fail(new DataTaggedError()); // ✅ Direct yield of yieldable error yield * new DataTaggedError();
-
#494
9b3edf0Thanks @mattiamanzati! - AddcodegenCLI command to automatically update Effect codegensThis release introduces a new CLI command
effect-language-service codegenthat allows you to automatically update Effect codegens in your TypeScript files from the command line. The command scans files containing@effect-codegensdirectives and applies the necessary code transformations.Usage:
effect-language-service codegen --file <path>- Update a specific fileeffect-language-service codegen --project <tsconfig.json>- Update all files in a projecteffect-language-service codegen --verbose- Show detailed output during processing
Example:
# Update a single file effect-language-service codegen --file src/MyService.ts # Update entire project effect-language-service codegen --project tsconfig.json --verbose
This is particularly useful for CI/CD pipelines or batch processing scenarios where you want to ensure all codegens are up-to-date without manual editor intervention.
- #492
f2d2748Thanks @mattiamanzati! - Fixed duplicate edges in layer outline graph that could occur when multiple type assignments matched between layer nodes
- #490
7d2e6dcThanks @mattiamanzati! - OptimizegetTypeAtLocationusage to reduce unnecessary calls on non-expression nodes. This improves performance by ensuring type checking is only performed on expression nodes and adds additional null safety checks for symbol resolution.
-
#488
53eedeaThanks @mattiamanzati! - Fixed@effect-diagnostics-next-linecomment directive to properly work with diagnostics on property assignments within object literals. Previously, the directive would not suppress diagnostics for properties in the middle of an object literal. -
#486
3830d48Thanks @mattiamanzati! - Fixed quick info feature to properly display Effect type parameters when hovering over code. This resolves issues where the quick info would fail to show Success, Failure, and Requirements types in certain contexts. -
#489
42ce900Thanks @mattiamanzati! - Allow to override Schema constructor as long parameters are just redirected
- #484
7c18fa8Thanks @mattiamanzati! - Fix edge cases in missedPipeableOpportunity diagnostic where it incorrectly flagged valid code patterns. The diagnostic now properly:- Excludes
pipefunction calls from chain detection - Ignores chains where the function returns a callable type (avoiding false positives for higher-order functions like
Schedule.whileOutput)
- Excludes
-
#482
9695bdfThanks @mattiamanzati! - FixmissedPipeableOpportunitydiagnostic to correctly detect nested function call chainsThe diagnostic now properly identifies when nested function calls can be converted to pipeable style. Previously, the chain detection logic incorrectly tracked parent-child relationships, causing false positives. This fix ensures that only valid pipeable chains are reported, such as
toString(double(addOne(5)))which can be refactored toaddOne(5).pipe(double, toString).Example:
// Before: incorrectly flagged or missed identity(Schema.decodeUnknown(MyStruct)({ x: 42, y: 42 })); // After: correctly handles complex nested calls toString(double(addOne(5))); // ✓ Now correctly detected as pipeable
-
#478
9a9d5f9Thanks @mattiamanzati! - AddrunEffectInsideEffectdiagnostic to warn when usingEffect.runSync,Effect.runPromise,Effect.runFork, orEffect.runCallbackinside an Effect context (such asEffect.gen,Effect.fn, orEffect.fnUntraced).Running effects inside effects is generally not recommended as it breaks the composability of the Effect system. Instead, developers should extract the Runtime and use
Runtime.runSync,Runtime.runPromise, etc., or restructure their code to avoid running effects inside effects.Example:
// ❌ Will trigger diagnostic export const program = Effect.gen(function* () { const data = yield* Effect.succeed(42); const result = Effect.runSync(Effect.sync(() => data * 2)); // Not recommended return result; }); // ✅ Proper approach - extract runtime export const program = Effect.gen(function* () { const data = yield* Effect.succeed(42); const runtime = yield* Effect.runtime(); const result = Runtime.runSync(runtime)(Effect.sync(() => data * 2)); return result; }); // ✅ Better approach - compose effects export const program = Effect.gen(function* () { const data = yield* Effect.succeed(42); const result = yield* Effect.sync(() => data * 2); return result; });
-
#480
f1a0eceThanks @mattiamanzati! - AddschemaUnionOfLiteralsdiagnostic to warn when usingSchema.Unionwith multipleSchema.Literalcalls that can be simplified to a singleSchema.Literalcall.This diagnostic helps improve code readability and maintainability by suggesting a more concise syntax for union of literals.
Example:
// ❌ Will trigger diagnostic export const Status = Schema.Union(Schema.Literal("A"), Schema.Literal("B")); // ✅ Simplified approach export const Status = Schema.Literal("A", "B");
-
#481
160e018Thanks @mattiamanzati! - Update Effect ecosystem dependencies to latest versions:@effect/cli: 0.71.0 → 0.72.0@effect/platform: 0.92.1 → 0.93.0@effect/platform-node: 0.98.3 → 0.99.0@effect/printer-ansi: 0.46.0 → 0.47.0@effect/rpc: 0.71.0 → 0.72.0effect: Updated to stable version 3.19.0
Also updated development tooling dependencies:
vitest: 3.2.4 → 4.0.6@vitest/coverage-v8: 3.2.4 → 4.0.6- TypeScript ESLint packages: 8.46.1 → 8.46.3
- Various other minor dependency updates
-
#476
9d5028cThanks @mattiamanzati! - AddunknownInEffectCatchdiagnostic to warn when catch callbacks inEffect.tryPromise,Effect.tryMap, orEffect.tryMapPromisereturnunknownoranytypes. This helps ensure proper error typing by encouraging developers to wrap unknown errors into Effect'sData.TaggedErroror narrow down the type to the specific error being raised.Example:
// ❌ Will trigger diagnostic const program = Effect.tryPromise({ try: () => fetch("http://something"), catch: (e) => e, // returns unknown }); // ✅ Proper typed error class MyError extends Data.TaggedError("MyError")<{ cause: unknown }> {} const program = Effect.tryPromise({ try: () => fetch("http://something"), catch: (e) => new MyError({ cause: e }), });
- #475
9f2425eThanks @mattiamanzati! - Fix TSC patching mode to properly filter diagnostics by module name. ThereportSuggestionsAsWarningsInTscoption now only affects the TSC module and not the TypeScript module, preventing suggestions from being incorrectly reported in non-TSC contexts.
-
#473
b29eca5Thanks @mattiamanzati! - Fix memory leak in CLI diagnostics by properly disposing language services when they change between batches.The CLI diagnostics command now tracks the language service instance and disposes of it when a new instance is created, preventing memory accumulation during batch processing of large codebases.
-
#474
06b9ac1Thanks @mattiamanzati! - Fix TSC patching mode to properly enable diagnosticsName option and simplify suggestion handling.When using the language service in TSC patching mode, the
diagnosticsNameoption is now automatically enabled to ensure diagnostic rule names are included in the output. Additionally, the handling of suggestion-level diagnostics has been simplified - whenreportSuggestionsAsWarningsInTscis enabled, suggestions are now converted to Message category instead of Warning category with a prefix.This change ensures consistent diagnostic formatting across both IDE and CLI usage modes.
-
#471
be70748Thanks @mattiamanzati! - Improve CLI diagnostics output formatting by displaying rule names in a more readable format.The CLI now displays diagnostic rule names using the format
effect(ruleName):instead ofTS<code>:, making it easier to identify which Effect diagnostic rule triggered the error. Additionally, the CLI now disables thediagnosticsNameoption internally to prevent duplicate rule name display in the message text.Example output:
Before: TS90001: Floating Effect detected... After: effect(floatingEffect): Floating Effect detected...
-
#469
f27be56Thanks @mattiamanzati! - AddreportSuggestionsAsWarningsInTscconfiguration option to allow suggestions and messages to be reported as warnings in TypeScript compiler.When enabled, diagnostics with "suggestion" or "message" severity will be upgraded to "warning" severity with a "[suggestion]" prefix in the message text. This is useful for CI/CD pipelines where you want to enforce suggestion-level diagnostics as warnings in the TypeScript compiler output.
Example configuration:
{ "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "reportSuggestionsAsWarningsInTsc": true } ] } }
-
#467
c2f6e50Thanks @mattiamanzati! - Fix layer graph display improvements: properly render newlines in mermaid diagrams using<br/>tags, and improve readability by displaying variable declaration names instead of full expressions when available.Example: Instead of showing the entire
pipe(Database.Default, Layer.provideMerge(UserRepository.Default))expression in the graph node, it now displays the cleaner variable nameAppLivewhen the layer is assigned to a variable.
-
#466
e76e9b9Thanks @mattiamanzati! - Add support for following symbols in Layer Graph visualizationThe layer graph feature now supports following symbol references to provide deeper visualization of layer dependencies. This is controlled by the new
layerGraphFollowDepthconfiguration option (default: 0).Example:
// With layerGraphFollowDepth: 1 export const myLayer = otherLayer.pipe(Layer.provide(DbConnection.Default)); // Now visualizes the full dependency tree by following the 'otherLayer' reference
- #464
4cbd549Thanks @mattiamanzati! - Fix layer graph for expression nodes not returning layers directly
- #462
4931bbdThanks @mattiamanzati! - Skip patching again by default, unless --force option is provided
-
#460
1ac81a0Thanks @mattiamanzati! - Add new diagnosticcatchUnfailableEffectto warn when using catch functions on effects that never failThis diagnostic detects when catch error handling functions are applied to effects that have a
nevererror type (meaning they cannot fail). It supports all Effect catch variants:Effect.catchAllEffect.catchEffect.catchIfEffect.catchSomeEffect.catchTagEffect.catchTags
Example:
// Will trigger diagnostic const example = Effect.succeed(42).pipe( Effect.catchAll(() => Effect.void) // <- Warns here ); // Will not trigger diagnostic const example2 = Effect.fail("error").pipe( Effect.catchAll(() => Effect.succeed(42)) );
The diagnostic works in both pipeable style (
Effect.succeed(x).pipe(Effect.catchAll(...))) and data-first style (pipe(Effect.succeed(x), Effect.catchAll(...))), analyzing the error type at each position in the pipe chain. -
#458
372a9a7Thanks @mattiamanzati! - Refactor TypeParser internals to use symbol-based navigation instead of type-based navigationThis change improves the reliability and performance of the TypeParser by switching from type-based navigation to symbol-based navigation when identifying Effect, Schema, and other Effect ecosystem APIs. The new implementation:
- Uses TypeScript's symbol resolution APIs to accurately identify imports and references
- Supports package name resolution to verify that identifiers actually reference the correct packages
- Implements proper alias resolution for imported symbols
- Adds caching for source file package information lookups
- Provides new helper methods like
isNodeReferenceToEffectModuleApiandisNodeReferenceToEffectSchemaModuleApi
This is an internal refactoring that doesn't change the public API or functionality, but provides a more robust foundation for the language service features.
-
#456
ddc3da8Thanks @mattiamanzati! - Bug fix for layer graph: properly display dependencies when they reference themselvesThe layer graph now correctly identifies and displays dependencies even when using type assignment compatibility (e.g., when a layer provides a base type and another layer requires a subtype).
-
#452
fb0ae8bThanks @mattiamanzati! - AddstrictEffectProvidediagnostic to warn when using Effect.provide with Layer outside of application entry pointsThis new diagnostic helps developers identify potential scope lifetime issues by detecting when
Effect.provideis called with a Layer argument in locations that are not application entry points.Example:
// Will trigger diagnostic export const program = Effect.void.pipe(Effect.provide(MyService.Default));
Message:
Effect.provide with a Layer should only be used at application entry points. If this is an entry point, you can safely disable this diagnostic. Otherwise, using Effect.provide may break scope lifetimes. Compose all layers at your entry point and provide them at once.
Configuration:
- Default severity:
"off"(opt-in) - Diagnostic name:
strictEffectProvide
This diagnostic is disabled by default and can be enabled via tsconfig.json:
{ "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "strictEffectProvide": "warning" } } ] } } - Default severity:
- #455
11743b5Thanks @mattiamanzati! - Bug fix formissedPipeableOpportunitydiagnostic
-
#450
3994aafThanks @mattiamanzati! - Add new diagnostic to detect nested function calls that can be converted to pipeable styleThe new
missedPipeableOpportunitydiagnostic identifies nested function calls that would be more readable when converted to Effect's pipeable style. For example:// Detected pattern: toString(double(addOne(5))); // Can be converted to: addOne(5).pipe(double, toString);
This diagnostic helps maintain consistent code style and improves readability by suggesting the more idiomatic pipeable approach when multiple functions are chained together.
- #445
fe0e390Thanks @mattiamanzati! - Use the Graph module for outline line graph and layer magic
- #449
ff11b7dThanks @mattiamanzati! - Update effect package version to 97ff1dc. This version improves handling of special characters in layer graph mermaid diagrams by properly escaping HTML entities (parentheses, braces, quotes) to ensure correct rendering.
-
#441
ed1db9eThanks @mattiamanzati! - Adddefault-hashedpattern for deterministic keysA new
default-hashedpattern option is now available for service and error key patterns. This pattern works like thedefaultpattern but hashes the resulting string, which is useful when you want deterministic keys but are concerned about potentially exposing service names in builds.Example configuration:
{ "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] }
-
#442
44f4304Thanks @mattiamanzati! - Tone down try/catch message to ignore try/finally blocks -
#439
b73c231Thanks @mattiamanzati! - Fix regression in type unification for union types and prevent infinite recursion in layerMagic refactor- Fixed
toggleTypeAnnotationrefactor to properly unify boolean types instead of expanding them totrue | false - Fixed infinite recursion issue in
layerMagicrefactor'sadjustedNodefunction when processing variable and property declarations
- Fixed
- #437
e583192Thanks @mattiamanzati! - In toggle return type refactors, skip type parameters if they are the same as the function default in some cases.
- #433
f359cdbThanks @mattiamanzati! - Improve memory by properly evicting older cached members
-
#431
acbbc55Thanks @mattiamanzati! - Fix nested project references relative paths in CLI diagnostics commandThe CLI diagnostics command now correctly resolves paths for nested project references by:
- Using absolute paths when parsing tsconfig files
- Correctly resolving the base directory for relative paths in project references
- Processing files in batches to improve memory usage and prevent leaks
-
#429
351d7fbThanks @mattiamanzati! - Add newdiagnosticsCLI command to check Effect-specific diagnostics for files or projectsThe new
effect-language-service diagnosticscommand provides a way to get Effect-specific diagnostics through the CLI without patching your TypeScript installation. It supports:--fileoption to get diagnostics for a specific file--projectoption with a tsconfig file to check an entire project
The command outputs diagnostics in the same format as the TypeScript compiler, showing errors, warnings, and messages with their locations and descriptions.
-
#424
4bbfdb0Thanks @mattiamanzati! - Add support to mark a service as "leakable" via JSDoc tag. Services marked with@effect-leakable-servicewill be excluded from the leaking requirements diagnostic, allowing requirements that are expected to be provided per method invocation (e.g. HttpServerRequest).Example:
/** * @effect-leakable-service */ export class FileSystem extends Context.Tag("FileSystem")< FileSystem, { writeFile: (content: string) => Effect.Effect<void>; } >() {}
-
#428
ebaa8e8Thanks @mattiamanzati! - Add diagnostic to warn when@effect-diagnostics-next-linecomments have no effect. This helps identify unused suppression comments that don't actually suppress any diagnostics, improving code cleanliness.The new
missingDiagnosticNextLineoption controls the severity of this diagnostic (default: "warning"). Set to "off" to disable.Example:
// This comment will trigger a warning because it doesn't suppress any diagnostic // @effect-diagnostics-next-line effect/floatingEffect:off const x = 1; // This comment is correctly suppressing a diagnostic // @effect-diagnostics-next-line effect/floatingEffect:off Effect.succeed(1);
-
#426
22717bdThanks @mattiamanzati! - Improve Layer Magic refactor with enhanced dependency sorting and cycle detectionThe Layer Magic refactor now includes:
- Better handling of complex layer composition scenarios
- Support for detecting missing layer implementations with helpful error messages
-
#423
70d8734Thanks @mattiamanzati! - Add code fix to rewrite Schema class constructor overrides as static 'new' methodsWhen detecting constructor overrides in Schema classes, the diagnostic now provides a new code fix option that automatically rewrites the constructor as a static 'new' method. This preserves the custom initialization logic while maintaining Schema's decoding behavior.
Example:
// Before (with constructor override) class MyClass extends Schema.Class<MyClass>("MyClass")({ a: Schema.Number }) { b: number; constructor() { super({ a: 42 }); this.b = 56; } } // After (using static 'new' method) class MyClass extends Schema.Class<MyClass>("MyClass")({ a: Schema.Number }) { b: number; public static new() { const _this = new this({ a: 42 }); _this.b = 56; return _this; } }
-
#421
8c455edThanks @mattiamanzati! - Update dependencies to their latest versions including Effect 3.18.4, TypeScript 5.9.3, and various ESLint and build tooling packages
-
#419
7cd7216Thanks @mattiamanzati! - Add support for custom APIs in deterministicKeys diagnostic using the@effect-identifierJSDoc tag.You can now enforce deterministic keys in custom APIs that follow an
extends MyApi("identifier")pattern by:- Adding
extendedKeyDetection: trueto plugin options to enable detection - Marking the identifier parameter with
/** @effect-identifier */JSDoc tag
Example:
export function Repository(/** @effect-identifier */ identifier: string) { return Context.Tag("Repository/" + identifier); } export class UserRepo extends Repository("user-repo")< UserRepo, { /** ... */ } >() {}
- Adding
- #417
db0a643Thanks @mattiamanzati! - Fix early exit for a deterministicKeys rule
- #415
42c66a1Thanks @mattiamanzati! - AdddiagnosticsNameoption to include rule names in diagnostic messages. When enabled (default: true), diagnostic messages will display the rule name at the end, e.g., "Effect must be yielded or assigned to a variable. effect(floatingEffect)"
- #410
0b40c04Thanks @mattiamanzati! - Defer typescript loading in CLI
- #408
9ccd800Thanks @mattiamanzati! - Fix handling of leading/trailing slashes
-
#407
6590590Thanks @mattiamanzati! - Add deterministicKeys diagnostic to enforce consistent key patterns for Services and ErrorsThis new diagnostic helps maintain consistent and unique keys for Effect Services and Tagged Errors by validating them against configurable patterns. The diagnostic is disabled by default and can be enabled via the
deterministicKeysdiagnosticSeverity setting.Two patterns are supported:
default: Constructs keys from package name + file path + class identifier (e.g.,@effect/package/FileName/ClassIdentifier)package-identifier: Uses package name + identifier for flat project structures
Example configuration:
The diagnostic also provides auto-fix code actions to update keys to match the configured patterns.
-
#405
f43b3abThanks @mattiamanzati! - Fix wrapWithEffectGen refactor not working on class heritage clausesThe wrapWithEffectGen refactor now correctly skips expressions in heritage clauses (e.g.,
extendsclauses in class declarations) to avoid wrapping them inappropriately.
- #403
dc3f7e9Thanks @mattiamanzati! - AddquickinfoMaximumLengthoption to control the maximum length of types displayed in quickinfo hover. This helps improve performance when dealing with very long types by allowing TypeScript to truncate them to a specified budget. Defaults to -1 (no truncation), but can be set to any positive number (e.g., 1000) to limit type display length.
-
#401
394fa8dThanks @mattiamanzati! - Add Effect.Tag completion for classes extending EffectWhen typing
Effect.in a class that extends Effect, the completion now also suggestsEffect.Tagalongside the existingEffect.Servicecompletion. This provides an additional way to define tagged services using the Effect.Tag pattern. -
#398
ae323d7Thanks @mattiamanzati! - Refactor internal TypeScript API wrappers to TypeScriptApi module for better code organization -
#400
6537461Thanks @mattiamanzati! - Reuse program package json info cache if available
- #396
744de40Thanks @mattiamanzati! - Add new diagnostic to warn whenEffect.Serviceis used with a primitive type instead of an object type. This diagnostic helps prevent common mistakes where developers try to use primitive values (strings, numbers, etc.) as service types, which is not supported byEffect.Service. The diagnostic suggests wrapping the value in an object or manually usingContext.TagorEffect.Tagfor primitive types.
-
#393
0d49098Thanks @mattiamanzati! - Fix name of autofix suggestion -
#387
7307ee1Thanks @mattiamanzati! - Comply with ts-patch and vue-tsc patching mechanism -
#392
9df4e59Thanks @mattiamanzati! - Adds override keyword in generated accessors -
#395
e504cecThanks @mattiamanzati! - Fix and silently skip double-adding of handlers in protocols handlers
-
#384
62b9829Thanks @mattiamanzati! - Add new diagnostic:effectGenUsesAdapter- warns when usingEffect.genwith the generator adapter pattern (function*(_)) instead of usingpipe()The generator adapter pattern
function*(_)is an old pattern. Users should usepipe()for composing effects orEffect.gen(function*())without the adapter for generator-based code.Example that will trigger the warning:
const example = Effect.gen(function* (_) { const result = yield* _(Effect.succeed(42)); return result; });
-
#382
2f318b6Thanks @mattiamanzati! - Add noExternal option -
#385
8580bedThanks @mattiamanzati! - Fix false positive regarding Schema.Class
- #380
98e30ddThanks @mattiamanzati! - Added exposed APIs for mermaid chart locally and allow to disable external links
-
#378
2f9bc51Thanks @mattiamanzati! - Add support for Effect.Tag in writeTagClassAccessors refactorThe writeTagClassAccessors refactor now supports Effect.Tag classes in addition to Effect.Service and Context.Tag. This allows users to generate accessor methods for services created with Effect.Tag, maintaining consistency across all tag-based service patterns.
- #375
74696fdThanks @mattiamanzati! - FixresolveModulePatternto use fallback mechanism for package scope resolution when primary method is unavailable
-
#374
9d66c1eThanks @mattiamanzati! - Fix Mermaid graph generation for layers with generic typesProperly escape angle brackets (
<and>) in Mermaid diagrams to prevent rendering issues when displaying layer names containing generic type parameters. -
#370
0e25fbcThanks @mattiamanzati! - Layer Magic refactor now shows previously provided layers as a comment in the generated type annotation.When using the Layer Magic "Prepare for reuse" refactor, layers that were already provided at the location are now shown as a trailing comment (e.g.,
/* Foo | Bar */) next to the newly introduced layer types. This helps developers understand which layers were already available and which ones are being newly introduced. -
#372
172363cThanks @mattiamanzati! - Add general support for Effect.Tag in various diagnostics/refactors
- #368
01f62a9Thanks @mattiamanzati! - Fix logic of firstChild with patching mode
-
#365
3b418c5Thanks @mattiamanzati! - Add Layer Magic refactor for automatic layer composition and buildingThis refactor allows you to automatically compose and build layers based on service dependencies. It helps simplify complex layer constructions by:
- Analyzing service dependencies
- Automatically composing layers in the correct order
- Building final layer structures with proper dependency resolution
Example: When working with services that have dependencies, the refactor can transform your layer setup code into a properly composed layer structure that respects all service requirements.
- #367
0e6034bThanks @mattiamanzati! - Add shebang to CLI entry point for proper executable support and bump version
-
#361
3834abeThanks @mattiamanzati! - Add to patching mode support to storing metadata such as relation error locations and types to improve perf -
#363
8fb54a9Thanks @mattiamanzati! - Add support for importAliases config
-
#356
8c906e1Thanks @mattiamanzati! - Add helper for renames, so that triggering a rename will include the identifier of a class as well -
#360
331051dThanks @mattiamanzati! - Some minor perf improvements -
#358
03cfa73Thanks @mattiamanzati! - Refactor TypeChecker utilities to improve code organization by moving utility functions from TypeCheckerApi.ts to TypeCheckerUtils.ts -
#364
358f323Thanks @mattiamanzati! - Replace direct.textproperty access with TypeScript API helperts.idText()for getting identifier text from nodes. This is a more robust approach that properly handles escaped identifiers and follows TypeScript's recommended practices.
- #354
b4b4657Thanks @mattiamanzati! - Add LSP patch mode
-
#353
790d4d0Thanks @mattiamanzati! - Fix CLI and LSP improvements:- Remove deprecated check command from CLI
- Fix unpatch command to default to both typescript and tsc modules when no modules specified
- Add concatDiagnostics utility to prevent duplicate diagnostics in LSP
-
#351
be5d851Thanks @mattiamanzati! - Fix TypeScript module reference in patch utility to use correct module name when patching TypeScript directly -
#349
46a1ef2Thanks @mattiamanzati! - Introduce ts-patch less mode
-
#346
5a37be2Thanks @mattiamanzati! - Fix auto-import barrel-to-barrel mapping for top-level named re-exportsWhen
topLevelNamedReexportsis set to "follow", the auto-import provider now correctly maps barrel exports to their barrel modules, ensuring proper import suggestions for re-exported functions likepipefromeffect/Function.
-
#345
92ee0ffThanks @mattiamanzati! - Fix async/await to Effect.gen.tryPromise and Effect.fn.tryPromise refactors to use Data.TaggedError for error handling instead of inline objects -
#343
0570ccfThanks @mattiamanzati! - Fix async/await to Effect.fn refactor to use correct function namePreviously, the refactor would incorrectly use the function's own name instead of
Effect.fnwhen transforming async functions. This patch fixes the issue to properly generateEffect.fn("functionName")in the refactored code.
-
#339
ef70757Thanks @mattiamanzati! - Add new refactors to transform async/await functions to Effect.fn- Transform an async function definition into an Effect by using Effect.fn
- Transform an async function definition into an Effect by using Effect.fn with tagged errors for each promise call
These refactors complement the existing Effect.gen refactors by providing an alternative transformation using Effect.fn.
- #341
df65523Thanks @mattiamanzati! - Revert to previous transform logic
-
#335
81a090aThanks @mattiamanzati! - Add new diagnostic to warn when schema classes override the default constructor behaviorThe new diagnostic helps catch cases where schema classes define custom constructors that might break the expected schema behavior. Example:
import { Schema } from "effect"; class MySchema extends Schema.Class<MySchema>("MySchema")({ value: Schema.String, }) { // This will trigger a warning constructor(props: { value: string }) { super(props); } }
The diagnostic provides quickfixes to either:
- Remove the constructor
- Suppress the warning for the current line
- Suppress the warning for the entire file
-
#337
d72b1b4Thanks @mattiamanzati! - ImproveeffectGenToFnrefactor to preserve function namesThe
effectGenToFnrefactor now extracts and preserves the original function name when converting fromEffect.gentoEffect.fn. For example:// Before refactor export const programWithPipes = (fa: number, fb: number) => Eff.gen( function* () { const a = yield* Eff.succeed(fa); const b = yield* Eff.succeed(fb); return a + b; }, Eff.map((a) => a + 1) ); // After refactor (now preserves "programWithPipes" name) export const programWithPipes = Eff.fn("programWithPipes")( function* (fa: number, fb: number) { const a = yield* Eff.succeed(fa); const b = yield* Eff.succeed(fb); return a + b; }, Eff.map((a) => a + 1) );
-
#331
d862c23Thanks @mattiamanzati! - Fix diagnostics not running for all source files in transformPreviously, diagnostics were only running on the current file being transformed instead of all root files in the TypeScript program. This could cause some diagnostics to be missed during compilation.
Also updated README with important notes about ts-patch limitations:
- Effect diagnostics in watch mode with noEmit enabled are not supported
- Incremental builds may require a full rebuild after enabling ts-patch to invalidate the previous diagnostics cache
-
#328
e25a3f9Thanks @mattiamanzati! - feat: add inlay hints for Effect.gen-like middleware functionsImproved inlay hints for Effect.gen-like middleware functions to reduce visual clutter by omitting redundant type annotations that TypeScript already provides.
-
#327
52de365Thanks @mattiamanzati! - Add support for inlay hints in Effect.gen-like middleware functionsThis feature provides TypeScript inlay hints for generator functions used with Effect.gen, Effect.fn.gen, and Effect.fn.untraced.gen. When enabled, it shows the inferred return type directly in the editor, making it easier to understand the types without hovering over the function.
Example:
const myEffect = Effect.gen(function* () /* : Effect<number> */ { yield* Effect.succeed(42); });
-
#325
cbea35aThanks @mattiamanzati! - AddquickinfoEffectParametersconfiguration option to control when Effect type parameters are displayed in quickinfoThis new option allows users to configure when Effect type parameters are shown in hover information:
"always": Always show type parameters"never": Never show type parameters"whenTruncated"(default): Only show when TypeScript truncates the type display
Example configuration:
{ "effectLanguageService": { "quickinfoEffectParameters": "whenTruncated" } }
-
#323
b584cdeThanks @mattiamanzati! - Added support fortopLevelNamedReexportsconfiguration option to control how top-level named re-exports are handled when usingnamespaceImportPackages."ignore"(default): Named re-exports likeimport { pipe } from "effect"are left as-is"follow": Named re-exports are rewritten to their original module, e.g.,import { pipe } from "effect/Function"
This allows users to have more control over their import style preferences when using namespace imports.
-
#321
022956aThanks @mattiamanzati! - Improve diagnostic message for missingReturnYieldStar to better explain why return yield* is recommended for Effects that never succeed -
#324
8271284Thanks @mattiamanzati! - Improve floating effect diagnostic message to specify the actual type being flagged. When detecting floating Stream or other Effect subtypes, the error message now shows "Effect-able Stream<...>" instead of just "Effect", making it clearer what type needs to be handled.
-
#318
9928704Thanks @mattiamanzati! - Improve missing Effect service dependency diagnostic- Enhanced TypeParser to better handle service dependencies detection
- Fixed ValidService5 example in test files to properly demonstrate valid service usage
- Updated test snapshots to reflect the corrected behavior
-
#317
a5810a7Thanks @mattiamanzati! - Avoid adding comment for layers with no deps requires no provides -
#314
2aaa6e1Thanks @mattiamanzati! - Update development workflow documentation in CLAUDE.md and fix pr-ai script command
-
#312
5d4f5c6Thanks @mattiamanzati! - Add missingEffectServiceDependency diagnosticThis diagnostic warns when an
Effect.Servicedeclaration has missing service dependencies. It checks if all services used within the service's effect are properly declared in the dependencies array.Example:
// This will show a warning because SampleService1 is used but not declared in dependencies export class InvalidService extends Effect.Service<InvalidService>()( "InvalidService", { effect: Effect.gen(function* () { const sampleService1 = yield* SampleService1; return { constant: Effect.succeed(sampleService1.value), }; }), // Missing: dependencies: [SampleService1.Default] } ) {}
-
#311
f2dc3c4Thanks @mattiamanzati! - AddunsupportedServiceAccessorsdiagnostic that warns when usingEffect.Servicewithaccessors: truebut methods have generics or multiple signatures -
#309
949d5ebThanks @mattiamanzati! - AddclassSelfMismatchdiagnostic ruleThis new diagnostic rule checks that the Self type parameter in Effect.Service, Context.Tag, and Schema classes matches the actual class name.
Example:
// ❌ Error: Self type parameter should be 'MyService' class MyService extends Effect.Service<WrongName>()("MyService", { succeed: { value: 1 }, }) {} // ✅ Correct class MyService extends Effect.Service<MyService>()("MyService", { succeed: { value: 1 }, }) {}
The diagnostic includes a quick fix to automatically correct the mismatch.
-
#306
7f3faccThanks @mattiamanzati! - Extract TypeScript utilities into a dedicated TypeScriptUtils moduleThis refactoring improves code organization by consolidating TypeScript-related utilities into a separate
TypeScriptUtilsmodule. The changes include:- Created new
src/core/TypeScriptUtils.tsmodule containing all TypeScript utility functions - Removed the old
src/core/AST.tsfile which contained scattered utilities - Updated all imports across the codebase to use the new module structure
- Improved type safety and consistency in TypeScript API interactions
- Enhanced modularity by using the Nano dependency injection pattern
This change maintains backward compatibility while providing better separation of concerns and easier maintenance of TypeScript-related functionality.
- Created new
-
#308
e649978Thanks @mattiamanzati! - Add codegen functionality including:- New completion provider for Effect codegens via comments
- New diagnostic for outdated Effect codegen with quickfixes
- Improved tag class accessors refactor with better formatting
- Enhanced TypeScript utilities and type parsing capabilities
-
#303
e603a89Thanks @mattiamanzati! - Refactor AutoImport provider and add sortText support -
#304
5885afeThanks @mattiamanzati! - Add middleware for auto-import quickfixes- Extracted auto-import logic into a reusable
AutoImportcore module - Refactored existing middleware auto-import completion to use the new shared
AutoImportprovider - This enables consistent auto-import behavior across both completions and quickfixes
- Extracted auto-import logic into a reusable
-
#301
d6b36f8Thanks @mattiamanzati! - Update message for multiple Effect.provide diagnostic
- #299
03e69b5Thanks @mattiamanzati! - Warn about subsequent Effect.provide
- #297
df95896Thanks @mattiamanzati! - add Implement Service accessors refactor
- #291
ec52012Thanks @mattiamanzati! - Refactor auto-imports to support multiple entrypoints
- #289
0f98a54Thanks @mattiamanzati! - Ensure that diagnostics are collected before codefixes
- #287
aae4cabThanks @mattiamanzati! - Move codefixes registration hack into init phase
-
#284
0d9842bThanks @mattiamanzati! - Fix make schema opaque for non-object and non-union schemas -
#282
3a3bedfThanks @mattiamanzati! - Skip entirely execution of disabled rules -
#285
c4ac535Thanks @mattiamanzati! - Add autocompletion for Schema.brand
- #280
fe779e2Thanks @mattiamanzati! - Add strict boolean expressions rule
-
#278
b7f5580Thanks @mattiamanzati! - Add warning for unnecessary pipe chains -
#276
133c88eThanks @mattiamanzati! - Add refactor to toggle pipe style
- #274
82b79e6Thanks @mattiamanzati! - Allow scope to be a leaking service
-
#271
010498cThanks @mattiamanzati! - Warn on usage of try/catch insideEffect.gen -
#266
e416045Thanks @mattiamanzati! - Rule that warns about effect's inside the void channel
- #270
441123eThanks @mattiamanzati! - Add completions suggestions for DurationInput values
- #262
401701fThanks @mattiamanzati! - Use pako for mermaid url generation
- #259
77b25aeThanks @mattiamanzati! - Add rule that reports Layer with scope
- #257
d875f85Thanks @mattiamanzati! - Add quickfixes to missingEffectError to implement catchAll or catchTags based on the missing errors context
- #254
3f9c0c0Thanks @mattiamanzati! - Fix codefix importFromBarrel when alias involved
- #251
19dcecfThanks @mattiamanzati! - Allow wildcard * at end of ImportPackages settings to match all packages starting with a prefix
- #247
b7abbdfThanks @mattiamanzati! - Add exclusion rules for barrel style so pipe will be imported from "effect" instead of "effect/Function"
- #245
dca2e6fThanks @mattiamanzati! - Allow throw as way to break gen control flow
- #242
df1e16bThanks @mattiamanzati! - Fix barrelImportPackages duplicate imports
- #239
712a52fThanks @mattiamanzati! - Add support for barrel imports suggestions
- #237
40f2c7cThanks @mattiamanzati! - Delay completions computations to completionEntryDetails where possible
- #235
0888757Thanks @mattiamanzati! - Add auto-completion for effect directives
-
#234
6183db0Thanks @mattiamanzati! - Micro perf opt -
#232
fc603bdThanks @mattiamanzati! - Perf: skip checking missing services/context for the same type
- #231
c31ab93Thanks @mattiamanzati! - Add ability to prefer namespace imports for a package
- #229
d2b6b31Thanks @mattiamanzati! - Move default diagnostic severity to rule definition
- #227
0f2a403Thanks @mattiamanzati! - Enable Effect Type Parameters also for returned effects with truncated signatures
- #225
b22cc2cThanks @mattiamanzati! - Improve diagnostics phrasing and link to docs
- #222
f7e9f2cThanks @mattiamanzati! - Fix symbol access on some nodes
-
#219
346a556Thanks @mattiamanzati! - Switch to emit style for internal diagnostics -
#221
85def8bThanks @mattiamanzati! - Trigger returnEffectInGen only for strict effect type
-
#218
5243677Thanks @mattiamanzati! - Add diagnostic when missing yield* in return Effect -
#215
207d06bThanks @mattiamanzati! - Warn about definitions of generic services
-
#213
3487467Thanks @mattiamanzati! - Improve message for return yield* diagnostic -
#211
c52cd0eThanks @mattiamanzati! - Add documentation for usage with SvelteKit LSP -
#214
27a0d41Thanks @mattiamanzati! - Add found at path in duplicate check
- #209
eea3e8fThanks @mattiamanzati! - Add starting log
-
#207
7b7906aThanks @mattiamanzati! - Diagnostic to report unnecessary pipe calls -
#205
4e921b5Thanks @mattiamanzati! - Allow to change diagnostic severity inside the LSP options
- #199
5e037ecThanks @mattiamanzati! - Add leaking requirements diagnostic
-
#200
045c70dThanks @mattiamanzati! - Make TypeParser a first class service -
#196
ea894afThanks @mattiamanzati! - Add option to disable goto functionalities -
#194
5e58b25Thanks @mattiamanzati! - Add aggressive caching on type parsers
-
#191
3cf789bThanks @mattiamanzati! - Fix parenthesized type handling -
#193
09b19f9Thanks @mattiamanzati! - Handle special pattern of (typeof A)[keyof typeof A]
-
#188
e04578eThanks @mattiamanzati! - Add error when yield* with never-completing effect is not returned -
#190
f3a1e25Thanks @mattiamanzati! - Add completions for Rpc.make while declaring classes -
#189
9c1b0d2Thanks @mattiamanzati! - Allow goto definition to Jump to Rpc definition object
- #186
cdfff27Thanks @mattiamanzati! - Unify pipe parsing
- #182
e3f52a6Thanks @mattiamanzati! - Add quickinfo for Layers
-
#179
a170bfcThanks @mattiamanzati! - Handle unnecessary Effect.gen even when yielded expression is not returnedexport const shouldRaiseForSingle = Effect.gen(function* () { yield* Effect.succeed(42); }); // ^- this will become Effect.asVoid(Effect.succeed(42)) export const shouldRaiseForSingleReturnVoid = Effect.gen(function* () { yield* Effect.void; }); // ^- this will become Effect.void
- #177
9d2ee02Thanks @mattiamanzati! - Check duplicated package for any that has peer dependency on Effect
-
#178
9baf025Thanks @mattiamanzati! - Avoid multiple LSP patching -
#176
f9fca38Thanks @mattiamanzati! - Fix false positive of logical assignments closes #166 -
#168
5e9e7c9Thanks @mattiamanzati! - Remove fixed effect/ from all rules and refactors, improve testing setup -
#170
a492078Thanks @mattiamanzati! - Add disable next line feature -
#171
93db3dbThanks @mattiamanzati! - Update setup to auto-format example files -
#174
824b249Thanks @mattiamanzati! - Add Pool as effect subtype allowed to be floating -
#173
74e6fcdThanks @mattiamanzati! - Fix false positive with yield* and function declaration -
#175
4bb23a0Thanks @mattiamanzati! - Better whitespace handling while inserting disable next line comments
- #163
5f0ac85Thanks @mattiamanzati! - Add support for Effect.fn completions
- #160
a1114b4Thanks @mattiamanzati! - Add .gen(function*(){}) autocompletion
- #158
2a46a72Thanks @mattiamanzati! - In type to effect schema, follow top level typeof nodes
- #155
94eb402Thanks @mattiamanzati! - Fix handling of nested pipes in effectGenToFn refactor
- #153
20eaf91Thanks @mattiamanzati! - Skip checking effects in type parameters initializers
- #151
242e37bThanks @mattiamanzati! - Improve arrow function handling for type inference
- #148
af83cbbThanks @mattiamanzati! - Fix ts-patch transform error while emitting info diagnostics
- #146
29559b7Thanks @mattiamanzati! - Handle generation of keyof for type to schema refactor
- #142
4922981Thanks @mattiamanzati! - Inline internal Nano ctx to improve perf
- #139
5631a87Thanks @mattiamanzati! - Add quickinfo hover for yield* statements
-
#135
cb14330Thanks @mattiamanzati! - Add missing record and intersection into type to schema refactor -
#137
3a29ddbThanks @mattiamanzati! - Use a single Schema.Literal call in unions of literals
- #133
5990d51Thanks @mattiamanzati! - Add type to schema refactor
- #128
73307e0Thanks @mattiamanzati! - Support ts-patch transformer to emit diagnostics at compile time
- #125
8fdf421Thanks @mattiamanzati! - Add a check for multiple effect versions in the same project
- #127
731e72aThanks @mattiamanzati! - Skip some nodes while evaluating expected types
- #122
b261a4bThanks @mattiamanzati! - Fix single line if blocks mismatched as unnecessary gen
- #120
bbade6bThanks @mattiamanzati! - Add refactor to make schema opaque using namespaces
- #118
8d2cb57Thanks @mattiamanzati! - Add refator to make a schema opaque
- #114
4e5f345Thanks @mattiamanzati! - Perf improvements and shrinked build
- #112
1c16eccThanks @mattiamanzati! - Perf: solve codefixes and diagnostics in a single pass and cache between them
- #110
71f84edThanks @mattiamanzati! - Allow to customize diagnostic severity by using a comment line
-
#109
c325568Thanks @mattiamanzati! - Add support for completions for Data.TaggedClass and Data.TaggedError -
#106
63cc227Thanks @wmaurer! - Fixed a bug where certain refactors were not available when the cursor was position at the start of a node
- #103
3810a5aThanks @mattiamanzati! - Add README to shipped dist
-
#100
4ca4fa2Thanks @mattiamanzati! - Optimize hot paths and introduce internal caching for expensive APIs -
#102
31f72eaThanks @mattiamanzati! - Add support for smart completions for effect classes with "Self"
- #97
bbdf5e0Thanks @mattiamanzati! - Add support for codefixes in custom diagnostics
- #93
92bbee1Thanks @mattiamanzati! - Reorganize internals, tests and add failure-recovery paths
- #96
dba85b6Thanks @mattiamanzati! - Add refactor to remove unnecessary Effect.gen definitions
- #90
63dd3e0Thanks @mattiamanzati! - Fix accidental bundle of ts in lsp
- #88
c3944ceThanks @wmaurer! - Add refactor remove-unnecessary-effect-gen. This removes unnecessaryEffect.gencalls by simplifying generator functions that only wrap a singleyield*statement returning anEffect. This refactor replaces theEffect.genwrapper with the innerEffectdirectly, making the code more concise and readable.
- #84
a6d163dThanks @mattiamanzati! - Fix useless gen severity
-
#83
6708b71Thanks @mattiamanzati! - Fix return type infer inside function overloads -
#79
106e498Thanks @mattiamanzati! - Handle refactor gen to fn in class methods -
#81
65dc94bThanks @mattiamanzati! - Always use type information to resolve Effect module name
- #76
486b171Thanks @mattiamanzati! - Add refactor to rewrite Effect.gen to Effect.fn
- #78
2c7d56bThanks @mattiamanzati! - Fix async await to effect gen with anonymous functions
- #73
3c9c1baThanks @mattiamanzati! - Avoid to bail-out type generation when imports are missing, show instead partial signature
-
#71
8d309abThanks @mattiamanzati! - Detect unnecessary usages of Effect.gen -
#68
79ce0b1Thanks @mattiamanzati! - Adds support for quickinfo for effectThey can be disabled by the LSP option "quickinfo": false.
Once you hover a truncated type, you'll see additional information about the Effect type arguments like Success, Failure and Requirements.
- #72
3a99040Thanks @mattiamanzati! - Add support for toggle type annotation in class property members
-
#66
89d6fa9Thanks @mattiamanzati! - Remove old transformer -
#67
5111a65Thanks @mattiamanzati! - Handle Effect.fn and Effect.fnUntraced in missing yield star diagnostic
- #64
f8d5018Thanks @mattiamanzati! - Upgrade used TS version
-
#61
796db99Thanks @mattiamanzati! - Fix binary assignment reported as floating effect -
#63
ae973cbThanks @mattiamanzati! - Allow Exit subtype to be a floating Effect
-
#58
d5fcb9eThanks @mattiamanzati! - Allow Fiber and FiberRuntime to be floating -
#60
bf12970Thanks @mattiamanzati! - Additional notice for misused yield instead of yield* in generators
-
#54
19e5a77Thanks @mattiamanzati! - - Update internal version of effect from 2.x beta to 3.12.5- Remove adapter from gen refactors
-
#56
5b2b27cThanks @mattiamanzati! - Add support for Effect diagnosticsWith this release of the language service plugin, we aim to improve the overall Effect experience by providing additional diagnostics that tries to fix misleading or hard to read TypeScript errors.
All of the diagnostics provided by the language service are available only in editor-mode, that means that they won't show up when using tsc.
Diagnostics are enabled by default, but you can opt-out of them by changing the language service configuration and provide diagnostics: false.
{ "plugins": [ { "name": "@effect/language-service", "diagnostics": false } ] }Please report any false positive or missing diagnostic you encounter over the Github repository.
Additionally to the standard TypeScript error that may be cryptic at first:
Argument of type 'Effect<number, never, ServiceB | ServiceA | ServiceC>' is not assignable to parameter of type 'Effect<number, never, ServiceB | ServiceA>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties. Type 'ServiceB | ServiceA | ServiceC' is not assignable to type 'ServiceB | ServiceA'. Type 'ServiceC' is not assignable to type 'ServiceB | ServiceA'. Type 'ServiceC' is not assignable to type 'ServiceA'. Types of property 'a' are incompatible. Type '3' is not assignable to type '1'.ts(2379)you'll now receive an additional error:
Missing 'ServiceC' in the expected Effect context.In some situation you may not receive any compile error at all, but that's because you may have forgot to yield your effects inside gen!
Floating Effects that are not assigned to a variable will be reported into the Effect diagnostics.
Effect.runPromise( Effect.gen(function* () { Effect.sync(() => console.log("Hello!")); // ^- Effect must be yielded or assigned to a variable. }) );
Similarly, yield instead of yield* won't result in a type error by itself, but is not the intended usage.
This yield will be reported in the effect diagnostics.
Effect.runPromise( Effect.gen(function* () { yield Effect.sync(() => console.log("Hello!")); // ^- When yielding Effects inside Effect.gen, you should use yield* instead of yield. }) );
- #50
f3ff991Thanks @mattiamanzati! - Dedupe identical JSDoc tags in hover quickinfo
-
#48
9bb0011Thanks @wmaurer! - Improve Effect imports to work with current effect npm package -
#48
9bb0011Thanks @wmaurer! - Modernise build setup. Fix asyncWaitToGen problem for TS5. Refactor asyncWaitToGen to work with current Effect API. Add config optionpreferredEffectGenAdapterName.
- #45
7edd368Thanks @mattiamanzati! - Remove dependencies on /data and /io
- #43
42a032cThanks @mattiamanzati! - Add toggle lazy const initializer
- #41
282adf4Thanks @mattiamanzati! - Improve handling of non-datafirst in pipeable-to-datafirst rewrite
- #39
c505074Thanks @mattiamanzati! - Add refactor to rewrite as datafirst
- #37
e632c54Thanks @mattiamanzati! - Fix simplify behaviour with intersections of callables
- #35
7fa9273Thanks @mattiamanzati! - Make more human readable function type intersections
- #31
ddb5b66Thanks @mattiamanzati! - Add kind to each refactor definition
- #29
adc3745Thanks @mattiamanzati! - Remove useless pipe-related refactors (rewrite to pipe and remove pipe)
- #27
c0636e1Thanks @mattiamanzati! - Removed diagnostics and moved them into @effect/eslint-plugin
- #25
7495554Thanks @mattiamanzati! - Remove @effect/io dependency
- #23
535a2f1Thanks @mikearnaldi! - Update dependencies and improve semver ranges
- #21
8eefaf7Thanks @mikearnaldi! - Fix transformer infinite loop
- #19
eced128Thanks @mikearnaldi! - Update deps
- #17
69a0ab1Thanks @mattiamanzati! - Begin eslint plugins
- #15
4eedac0Thanks @mattiamanzati! - Move to effect/io
- #13
d894956Thanks @mikearnaldi! - Support functions and function expressions in debug
- #11
f00ed7bThanks @mikearnaldi! - Add debug extension in transformer
- #9
d11e191Thanks @mikearnaldi! - Update dependencies
-
#8
c68d7f6Thanks @mikearnaldi! - Add transformer -
#6
0812ab0Thanks @mattiamanzati! - Add refactor to handle no-sync-with-constants diagnostic
- #4
a7c6718Thanks @mattiamanzati! - Add refactor wrapWithPipe, which adds pipe() around the selected text
- #2
8915f80Thanks @mattiamanzati! - Fixed type annotation removal in both toggle return type and toggle type annotation
{ "diagnosticSeverity": { "deterministicKeys": "error" }, "keyPatterns": [ { "target": "service", "pattern": "default", "skipLeadingPath": ["src/"] } ] }