Repository navigation
v0.65.0
Minor Changes
-
#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 -->
Patch Changes
-
#580
a45606bThanks @mattiamanzati! - AddEffect.fnandEffect.fnUntracedsupport to the piping flows parser.The piping flows parser now recognizes pipe transformations passed as additional arguments to
Effect.fn,Effect.fn("traced"), andEffect.fnUntraced. This enables diagnostics likecatchAllToMapError,catchUnfailableEffect, andmultipleEffectProvideto work with these patterns.Example:
// 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.,