Repository navigation
v0.63.0
Minor Changes
-
#548
ef8c2deThanks @mattiamanzati! - AddglobalErrorInEffectFailurediagnosticThis diagnostic warns when
Effect.failis called with the globalErrortype. Using the globalErrortype in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error types.Instead, the diagnostic recommends using:
- 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
Patch Changes
-
#547
9058a37Thanks @mattiamanzati! - refactor: simplifyunnecessaryFailYieldableErrordiagnostic implementationChanged the implementation to check if a type extends
Cause.YieldableErroron-demand rather than fetching all yieldable error types upfront. -
#549
039f4b2Thanks @mattiamanzati! - AddgetTypeAtLocationutility toTypeCheckerUtilsThis refactoring adds a new
getTypeAtLocationfunction toTypeCheckerUtilsthat safely retrieves types while filtering out JSX-specific nodes (JSX elements, opening/closing tags, and JSX attributes) that could cause issues when callingtypeChecker.getTypeAtLocation.The utility is now used across multiple diagnostics and features, reducing code duplication and ensuring consistent handling of edge cases:
anyUnknownInErrorContextcatchUnfailableEffectfloatingEffectglobalErrorInEffectFailureleakingRequirementsmissedPipeableOpportunitymissingEffectServiceDependencymissingReturnYieldStarmultipleEffectProvidenonObjectEffectServiceTypeoverriddenSchemaConstructorreturnEffectInGenscopeInLayerEffectstrictBooleanExpressionsstrictEffectProvideunnecessaryFailYieldableError- And other features like quick info, goto definition, and refactors