├── .changeset └── config.json ├── .envrc ├── .github ├── FUNDING.yml ├── actions │ └── setup │ │ └── action.yml └── workflows │ ├── build.yml │ ├── check.yml │ └── test.yml ├── .gitignore ├── .madgerc ├── .specs ├── diagnostics-implementation.md ├── diagnostics-testing-plan.md ├── nano-api.md └── nano-patterns.md ├── .vscode ├── launch.json └── settings.json ├── CHANGELOG.md ├── CLAUDE.md ├── LICENSE ├── README.md ├── eslint.config.mjs ├── examples ├── completions │ ├── contextSelfInClasses.ts │ ├── contextSelfInClasses_identifierKey.ts │ ├── durationInput.ts │ ├── durationInput_props.ts │ ├── effectCodegensComment.ts │ ├── effectDataClasses.ts │ ├── effectDiagnosticsComment.ts │ ├── effectJsdocComment.ts │ ├── effectSchemaSelfInClasses_dotToken.ts │ ├── effectSchemaSelfInClasses_tagg.ts │ ├── effectSelfInClasses.ts │ ├── fnFunctionStar.ts │ ├── genFunctionStar.ts │ ├── rpcMakeClasses.ts │ └── schemaBrand.ts ├── diagnostics │ ├── catchUnfailableEffect.ts │ ├── catchUnfailableEffect_variants.ts │ ├── classSelfMismatch.ts │ ├── classSelfMismatch_contextTag.ts │ ├── classSelfMismatch_effectTag.ts │ ├── classSelfMismatch_schema.ts │ ├── classSelfMismatch_schemaFalsePositive.ts │ ├── classSelfMismatch_unionGiven.ts │ ├── deterministicKeys.ts │ ├── deterministicKeys_custom.ts │ ├── deterministicKeys_defaultHashed.ts │ ├── deterministicKeys_packageIdentifier.ts │ ├── duplicatePackage.ts │ ├── effectGenUsesAdapter.ts │ ├── effectInVoidSuccess.ts │ ├── floatingEffect.ts │ ├── floatingEffect_disableNextLine.ts │ ├── floatingEffect_disableNextLineFix.ts │ ├── floatingEffect_disabled.ts │ ├── floatingEffect_logicalAssignments.ts │ ├── floatingEffect_poolSubtype.ts │ ├── floatingEffect_stream.ts │ ├── genericEffectServices.ts │ ├── importFromBarrel.ts │ ├── leakingRequirements.ts │ ├── leakingRequirements_genericTag.ts │ ├── leakingRequirements_heuristic.ts │ ├── leakingRequirements_leakableJsDoc.ts │ ├── leakingRequirements_noScope.ts │ ├── missedPipeableOpportunity.ts │ ├── missingEffectContext_arrowReturnType.ts │ ├── missingEffectContext_callExpression.ts │ ├── missingEffectContext_conciseBody.ts │ ├── missingEffectContext_lazy.ts │ ├── missingEffectContext_pipe.ts │ ├── missingEffectContext_plainAssignment.ts │ ├── missingEffectContext_returnSignature.ts │ ├── missingEffectContext_skipArrowDefaults.ts │ ├── missingEffectError_callExpression.ts │ ├── missingEffectError_plainAssignment.ts │ ├── missingEffectError_returnSignature.ts │ ├── missingEffectError_tagged.ts │ ├── missingEffectServiceDependency.ts │ ├── missingReturnYieldStar.ts │ ├── missingStarInYieldEffectGen.ts │ ├── missingStarInYieldEffectGen_nested.ts │ ├── multipleEffectProvide.ts │ ├── nonObjectEffectServiceType.ts │ ├── outdatedEffectCodegen.ts │ ├── overriddenSchemaConstructor.ts │ ├── overriddenSchemaConstructor_static.ts │ ├── returnEffectInGen_noDiagnostics.ts │ ├── returnEffectInGen_warn.ts │ ├── scopeInLayerEffect.ts │ ├── strictBooleanExpressions.ts │ ├── strictEffectProvide.ts │ ├── tryCatchInEffectGen.ts │ ├── tryCatchInEffectGen_finally.ts │ ├── unnecessaryEffectGen.ts │ ├── unnecessaryEffectGen_ifBlock.ts │ ├── unnecessaryEffectGen_noReturn.ts │ ├── unnecessaryPipe.ts │ ├── unnecessaryPipeChain.ts │ ├── unsupportedServiceAccessors.ts │ ├── unsupportedServiceAccessors_effectTag.ts │ ├── unsupportedServiceAccessors_primitive.ts │ └── utils.ts ├── goto │ ├── rpc.ts │ └── rpc_defs.ts ├── inlays │ └── effectGenLike.ts ├── layer-graph │ ├── duplicated.ts │ ├── effect.ts │ ├── followSymbols.ts │ ├── generics.ts │ ├── incorrectInference.ts │ ├── multiple.ts │ ├── simple.ts │ └── specialChars.ts ├── quickinfo │ ├── effectDisplayParts.ts │ ├── effectGen.ts │ ├── layerInfo.ts │ └── layerInfo_generics.ts ├── refactors │ ├── asyncAwaitToFn.ts │ ├── asyncAwaitToFnTryPromise.ts │ ├── asyncAwaitToFn_fetch.ts │ ├── asyncAwaitToFn_generics.ts │ ├── asyncAwaitToGen.ts │ ├── asyncAwaitToGenTryPromise.ts │ ├── asyncAwaitToGenTryPromise_anonymous.ts │ ├── asyncAwaitToGen_anonymous.ts │ ├── asyncAwaitToGen_namedImport.ts │ ├── effectGenToFn.ts │ ├── effectGenToFn_classMethod.ts │ ├── effectGenToFn_mixedPipes.ts │ ├── effectGenToFn_withPipes.ts │ ├── functionToArrow.ts │ ├── layerMagic_build.ts │ ├── layerMagic_prepare.ts │ ├── layerMagic_prepareReuse.ts │ ├── makeSchemaOpaque.ts │ ├── makeSchemaOpaqueWithNs_shortImport.ts │ ├── makeSchemaOpaque_brand.ts │ ├── makeSchemaOpaque_shortImport.ts │ ├── makeSchemaOpaque_shortImportAlias.ts │ ├── makeSchemaOpaque_union.ts │ ├── pipeableToDatafirst.ts │ ├── removeCurryArrow.ts │ ├── removeUnnecessaryEffectGen.ts │ ├── toggleLazyConst.ts │ ├── togglePipeStyle.ts │ ├── toggleReturnTypeAnnotation.ts │ ├── toggleTypeAnnotation.ts │ ├── toggleTypeAnnotation_schema.ts │ ├── toggleTypeAnnotation_simplify.ts │ ├── typeToEffectSchema.ts │ ├── typeToEffectSchemaClass.ts │ ├── typeToEffectSchema_conditionalType.ts │ ├── typeToEffectSchema_dataTypes.ts │ ├── typeToEffectSchema_indexSignature.ts │ ├── typeToEffectSchema_literal.ts │ ├── typeToEffectSchema_noGenerics.ts │ ├── typeToEffectSchema_typeAlias.ts │ ├── typeToEffectSchema_typeOf.ts │ ├── typeToEffectSchema_typeofKeyof.ts │ ├── wrapWithEffectGen.ts │ ├── wrapWithEffectGen_noclass.ts │ ├── wrapWithPipe.ts │ └── writeTagClassAccessors.ts └── renames │ ├── keyStrings.ts │ ├── keyStrings_contextTag.ts │ ├── keyStrings_dataTaggedClass.ts │ ├── keyStrings_dataTaggedError.ts │ ├── keyStrings_effectService.ts │ ├── keyStrings_effectTag.ts │ ├── keyStrings_taggedClass.ts │ ├── keyStrings_taggedError.ts │ └── keyStrings_taggedRequest.ts ├── flake.lock ├── flake.nix ├── package.json ├── pnpm-lock.yaml ├── src ├── cli.ts ├── cli │ ├── check.ts │ ├── diagnostics.ts │ ├── patch.ts │ ├── unpatch.ts │ └── utils.ts ├── codegens.ts ├── codegens │ └── accessors.ts ├── completions.ts ├── completions │ ├── contextSelfInClasses.ts │ ├── durationInput.ts │ ├── effectCodegensComment.ts │ ├── effectDataClasses.ts │ ├── effectDiagnosticsComment.ts │ ├── effectJsdocComment.ts │ ├── effectSchemaSelfInClasses.ts │ ├── effectSelfInClasses.ts │ ├── fnFunctionStar.ts │ ├── genFunctionStar.ts │ ├── middlewareAutoImports.ts │ ├── rpcMakeClasses.ts │ └── schemaBrand.ts ├── core │ ├── AutoImport.ts │ ├── KeyBuilder.ts │ ├── LSP.ts │ ├── LanguageServicePluginOptions.ts │ ├── LayerGraph.ts │ ├── Nano.ts │ ├── TypeCheckerApi.ts │ ├── TypeCheckerUtils.ts │ ├── TypeParser.ts │ ├── TypeScriptApi.ts │ └── TypeScriptUtils.ts ├── diagnostics.ts ├── diagnostics │ ├── catchUnfailableEffect.ts │ ├── classSelfMismatch.ts │ ├── deterministicKeys.ts │ ├── duplicatePackage.ts │ ├── effectGenUsesAdapter.ts │ ├── effectInVoidSuccess.ts │ ├── floatingEffect.ts │ ├── genericEffectServices.ts │ ├── importFromBarrel.ts │ ├── leakingRequirements.ts │ ├── middlewareAutoImportQuickfixes.ts │ ├── missedPipeableOpportunity.ts │ ├── missingEffectContext.ts │ ├── missingEffectError.ts │ ├── missingEffectServiceDependency.ts │ ├── missingReturnYieldStar.ts │ ├── missingStarInYieldEffectGen.ts │ ├── multipleEffectProvide.ts │ ├── nonObjectEffectServiceType.ts │ ├── outdatedEffectCodegen.ts │ ├── overriddenSchemaConstructor.ts │ ├── returnEffectInGen.ts │ ├── scopeInLayerEffect.ts │ ├── strictBooleanExpressions.ts │ ├── strictEffectProvide.ts │ ├── tryCatchInEffectGen.ts │ ├── unnecessaryEffectGen.ts │ ├── unnecessaryPipe.ts │ ├── unnecessaryPipeChain.ts │ └── unsupportedServiceAccessors.ts ├── effect-lsp-patch-utils.ts ├── goto.ts ├── goto │ └── effectRpcDefinition.ts ├── index.ts ├── inlays │ └── middlewareGenLike.ts ├── quickinfo.ts ├── quickinfo │ ├── dedupeJsDocs.ts │ ├── effectTypeArgs.ts │ └── layerInfo.ts ├── refactors.ts ├── refactors │ ├── asyncAwaitToFn.ts │ ├── asyncAwaitToFnTryPromise.ts │ ├── asyncAwaitToGen.ts │ ├── asyncAwaitToGenTryPromise.ts │ ├── effectGenToFn.ts │ ├── functionToArrow.ts │ ├── layerMagic.ts │ ├── makeSchemaOpaque.ts │ ├── makeSchemaOpaqueWithNs.ts │ ├── pipeableToDatafirst.ts │ ├── removeUnnecessaryEffectGen.ts │ ├── toggleLazyConst.ts │ ├── togglePipeStyle.ts │ ├── toggleReturnTypeAnnotation.ts │ ├── toggleTypeAnnotation.ts │ ├── typeToEffectSchema.ts │ ├── typeToEffectSchemaClass.ts │ ├── wrapWithEffectGen.ts │ ├── wrapWithPipe.ts │ └── writeTagClassAccessors.ts ├── renames │ └── keyStrings.ts ├── transform.ts └── utils │ └── SchemaGen.ts ├── test ├── __snapshots__ │ ├── completions.test.ts.snap │ ├── diagnostics │ │ ├── catchUnfailableEffect.ts.catchUnfailableEffect_skipFile.from1067to1082.output │ │ ├── catchUnfailableEffect.ts.catchUnfailableEffect_skipFile.from147to162.output │ │ ├── catchUnfailableEffect.ts.catchUnfailableEffect_skipFile.from377to392.output │ │ ├── catchUnfailableEffect.ts.catchUnfailableEffect_skipNextLine.from1067to1082.output │ │ ├── catchUnfailableEffect.ts.catchUnfailableEffect_skipNextLine.from147to162.output │ │ ├── catchUnfailableEffect.ts.catchUnfailableEffect_skipNextLine.from377to392.output │ │ ├── catchUnfailableEffect.ts.codefixes │ │ ├── catchUnfailableEffect.ts.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipFile.from172to187.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipFile.from311to325.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipFile.from485to501.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipFile.from662to677.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipFile.from816to832.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipNextLine.from172to187.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipNextLine.from311to325.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipNextLine.from485to501.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipNextLine.from662to677.output │ │ ├── catchUnfailableEffect_variants.ts.catchUnfailableEffect_skipNextLine.from816to832.output │ │ ├── catchUnfailableEffect_variants.ts.codefixes │ │ ├── catchUnfailableEffect_variants.ts.output │ │ ├── classSelfMismatch.ts.classSelfMismatch_fix.from578to603.output │ │ ├── classSelfMismatch.ts.classSelfMismatch_skipFile.from578to603.output │ │ ├── classSelfMismatch.ts.classSelfMismatch_skipNextLine.from578to603.output │ │ ├── classSelfMismatch.ts.codefixes │ │ ├── classSelfMismatch.ts.output │ │ ├── classSelfMismatch_contextTag.ts.classSelfMismatch_fix.from543to558.output │ │ ├── classSelfMismatch_contextTag.ts.classSelfMismatch_skipFile.from543to558.output │ │ ├── classSelfMismatch_contextTag.ts.classSelfMismatch_skipNextLine.from543to558.output │ │ ├── classSelfMismatch_contextTag.ts.codefixes │ │ ├── classSelfMismatch_contextTag.ts.output │ │ ├── classSelfMismatch_effectTag.ts.classSelfMismatch_fix.from539to554.output │ │ ├── classSelfMismatch_effectTag.ts.classSelfMismatch_skipFile.from539to554.output │ │ ├── classSelfMismatch_effectTag.ts.classSelfMismatch_skipNextLine.from539to554.output │ │ ├── classSelfMismatch_effectTag.ts.codefixes │ │ ├── classSelfMismatch_effectTag.ts.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_fix.from1423to1445.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_fix.from2030to2054.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_fix.from387to403.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_fix.from883to905.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipFile.from1423to1445.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipFile.from2030to2054.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipFile.from387to403.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipFile.from883to905.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipNextLine.from1423to1445.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipNextLine.from2030to2054.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipNextLine.from387to403.output │ │ ├── classSelfMismatch_schema.ts.classSelfMismatch_skipNextLine.from883to905.output │ │ ├── classSelfMismatch_schema.ts.codefixes │ │ ├── classSelfMismatch_schema.ts.output │ │ ├── classSelfMismatch_schemaFalsePositive.ts.codefixes │ │ ├── classSelfMismatch_schemaFalsePositive.ts.output │ │ ├── classSelfMismatch_unionGiven.ts.classSelfMismatch_fix.from229to253.output │ │ ├── classSelfMismatch_unionGiven.ts.classSelfMismatch_skipFile.from229to253.output │ │ ├── classSelfMismatch_unionGiven.ts.classSelfMismatch_skipNextLine.from229to253.output │ │ ├── classSelfMismatch_unionGiven.ts.codefixes │ │ ├── classSelfMismatch_unionGiven.ts.output │ │ ├── deterministicKeys.ts.codefixes │ │ ├── deterministicKeys.ts.deterministicKeys_fix.from317to344.output │ │ ├── deterministicKeys.ts.deterministicKeys_fix.from428to436.output │ │ ├── deterministicKeys.ts.deterministicKeys_skipFile.from317to344.output │ │ ├── deterministicKeys.ts.deterministicKeys_skipFile.from428to436.output │ │ ├── deterministicKeys.ts.deterministicKeys_skipNextLine.from317to344.output │ │ ├── deterministicKeys.ts.deterministicKeys_skipNextLine.from428to436.output │ │ ├── deterministicKeys.ts.output │ │ ├── deterministicKeys_custom.ts.codefixes │ │ ├── deterministicKeys_custom.ts.deterministicKeys_fix.from388to395.output │ │ ├── deterministicKeys_custom.ts.deterministicKeys_fix.from530to542.output │ │ ├── deterministicKeys_custom.ts.deterministicKeys_skipFile.from388to395.output │ │ ├── deterministicKeys_custom.ts.deterministicKeys_skipFile.from530to542.output │ │ ├── deterministicKeys_custom.ts.deterministicKeys_skipNextLine.from388to395.output │ │ ├── deterministicKeys_custom.ts.deterministicKeys_skipNextLine.from530to542.output │ │ ├── deterministicKeys_custom.ts.output │ │ ├── deterministicKeys_defaultHashed.ts.codefixes │ │ ├── deterministicKeys_defaultHashed.ts.deterministicKeys_fix.from331to358.output │ │ ├── deterministicKeys_defaultHashed.ts.deterministicKeys_fix.from442to450.output │ │ ├── deterministicKeys_defaultHashed.ts.deterministicKeys_skipFile.from331to358.output │ │ ├── deterministicKeys_defaultHashed.ts.deterministicKeys_skipFile.from442to450.output │ │ ├── deterministicKeys_defaultHashed.ts.deterministicKeys_skipNextLine.from331to358.output │ │ ├── deterministicKeys_defaultHashed.ts.deterministicKeys_skipNextLine.from442to450.output │ │ ├── deterministicKeys_defaultHashed.ts.output │ │ ├── deterministicKeys_packageIdentifier.ts.codefixes │ │ ├── deterministicKeys_packageIdentifier.ts.deterministicKeys_fix.from339to366.output │ │ ├── deterministicKeys_packageIdentifier.ts.deterministicKeys_fix.from450to458.output │ │ ├── deterministicKeys_packageIdentifier.ts.deterministicKeys_skipFile.from339to366.output │ │ ├── deterministicKeys_packageIdentifier.ts.deterministicKeys_skipFile.from450to458.output │ │ ├── deterministicKeys_packageIdentifier.ts.deterministicKeys_skipNextLine.from339to366.output │ │ ├── deterministicKeys_packageIdentifier.ts.deterministicKeys_skipNextLine.from450to458.output │ │ ├── deterministicKeys_packageIdentifier.ts.output │ │ ├── duplicatePackage.ts.codefixes │ │ ├── duplicatePackage.ts.output │ │ ├── effectGenUsesAdapter.ts.codefixes │ │ ├── effectGenUsesAdapter.ts.effectGenUsesAdapter_skipFile.from232to233.output │ │ ├── effectGenUsesAdapter.ts.effectGenUsesAdapter_skipNextLine.from232to233.output │ │ ├── effectGenUsesAdapter.ts.output │ │ ├── effectInVoidSuccess.ts.codefixes │ │ ├── effectInVoidSuccess.ts.effectInVoidSuccess_skipFile.from241to428.output │ │ ├── effectInVoidSuccess.ts.effectInVoidSuccess_skipFile.from94to106.output │ │ ├── effectInVoidSuccess.ts.effectInVoidSuccess_skipNextLine.from241to428.output │ │ ├── effectInVoidSuccess.ts.effectInVoidSuccess_skipNextLine.from94to106.output │ │ ├── effectInVoidSuccess.ts.output │ │ ├── floatingEffect.ts.codefixes │ │ ├── floatingEffect.ts.floatingEffect_skipFile.from104to116.output │ │ ├── floatingEffect.ts.floatingEffect_skipFile.from202to214.output │ │ ├── floatingEffect.ts.floatingEffect_skipFile.from76to102.output │ │ ├── floatingEffect.ts.floatingEffect_skipNextLine.from104to116.output │ │ ├── floatingEffect.ts.floatingEffect_skipNextLine.from202to214.output │ │ ├── floatingEffect.ts.floatingEffect_skipNextLine.from76to102.output │ │ ├── floatingEffect.ts.output │ │ ├── floatingEffect_disableNextLine.ts.codefixes │ │ ├── floatingEffect_disableNextLine.ts.floatingEffect_skipFile.from137to158.output │ │ ├── floatingEffect_disableNextLine.ts.floatingEffect_skipFile.from41to61.output │ │ ├── floatingEffect_disableNextLine.ts.floatingEffect_skipNextLine.from137to158.output │ │ ├── floatingEffect_disableNextLine.ts.floatingEffect_skipNextLine.from41to61.output │ │ ├── floatingEffect_disableNextLine.ts.output │ │ ├── floatingEffect_disableNextLineFix.ts.codefixes │ │ ├── floatingEffect_disableNextLineFix.ts.floatingEffect_skipFile.from61to79.output │ │ ├── floatingEffect_disableNextLineFix.ts.floatingEffect_skipNextLine.from61to79.output │ │ ├── floatingEffect_disableNextLineFix.ts.output │ │ ├── floatingEffect_disabled.ts.codefixes │ │ ├── floatingEffect_disabled.ts.floatingEffect_skipFile.from225to242.output │ │ ├── floatingEffect_disabled.ts.floatingEffect_skipFile.from298to315.output │ │ ├── floatingEffect_disabled.ts.floatingEffect_skipFile.from91to108.output │ │ ├── floatingEffect_disabled.ts.floatingEffect_skipNextLine.from225to242.output │ │ ├── floatingEffect_disabled.ts.floatingEffect_skipNextLine.from298to315.output │ │ ├── floatingEffect_disabled.ts.floatingEffect_skipNextLine.from91to108.output │ │ ├── floatingEffect_disabled.ts.output │ │ ├── floatingEffect_logicalAssignments.ts.codefixes │ │ ├── floatingEffect_logicalAssignments.ts.output │ │ ├── floatingEffect_poolSubtype.ts.codefixes │ │ ├── floatingEffect_poolSubtype.ts.output │ │ ├── floatingEffect_stream.ts.codefixes │ │ ├── floatingEffect_stream.ts.floatingEffect_skipFile.from134to152.output │ │ ├── floatingEffect_stream.ts.floatingEffect_skipNextLine.from134to152.output │ │ ├── floatingEffect_stream.ts.output │ │ ├── genericEffectServices.ts.codefixes │ │ ├── genericEffectServices.ts.genericEffectServices_skipFile.from159to171.output │ │ ├── genericEffectServices.ts.genericEffectServices_skipNextLine.from159to171.output │ │ ├── genericEffectServices.ts.output │ │ ├── importFromBarrel.ts.codefixes │ │ ├── importFromBarrel.ts.importFromBarrel_skipFile.from55to61.output │ │ ├── importFromBarrel.ts.importFromBarrel_skipFile.from87to101.output │ │ ├── importFromBarrel.ts.importFromBarrel_skipNextLine.from55to61.output │ │ ├── importFromBarrel.ts.importFromBarrel_skipNextLine.from87to101.output │ │ ├── importFromBarrel.ts.output │ │ ├── importFromBarrel.ts.replaceWithUnbarrelledImport.from55to61.output │ │ ├── importFromBarrel.ts.replaceWithUnbarrelledImport.from87to101.output │ │ ├── leakingRequirements.ts.codefixes │ │ ├── leakingRequirements.ts.leakingRequirements_skipFile.from219to230.output │ │ ├── leakingRequirements.ts.leakingRequirements_skipFile.from572to585.output │ │ ├── leakingRequirements.ts.leakingRequirements_skipNextLine.from219to230.output │ │ ├── leakingRequirements.ts.leakingRequirements_skipNextLine.from572to585.output │ │ ├── leakingRequirements.ts.output │ │ ├── leakingRequirements_genericTag.ts.codefixes │ │ ├── leakingRequirements_genericTag.ts.leakingRequirements_skipFile.from373to425.output │ │ ├── leakingRequirements_genericTag.ts.leakingRequirements_skipNextLine.from373to425.output │ │ ├── leakingRequirements_genericTag.ts.output │ │ ├── leakingRequirements_heuristic.ts.codefixes │ │ ├── leakingRequirements_heuristic.ts.output │ │ ├── leakingRequirements_leakableJsDoc.ts.codefixes │ │ ├── leakingRequirements_leakableJsDoc.ts.output │ │ ├── leakingRequirements_noScope.ts.codefixes │ │ ├── leakingRequirements_noScope.ts.output │ │ ├── missedPipeableOpportunity.ts.codefixes │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_fix.from1076to1116.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_fix.from1297to1334.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_fix.from1606to1644.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_fix.from535to562.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_fix.from712to748.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_fix.from843to860.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipFile.from1076to1116.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipFile.from1297to1334.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipFile.from1606to1644.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipFile.from535to562.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipFile.from712to748.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipFile.from843to860.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipNextLine.from1076to1116.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipNextLine.from1297to1334.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipNextLine.from1606to1644.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipNextLine.from535to562.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipNextLine.from712to748.output │ │ ├── missedPipeableOpportunity.ts.missedPipeableOpportunity_skipNextLine.from843to860.output │ │ ├── missedPipeableOpportunity.ts.output │ │ ├── missingEffectContext_arrowReturnType.ts.codefixes │ │ ├── missingEffectContext_arrowReturnType.ts.missingEffectContext_skipFile.from703to740.output │ │ ├── missingEffectContext_arrowReturnType.ts.missingEffectContext_skipNextLine.from703to740.output │ │ ├── missingEffectContext_arrowReturnType.ts.output │ │ ├── missingEffectContext_callExpression.ts.codefixes │ │ ├── missingEffectContext_callExpression.ts.missingEffectContext_skipFile.from505to523.output │ │ ├── missingEffectContext_callExpression.ts.missingEffectContext_skipFile.from675to693.output │ │ ├── missingEffectContext_callExpression.ts.missingEffectContext_skipNextLine.from505to523.output │ │ ├── missingEffectContext_callExpression.ts.missingEffectContext_skipNextLine.from675to693.output │ │ ├── missingEffectContext_callExpression.ts.output │ │ ├── missingEffectContext_conciseBody.ts.codefixes │ │ ├── missingEffectContext_conciseBody.ts.missingEffectContext_skipFile.from288to306.output │ │ ├── missingEffectContext_conciseBody.ts.missingEffectContext_skipNextLine.from288to306.output │ │ ├── missingEffectContext_conciseBody.ts.output │ │ ├── missingEffectContext_lazy.ts.codefixes │ │ ├── missingEffectContext_lazy.ts.missingEffectContext_skipFile.from762to813.output │ │ ├── missingEffectContext_lazy.ts.missingEffectContext_skipNextLine.from762to813.output │ │ ├── missingEffectContext_lazy.ts.output │ │ ├── missingEffectContext_pipe.ts.codefixes │ │ ├── missingEffectContext_pipe.ts.output │ │ ├── missingEffectContext_plainAssignment.ts.codefixes │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipFile.from1036to1051.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipFile.from1167to1185.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipFile.from555to573.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipFile.from652to667.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipFile.from867to895.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipNextLine.from1036to1051.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipNextLine.from1167to1185.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipNextLine.from555to573.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipNextLine.from652to667.output │ │ ├── missingEffectContext_plainAssignment.ts.missingEffectContext_skipNextLine.from867to895.output │ │ ├── missingEffectContext_plainAssignment.ts.output │ │ ├── missingEffectContext_returnSignature.ts.codefixes │ │ ├── missingEffectContext_returnSignature.ts.missingEffectContext_skipFile.from484to509.output │ │ ├── missingEffectContext_returnSignature.ts.missingEffectContext_skipFile.from595to613.output │ │ ├── missingEffectContext_returnSignature.ts.missingEffectContext_skipFile.from744to762.output │ │ ├── missingEffectContext_returnSignature.ts.missingEffectContext_skipNextLine.from484to509.output │ │ ├── missingEffectContext_returnSignature.ts.missingEffectContext_skipNextLine.from595to613.output │ │ ├── missingEffectContext_returnSignature.ts.missingEffectContext_skipNextLine.from744to762.output │ │ ├── missingEffectContext_returnSignature.ts.output │ │ ├── missingEffectContext_skipArrowDefaults.ts.codefixes │ │ ├── missingEffectContext_skipArrowDefaults.ts.output │ │ ├── missingEffectError_callExpression.ts.codefixes │ │ ├── missingEffectError_callExpression.ts.missingEffectError_catchAll.from402to418.output │ │ ├── missingEffectError_callExpression.ts.missingEffectError_skipFile.from402to418.output │ │ ├── missingEffectError_callExpression.ts.missingEffectError_skipFile.from559to575.output │ │ ├── missingEffectError_callExpression.ts.missingEffectError_skipNextLine.from402to418.output │ │ ├── missingEffectError_callExpression.ts.missingEffectError_skipNextLine.from559to575.output │ │ ├── missingEffectError_callExpression.ts.output │ │ ├── missingEffectError_plainAssignment.ts.codefixes │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_catchAll.from400to416.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_catchAll.from843to856.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_catchAll.from956to972.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipFile.from400to416.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipFile.from493to506.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipFile.from682to708.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipFile.from843to856.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipFile.from956to972.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipNextLine.from400to416.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipNextLine.from493to506.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipNextLine.from682to708.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipNextLine.from843to856.output │ │ ├── missingEffectError_plainAssignment.ts.missingEffectError_skipNextLine.from956to972.output │ │ ├── missingEffectError_plainAssignment.ts.output │ │ ├── missingEffectError_returnSignature.ts.codefixes │ │ ├── missingEffectError_returnSignature.ts.missingEffectError_catchAll.from490to506.output │ │ ├── missingEffectError_returnSignature.ts.missingEffectError_skipFile.from381to404.output │ │ ├── missingEffectError_returnSignature.ts.missingEffectError_skipFile.from490to506.output │ │ ├── missingEffectError_returnSignature.ts.missingEffectError_skipFile.from622to638.output │ │ ├── missingEffectError_returnSignature.ts.missingEffectError_skipNextLine.from381to404.output │ │ ├── missingEffectError_returnSignature.ts.missingEffectError_skipNextLine.from490to506.output │ │ ├── missingEffectError_returnSignature.ts.missingEffectError_skipNextLine.from622to638.output │ │ ├── missingEffectError_returnSignature.ts.output │ │ ├── missingEffectError_tagged.ts.codefixes │ │ ├── missingEffectError_tagged.ts.missingEffectError_catchAll.from437to453.output │ │ ├── missingEffectError_tagged.ts.missingEffectError_skipFile.from437to453.output │ │ ├── missingEffectError_tagged.ts.missingEffectError_skipFile.from546to562.output │ │ ├── missingEffectError_tagged.ts.missingEffectError_skipNextLine.from437to453.output │ │ ├── missingEffectError_tagged.ts.missingEffectError_skipNextLine.from546to562.output │ │ ├── missingEffectError_tagged.ts.missingEffectError_tagged.from437to453.output │ │ ├── missingEffectError_tagged.ts.missingEffectError_tagged.from546to562.output │ │ ├── missingEffectError_tagged.ts.output │ │ ├── missingEffectServiceDependency.ts.codefixes │ │ ├── missingEffectServiceDependency.ts.missingEffectServiceDependency_skipFile.from1006to1021.output │ │ ├── missingEffectServiceDependency.ts.missingEffectServiceDependency_skipFile.from1405to1420.output │ │ ├── missingEffectServiceDependency.ts.missingEffectServiceDependency_skipFile.from2492to2507.output │ │ ├── missingEffectServiceDependency.ts.missingEffectServiceDependency_skipNextLine.from1006to1021.output │ │ ├── missingEffectServiceDependency.ts.missingEffectServiceDependency_skipNextLine.from1405to1420.output │ │ ├── missingEffectServiceDependency.ts.missingEffectServiceDependency_skipNextLine.from2492to2507.output │ │ ├── missingEffectServiceDependency.ts.output │ │ ├── missingReturnYieldStar.ts.codefixes │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_fix.from288to318.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_fix.from429to452.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_fix.from457to481.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_skipFile.from288to318.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_skipFile.from429to452.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_skipFile.from457to481.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_skipNextLine.from288to318.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_skipNextLine.from429to452.output │ │ ├── missingReturnYieldStar.ts.missingReturnYieldStar_skipNextLine.from457to481.output │ │ ├── missingReturnYieldStar.ts.output │ │ ├── missingStarInYieldEffectGen.ts.codefixes │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_fix.from201to224.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_fix.from318to341.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_fix.from344to367.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_fix.from496to519.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_fix.from726to744.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_fix.from853to871.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_fix.from967to985.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from185to193.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from201to224.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from302to310.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from318to341.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from344to367.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from478to486.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from496to519.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from710to718.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from726to744.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from837to845.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from853to871.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from951to959.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipFile.from967to985.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from185to193.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from201to224.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from302to310.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from318to341.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from344to367.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from478to486.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from496to519.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from710to718.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from726to744.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from837to845.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from853to871.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from951to959.output │ │ ├── missingStarInYieldEffectGen.ts.missingStarInYieldEffectGen_skipNextLine.from967to985.output │ │ ├── missingStarInYieldEffectGen.ts.output │ │ ├── missingStarInYieldEffectGen_nested.ts.codefixes │ │ ├── missingStarInYieldEffectGen_nested.ts.output │ │ ├── multipleEffectProvide.ts.codefixes │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_fix.from430to464.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_fix.from564to598.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_fix.from663to697.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_fix.from793to827.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipFile.from430to464.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipFile.from564to598.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipFile.from663to697.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipFile.from793to827.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipNextLine.from430to464.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipNextLine.from564to598.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipNextLine.from663to697.output │ │ ├── multipleEffectProvide.ts.multipleEffectProvide_skipNextLine.from793to827.output │ │ ├── multipleEffectProvide.ts.output │ │ ├── nonObjectEffectServiceType.ts.codefixes │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipFile.from1266to1272.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipFile.from1578to1584.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipFile.from1840to1847.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipFile.from2077to2081.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipFile.from402to408.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipFile.from667to673.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipFile.from979to985.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipNextLine.from1266to1272.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipNextLine.from1578to1584.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipNextLine.from1840to1847.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipNextLine.from2077to2081.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipNextLine.from402to408.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipNextLine.from667to673.output │ │ ├── nonObjectEffectServiceType.ts.nonObjectEffectServiceType_skipNextLine.from979to985.output │ │ ├── nonObjectEffectServiceType.ts.output │ │ ├── outdatedEffectCodegen.ts.codefixes │ │ ├── outdatedEffectCodegen.ts.outdatedEffectCodegen_fix.from61to87.output │ │ ├── outdatedEffectCodegen.ts.outdatedEffectCodegen_ignore.from61to87.output │ │ ├── outdatedEffectCodegen.ts.outdatedEffectCodegen_skipFile.from61to87.output │ │ ├── outdatedEffectCodegen.ts.outdatedEffectCodegen_skipNextLine.from61to87.output │ │ ├── outdatedEffectCodegen.ts.output │ │ ├── overriddenSchemaConstructor.ts.codefixes │ │ ├── overriddenSchemaConstructor.ts.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_fix.from660to700.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_fix.from889to938.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_skipFile.from660to700.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_skipFile.from889to938.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_skipNextLine.from660to700.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_skipNextLine.from889to938.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_static.from660to700.output │ │ ├── overriddenSchemaConstructor.ts.overriddenSchemaConstructor_static.from889to938.output │ │ ├── overriddenSchemaConstructor_static.ts.codefixes │ │ ├── overriddenSchemaConstructor_static.ts.output │ │ ├── overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_fix.from260to316.output │ │ ├── overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_skipFile.from260to316.output │ │ ├── overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_skipNextLine.from260to316.output │ │ ├── overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_static.from260to316.output │ │ ├── returnEffectInGen_noDiagnostics.ts.codefixes │ │ ├── returnEffectInGen_noDiagnostics.ts.output │ │ ├── returnEffectInGen_warn.ts.codefixes │ │ ├── returnEffectInGen_warn.ts.output │ │ ├── returnEffectInGen_warn.ts.returnEffectInGen_fix.from86to113.output │ │ ├── returnEffectInGen_warn.ts.returnEffectInGen_skipFile.from86to113.output │ │ ├── returnEffectInGen_warn.ts.returnEffectInGen_skipNextLine.from86to113.output │ │ ├── scopeInLayerEffect.ts.codefixes │ │ ├── scopeInLayerEffect.ts.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_scoped.from1108to1296.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_scoped.from940to1082.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipFile.from1108to1296.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipFile.from296to500.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipFile.from502to740.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipFile.from940to1082.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipNextLine.from1108to1296.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipNextLine.from296to500.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipNextLine.from502to740.output │ │ ├── scopeInLayerEffect.ts.scopeInLayerEffect_skipNextLine.from940to1082.output │ │ ├── strictBooleanExpressions.ts.codefixes │ │ ├── strictBooleanExpressions.ts.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from123to133.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from220to225.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from300to306.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from391to397.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from440to446.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from517to527.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from662to690.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from759to769.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from792to798.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from792to808.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipFile.from802to808.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from123to133.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from220to225.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from300to306.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from391to397.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from440to446.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from517to527.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from662to690.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from759to769.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from792to798.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from792to808.output │ │ ├── strictBooleanExpressions.ts.strictBooleanExpressions_skipNextLine.from802to808.output │ │ ├── strictEffectProvide.ts.codefixes │ │ ├── strictEffectProvide.ts.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipFile.from427to461.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipFile.from569to616.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipFile.from735to769.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipFile.from893to963.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipNextLine.from427to461.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipNextLine.from569to616.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipNextLine.from735to769.output │ │ ├── strictEffectProvide.ts.strictEffectProvide_skipNextLine.from893to963.output │ │ ├── tryCatchInEffectGen.ts.codefixes │ │ ├── tryCatchInEffectGen.ts.output │ │ ├── tryCatchInEffectGen.ts.tryCatchInEffectGen_skipFile.from334to415.output │ │ ├── tryCatchInEffectGen.ts.tryCatchInEffectGen_skipFile.from901to991.output │ │ ├── tryCatchInEffectGen.ts.tryCatchInEffectGen_skipFile.from97to214.output │ │ ├── tryCatchInEffectGen.ts.tryCatchInEffectGen_skipNextLine.from334to415.output │ │ ├── tryCatchInEffectGen.ts.tryCatchInEffectGen_skipNextLine.from901to991.output │ │ ├── tryCatchInEffectGen.ts.tryCatchInEffectGen_skipNextLine.from97to214.output │ │ ├── tryCatchInEffectGen_finally.ts.codefixes │ │ ├── tryCatchInEffectGen_finally.ts.output │ │ ├── unnecessaryEffectGen.ts.codefixes │ │ ├── unnecessaryEffectGen.ts.output │ │ ├── unnecessaryEffectGen.ts.unnecessaryEffectGen_fix.from283to345.output │ │ ├── unnecessaryEffectGen.ts.unnecessaryEffectGen_skipFile.from283to345.output │ │ ├── unnecessaryEffectGen.ts.unnecessaryEffectGen_skipNextLine.from283to345.output │ │ ├── unnecessaryEffectGen_ifBlock.ts.codefixes │ │ ├── unnecessaryEffectGen_ifBlock.ts.output │ │ ├── unnecessaryEffectGen_noReturn.ts.codefixes │ │ ├── unnecessaryEffectGen_noReturn.ts.output │ │ ├── unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_fix.from276to331.output │ │ ├── unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_fix.from379to427.output │ │ ├── unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipFile.from276to331.output │ │ ├── unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipFile.from379to427.output │ │ ├── unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipNextLine.from276to331.output │ │ ├── unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipNextLine.from379to427.output │ │ ├── unnecessaryPipe.ts.codefixes │ │ ├── unnecessaryPipe.ts.output │ │ ├── unnecessaryPipe.ts.unnecessaryPipe_fix.from308to316.output │ │ ├── unnecessaryPipe.ts.unnecessaryPipe_fix.from352to377.output │ │ ├── unnecessaryPipe.ts.unnecessaryPipe_skipFile.from308to316.output │ │ ├── unnecessaryPipe.ts.unnecessaryPipe_skipFile.from352to377.output │ │ ├── unnecessaryPipe.ts.unnecessaryPipe_skipNextLine.from308to316.output │ │ ├── unnecessaryPipe.ts.unnecessaryPipe_skipNextLine.from352to377.output │ │ ├── unnecessaryPipeChain.ts.codefixes │ │ ├── unnecessaryPipeChain.ts.output │ │ ├── unnecessaryPipeChain.ts.unnecessaryPipeChain_fix.from106to185.output │ │ ├── unnecessaryPipeChain.ts.unnecessaryPipeChain_fix.from209to290.output │ │ ├── unnecessaryPipeChain.ts.unnecessaryPipeChain_skipFile.from106to185.output │ │ ├── unnecessaryPipeChain.ts.unnecessaryPipeChain_skipFile.from209to290.output │ │ ├── unnecessaryPipeChain.ts.unnecessaryPipeChain_skipNextLine.from106to185.output │ │ ├── unnecessaryPipeChain.ts.unnecessaryPipeChain_skipNextLine.from209to290.output │ │ ├── unsupportedServiceAccessors.ts.codefixes │ │ ├── unsupportedServiceAccessors.ts.output │ │ ├── unsupportedServiceAccessors.ts.unsupportedServiceAccessors_enableCodegen.from1258to1286.output │ │ ├── unsupportedServiceAccessors.ts.unsupportedServiceAccessors_enableCodegen.from1692to1730.output │ │ ├── unsupportedServiceAccessors.ts.unsupportedServiceAccessors_skipFile.from1258to1286.output │ │ ├── unsupportedServiceAccessors.ts.unsupportedServiceAccessors_skipFile.from1692to1730.output │ │ ├── unsupportedServiceAccessors.ts.unsupportedServiceAccessors_skipNextLine.from1258to1286.output │ │ ├── unsupportedServiceAccessors.ts.unsupportedServiceAccessors_skipNextLine.from1692to1730.output │ │ ├── unsupportedServiceAccessors_effectTag.ts.codefixes │ │ ├── unsupportedServiceAccessors_effectTag.ts.output │ │ ├── unsupportedServiceAccessors_effectTag.ts.unsupportedServiceAccessors_enableCodegen.from1152to1190.output │ │ ├── unsupportedServiceAccessors_effectTag.ts.unsupportedServiceAccessors_enableCodegen.from783to811.output │ │ ├── unsupportedServiceAccessors_effectTag.ts.unsupportedServiceAccessors_skipFile.from1152to1190.output │ │ ├── unsupportedServiceAccessors_effectTag.ts.unsupportedServiceAccessors_skipFile.from783to811.output │ │ ├── unsupportedServiceAccessors_effectTag.ts.unsupportedServiceAccessors_skipNextLine.from1152to1190.output │ │ ├── unsupportedServiceAccessors_effectTag.ts.unsupportedServiceAccessors_skipNextLine.from783to811.output │ │ ├── unsupportedServiceAccessors_primitive.ts.codefixes │ │ └── unsupportedServiceAccessors_primitive.ts.output │ ├── layer-graph.test.ts.snap │ ├── layer-graph │ │ ├── duplicated.ts_AppLive.nested │ │ ├── duplicated.ts_AppLive.outline │ │ ├── duplicated.ts_AppLive.output │ │ ├── duplicated.ts_AppLive.quickinfo │ │ ├── effect.ts_AppLive.nested │ │ ├── effect.ts_AppLive.outline │ │ ├── effect.ts_AppLive.output │ │ ├── effect.ts_AppLive.quickinfo │ │ ├── followSymbols.ts_followSymbols.nested │ │ ├── followSymbols.ts_followSymbols.outline │ │ ├── followSymbols.ts_followSymbols.output │ │ ├── followSymbols.ts_followSymbols.quickinfo │ │ ├── followSymbols.ts_moreComplex.nested │ │ ├── followSymbols.ts_moreComplex.outline │ │ ├── followSymbols.ts_moreComplex.output │ │ ├── followSymbols.ts_moreComplex.quickinfo │ │ ├── generics.ts_NoComment.nested │ │ ├── generics.ts_NoComment.outline │ │ ├── generics.ts_NoComment.output │ │ ├── generics.ts_NoComment.quickinfo │ │ ├── incorrectInference.ts_testInference.nested │ │ ├── incorrectInference.ts_testInference.outline │ │ ├── incorrectInference.ts_testInference.output │ │ ├── incorrectInference.ts_testInference.quickinfo │ │ ├── multiple.ts_AppLive.nested │ │ ├── multiple.ts_AppLive.outline │ │ ├── multiple.ts_AppLive.output │ │ ├── multiple.ts_AppLive.quickinfo │ │ ├── simple.ts_cacheWithFs.nested │ │ ├── simple.ts_cacheWithFs.outline │ │ ├── simple.ts_cacheWithFs.output │ │ ├── simple.ts_cacheWithFs.quickinfo │ │ ├── simple.ts_expect.nested │ │ ├── simple.ts_expect.outline │ │ ├── simple.ts_expect.output │ │ ├── simple.ts_expect.quickinfo │ │ ├── simple.ts_liveWithPipeable.nested │ │ ├── simple.ts_liveWithPipeable.outline │ │ ├── simple.ts_liveWithPipeable.output │ │ ├── simple.ts_liveWithPipeable.quickinfo │ │ ├── simple.ts_simplePipeIn.nested │ │ ├── simple.ts_simplePipeIn.outline │ │ ├── simple.ts_simplePipeIn.output │ │ ├── simple.ts_simplePipeIn.quickinfo │ │ ├── specialChars.ts_NoComment.nested │ │ ├── specialChars.ts_NoComment.outline │ │ ├── specialChars.ts_NoComment.output │ │ └── specialChars.ts_NoComment.quickinfo │ ├── refactors │ │ ├── asyncAwaitToFn.ts.ln4col28.output │ │ ├── asyncAwaitToFnTryPromise.ts.ln4col28.output │ │ ├── asyncAwaitToFn_fetch.ts.ln3col30.output │ │ ├── asyncAwaitToFn_generics.ts.ln4col28.output │ │ ├── asyncAwaitToGen.ts.ln4col28.output │ │ ├── asyncAwaitToGenTryPromise.ts.ln5col28.output │ │ ├── asyncAwaitToGenTryPromise_anonymous.ts.ln13col41.output │ │ ├── asyncAwaitToGenTryPromise_anonymous.ts.ln4col44.output │ │ ├── asyncAwaitToGen_anonymous.ts.ln13col41.output │ │ ├── asyncAwaitToGen_anonymous.ts.ln4col44.output │ │ ├── asyncAwaitToGen_namedImport.ts.ln4col28.output │ │ ├── effectGenToFn.ts.ln11col21.output │ │ ├── effectGenToFn.ts.ln12col8.output │ │ ├── effectGenToFn.ts.ln21col16.output │ │ ├── effectGenToFn.ts.ln29col8.output │ │ ├── effectGenToFn.ts.ln4col17.output │ │ ├── effectGenToFn.ts.ln5col8.output │ │ ├── effectGenToFn_classMethod.ts.ln6col17.output │ │ ├── effectGenToFn_mixedPipes.ts.ln7col13.output │ │ ├── effectGenToFn_withPipes.ts.ln7col13.output │ │ ├── functionToArrow.ts.ln12col20.output │ │ ├── functionToArrow.ts.ln21col5.output │ │ ├── functionToArrow.ts.ln5col20.output │ │ ├── layerMagic_build.ts.ln19col23.output │ │ ├── layerMagic_build.ts.ln20col13.output │ │ ├── layerMagic_build.ts.ln24col24.output │ │ ├── layerMagic_build.ts.ln31col21.output │ │ ├── layerMagic_build.ts.ln38col20.output │ │ ├── layerMagic_build.ts.ln42col18.output │ │ ├── layerMagic_build.ts.ln44col20.output │ │ ├── layerMagic_prepare.ts.ln17col23.output │ │ ├── layerMagic_prepare.ts.ln17col34.output │ │ ├── layerMagic_prepare.ts.ln19col34.output │ │ ├── layerMagic_prepare.ts.ln24col41.output │ │ ├── layerMagic_prepareReuse.ts.ln17col20.output │ │ ├── layerMagic_prepareReuse.ts.ln23col20.output │ │ ├── makeSchemaOpaque.ts.ln4col17.output │ │ ├── makeSchemaOpaqueWithNs_shortImport.ts.ln4col17.output │ │ ├── makeSchemaOpaque_brand.ts.ln4col17.output │ │ ├── makeSchemaOpaque_shortImport.ts.ln4col17.output │ │ ├── makeSchemaOpaque_shortImportAlias.ts.ln4col17.output │ │ ├── makeSchemaOpaque_union.ts.ln4col17.output │ │ ├── pipeableToDatafirst.ts.ln14col16.output │ │ ├── pipeableToDatafirst.ts.ln20col16.output │ │ ├── pipeableToDatafirst.ts.ln5col16.output │ │ ├── removeUnnecessaryEffectGen.ts.ln12col24.output │ │ ├── removeUnnecessaryEffectGen.ts.ln18col24.output │ │ ├── removeUnnecessaryEffectGen.ts.ln4col24.output │ │ ├── removeUnnecessaryEffectGen.ts.ln8col24.output │ │ ├── toggleLazyConst.ts.ln3col10.output │ │ ├── toggleLazyConst.ts.ln3col7.output │ │ ├── toggleLazyConst.ts.ln5col10.output │ │ ├── toggleLazyConst.ts.ln5col7.output │ │ ├── toggleLazyConst.ts.ln7col10.output │ │ ├── togglePipeStyle.ts.ln5col54.output │ │ ├── togglePipeStyle.ts.ln7col32.output │ │ ├── toggleReturnTypeAnnotation.ts.ln12col18.output │ │ ├── toggleReturnTypeAnnotation.ts.ln16col18.output │ │ ├── toggleReturnTypeAnnotation.ts.ln4col32.output │ │ ├── toggleReturnTypeAnnotation.ts.ln6col32.output │ │ ├── toggleReturnTypeAnnotation.ts.ln8col32.output │ │ ├── toggleTypeAnnotation.ts.ln11col14.output │ │ ├── toggleTypeAnnotation.ts.ln11col16.output │ │ ├── toggleTypeAnnotation.ts.ln12col14.output │ │ ├── toggleTypeAnnotation.ts.ln12col16.output │ │ ├── toggleTypeAnnotation.ts.ln14col16.output │ │ ├── toggleTypeAnnotation.ts.ln14col7.output │ │ ├── toggleTypeAnnotation.ts.ln15col16.output │ │ ├── toggleTypeAnnotation.ts.ln15col7.output │ │ ├── toggleTypeAnnotation.ts.ln20col14.output │ │ ├── toggleTypeAnnotation.ts.ln20col16.output │ │ ├── toggleTypeAnnotation.ts.ln24col14.output │ │ ├── toggleTypeAnnotation.ts.ln24col16.output │ │ ├── toggleTypeAnnotation.ts.ln38col14.output │ │ ├── toggleTypeAnnotation.ts.ln38col16.output │ │ ├── toggleTypeAnnotation.ts.ln41col15.output │ │ ├── toggleTypeAnnotation.ts.ln42col12.output │ │ ├── toggleTypeAnnotation.ts.ln42col15.output │ │ ├── toggleTypeAnnotation.ts.ln43col5.output │ │ ├── toggleTypeAnnotation.ts.ln43col9.output │ │ ├── toggleTypeAnnotation.ts.ln44col5.output │ │ ├── toggleTypeAnnotation.ts.ln44col9.output │ │ ├── toggleTypeAnnotation.ts.ln4col14.output │ │ ├── toggleTypeAnnotation.ts.ln4col16.output │ │ ├── toggleTypeAnnotation.ts.ln5col14.output │ │ ├── toggleTypeAnnotation.ts.ln5col16.output │ │ ├── toggleTypeAnnotation.ts.ln8col14.output │ │ ├── toggleTypeAnnotation.ts.ln8col16.output │ │ ├── toggleTypeAnnotation_schema.ts.ln11col15.output │ │ ├── toggleTypeAnnotation_simplify.ts.ln11col18.output │ │ ├── toggleTypeAnnotation_simplify.ts.ln13col18.output │ │ ├── toggleTypeAnnotation_simplify.ts.ln19col18.output │ │ ├── toggleTypeAnnotation_simplify.ts.ln7col18.output │ │ ├── toggleTypeAnnotation_simplify.ts.ln8col17.output │ │ ├── toggleTypeAnnotation_simplify.ts.ln9col18.output │ │ ├── typeToEffectSchema.ts.ln4col21.output │ │ ├── typeToEffectSchemaClass.ts.ln4col21.output │ │ ├── typeToEffectSchema_conditionalType.ts.ln3col15.output │ │ ├── typeToEffectSchema_dataTypes.ts.ln8col23.output │ │ ├── typeToEffectSchema_indexSignature.ts.ln4col21.output │ │ ├── typeToEffectSchema_literal.ts.ln4col15.output │ │ ├── typeToEffectSchema_literal.ts.ln6col15.output │ │ ├── typeToEffectSchema_noGenerics.ts.ln3col22.output │ │ ├── typeToEffectSchema_typeAlias.ts.ln3col15.output │ │ ├── typeToEffectSchema_typeOf.ts.ln6col21.output │ │ ├── typeToEffectSchema_typeofKeyof.ts.ln9col21.output │ │ ├── wrapWithEffectGen.ts.ln14col22.output │ │ ├── wrapWithEffectGen.ts.ln15col5.output │ │ ├── wrapWithEffectGen.ts.ln5col22.output │ │ ├── wrapWithEffectGen.ts.ln7col22.output │ │ ├── wrapWithEffectGen.ts.ln9col22-ln12col1.output │ │ ├── wrapWithEffectGen.ts.ln9col22.output │ │ ├── wrapWithEffectGen_noclass.ts.ln4col36.output │ │ ├── wrapWithPipe.ts.ln2col13-ln2col26.output │ │ ├── wrapWithPipe.ts.ln3col14-ln3col21.output │ │ └── writeTagClassAccessors.ts.ln5col7.output │ └── renames │ │ ├── keyStrings.ts.ln4col20.output │ │ ├── keyStrings_contextTag.ts.ln4col20.output │ │ ├── keyStrings_dataTaggedClass.ts.ln4col20.output │ │ ├── keyStrings_dataTaggedError.ts.ln4col20.output │ │ ├── keyStrings_effectService.ts.ln4col20.output │ │ ├── keyStrings_effectTag.ts.ln4col20.output │ │ ├── keyStrings_taggedClass.ts.ln4col20.output │ │ ├── keyStrings_taggedError.ts.ln4col20.output │ │ └── keyStrings_taggedRequest.ts.ln4col20.output ├── autoimport.test.ts ├── completions.test.ts ├── diagnostics.test.ts ├── internals.test.ts ├── layer-graph.test.ts ├── perf.ts ├── refactors.test.ts ├── renames.test.ts └── utils │ └── mocks.ts ├── tsconfig.base.json ├── tsconfig.build.json ├── tsconfig.config.json ├── tsconfig.examples.json ├── tsconfig.json ├── tsconfig.src.json ├── tsconfig.test.json ├── tsup.config.ts └── vitest.config.mts /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@1.6.4/schema.json", 3 | "changelog": ["@changesets/changelog-github", { "repo": "Effect-TS/language-service" }], 4 | "commit": false, 5 | "linked": [], 6 | "access": "restricted", 7 | "baseBranch": "main", 8 | "updateInternalDependencies": "patch", 9 | "ignore": [] 10 | } 11 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [mikearnaldi] 4 | -------------------------------------------------------------------------------- /.github/actions/setup/action.yml: -------------------------------------------------------------------------------- 1 | name: Setup 2 | description: Perform standard setup and install dependencies using pnpm. 3 | inputs: 4 | node-version: 5 | description: The version of Node.js to install 6 | required: true 7 | default: 23.7.0 8 | 9 | runs: 10 | using: composite 11 | steps: 12 | - name: Install pnpm 13 | uses: pnpm/action-setup@v3 14 | - name: Install node 15 | uses: actions/setup-node@v4 16 | with: 17 | cache: pnpm 18 | node-version: ${{ inputs.node-version }} 19 | - name: Install dependencies 20 | shell: bash 21 | run: pnpm install 22 | -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: Check 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: 6 | branches: [main] 7 | push: 8 | branches: [main] 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | permissions: {} 15 | 16 | jobs: 17 | lint: 18 | name: Lint 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v3 22 | - name: Install dependencies 23 | uses: ./.github/actions/setup 24 | with: 25 | cachixAuthToken: ${{ secrets.CACHIX_AUTH_TOKEN }} 26 | - run: pnpm check 27 | - run: pnpm lint 28 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | 3 | on: 4 | workflow_dispatch: 5 | pull_request: 6 | branches: [main] 7 | push: 8 | branches: [main] 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | permissions: {} 15 | 16 | jobs: 17 | test: 18 | name: Test 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v3 22 | - name: Install dependencies 23 | uses: ./.github/actions/setup 24 | - run: pnpm test 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage/ 2 | *.tsbuildinfo 3 | node_modules/ 4 | .DS_Store 5 | tmp/ 6 | dist/ 7 | build/ 8 | docs/examples/ 9 | .direnv/ 10 | -------------------------------------------------------------------------------- /.madgerc: -------------------------------------------------------------------------------- 1 | { 2 | "detectiveOptions": { 3 | "ts": { 4 | "skipTypeImports": true 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Attach to TS Server", 6 | "type": "node", 7 | "request": "attach", 8 | "protocol": "inspector", 9 | "port": 5667, 10 | "sourceMaps": true, 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /examples/completions/contextSelfInClasses.ts: -------------------------------------------------------------------------------- 1 | // 4:40 2 | import * as Context from "effect/Context" 3 | 4 | export class MyService extends Context. 5 | -------------------------------------------------------------------------------- /examples/completions/contextSelfInClasses_identifierKey.ts: -------------------------------------------------------------------------------- 1 | // 5:40 2 | // @test-config { "keyPatterns": [ { "pattern": "package-identifier", "target": "service" } ] } 3 | import * as Context from "effect/Context" 4 | 5 | export class MyService extends Context. 6 | -------------------------------------------------------------------------------- /examples/completions/durationInput.ts: -------------------------------------------------------------------------------- 1 | // 4:38 2 | import * as Effect from "effect/Effect" 3 | 4 | export const program = Effect.sleep("") 5 | -------------------------------------------------------------------------------- /examples/completions/durationInput_props.ts: -------------------------------------------------------------------------------- 1 | // 5:14 2 | import * as Effect from "effect/Effect" 3 | 4 | export const program = Effect.timeoutFail(Effect.never, { 5 | duration: "" 6 | }) 7 | -------------------------------------------------------------------------------- /examples/completions/effectCodegensComment.ts: -------------------------------------------------------------------------------- 1 | // 2:5 2 | // @ 3 | -------------------------------------------------------------------------------- /examples/completions/effectDataClasses.ts: -------------------------------------------------------------------------------- 1 | // 4:35 2 | import * as Data from "effect/Data" 3 | 4 | export class MyError extends Data. 5 | -------------------------------------------------------------------------------- /examples/completions/effectDiagnosticsComment.ts: -------------------------------------------------------------------------------- 1 | // 2:5 2 | // @ 3 | -------------------------------------------------------------------------------- /examples/completions/effectJsdocComment.ts: -------------------------------------------------------------------------------- 1 | // 2:6 2 | /** @ 3 | -------------------------------------------------------------------------------- /examples/completions/effectSchemaSelfInClasses_dotToken.ts: -------------------------------------------------------------------------------- 1 | // 4:22 2 | import * as S from "effect/Schema" 3 | 4 | class Test extends S. 5 | -------------------------------------------------------------------------------- /examples/completions/effectSchemaSelfInClasses_tagg.ts: -------------------------------------------------------------------------------- 1 | // 4:25 2 | import * as S from "effect/Schema" 3 | 4 | class Test extends S.tag 5 | -------------------------------------------------------------------------------- /examples/completions/effectSelfInClasses.ts: -------------------------------------------------------------------------------- 1 | // 4:39 2 | import * as Effect from "effect/Effect" 3 | 4 | export class MyService extends Effect. 5 | -------------------------------------------------------------------------------- /examples/completions/fnFunctionStar.ts: -------------------------------------------------------------------------------- 1 | // 4:24 2 | import * as Effect from "effect/Effect" 3 | 4 | const program = Effect. 5 | -------------------------------------------------------------------------------- /examples/completions/genFunctionStar.ts: -------------------------------------------------------------------------------- 1 | // 4:24 2 | import * as Effect from "effect/Effect" 3 | 4 | const program = Effect. 5 | -------------------------------------------------------------------------------- /examples/completions/rpcMakeClasses.ts: -------------------------------------------------------------------------------- 1 | // 4:36 2 | import * as Rpc from "@effect/rpc/Rpc" 3 | 4 | export class MyRequest extends Rpc. 5 | -------------------------------------------------------------------------------- /examples/completions/schemaBrand.ts: -------------------------------------------------------------------------------- 1 | // 4:60 2 | import * as Schema from "effect/Schema" 3 | 4 | export const ProductId = Schema.NonEmptyString.pipe(Schema.) 5 | -------------------------------------------------------------------------------- /examples/diagnostics/classSelfMismatch_contextTag.ts: -------------------------------------------------------------------------------- 1 | import * as Context from "effect/Context" 2 | 3 | interface ServiceShape { 4 | value: number 5 | } 6 | 7 | // valid usage: is correct because the Self type parameter is the same as the class name 8 | export class ValidContextTag extends Context.Tag("ValidContextTag")() {} 9 | 10 | // invalid usage: should be because the Self type parameter is not the same as the class name 11 | export class InvalidContextTag extends Context.Tag("ValidContextTag")() {} 12 | -------------------------------------------------------------------------------- /examples/diagnostics/classSelfMismatch_effectTag.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | interface ServiceShape { 4 | value: number 5 | } 6 | 7 | // valid usage: is correct because the Self type parameter is the same as the class name 8 | export class ValidContextTag extends Effect.Tag("ValidContextTag")() {} 9 | 10 | // invalid usage: should be because the Self type parameter is not the same as the class name 11 | export class InvalidContextTag extends Effect.Tag("ValidContextTag")() {} 12 | -------------------------------------------------------------------------------- /examples/diagnostics/classSelfMismatch_schemaFalsePositive.ts: -------------------------------------------------------------------------------- 1 | import * as Persistable from "@/diagnostics/utils" 2 | 3 | export class TTLRequest extends Persistable.Class<{ 4 | payload: { id: number } 5 | }>()("TTLRequest", { 6 | primaryKey: (req) => `TTLRequest:${req.id}` 7 | }) {} 8 | -------------------------------------------------------------------------------- /examples/diagnostics/classSelfMismatch_unionGiven.ts: -------------------------------------------------------------------------------- 1 | import * as Context from "effect/Context" 2 | 3 | interface ServiceShape { 4 | value: number 5 | } 6 | 7 | export class OtherService extends Context.Tag("OtherService")() {} 8 | 9 | export class MyService extends Context.Tag("MyService")() {} 10 | -------------------------------------------------------------------------------- /examples/diagnostics/deterministicKeys.ts: -------------------------------------------------------------------------------- 1 | // @effect-diagnostics deterministicKeys:error 2 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default" }, { "target": "error", "pattern": "default" } ] } 3 | import * as Context from "effect/Context" 4 | import * as Data from "effect/Data" 5 | 6 | export class ExpectedServiceIdentifier 7 | extends Context.Tag("ExpectedServiceIdentifier")() 8 | {} 9 | 10 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 11 | -------------------------------------------------------------------------------- /examples/diagnostics/deterministicKeys_custom.ts: -------------------------------------------------------------------------------- 1 | // @effect-diagnostics deterministicKeys:error 2 | // @test-config { "extendedKeyDetection": true } 3 | import * as Persistable from "@/diagnostics/utils" 4 | import * as Context from "effect/Context" 5 | 6 | // simple case inside same file 7 | export function MyConstructor(/** @effect-identifier */ identifier: string) { 8 | return Context.Tag("hey/" + identifier) 9 | } 10 | 11 | export class MyClass extends MyConstructor("Hello")() { 12 | } 13 | 14 | // referenced on another file 15 | export class TTLRequest extends Persistable.Class<{ 16 | payload: { id: number } 17 | }>()("TTLRequest", { 18 | primaryKey: (req) => `TTLRequest:${req.id}` 19 | }) {} 20 | -------------------------------------------------------------------------------- /examples/diagnostics/deterministicKeys_defaultHashed.ts: -------------------------------------------------------------------------------- 1 | // @effect-diagnostics deterministicKeys:error 2 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] } 3 | import * as Context from "effect/Context" 4 | import * as Data from "effect/Data" 5 | 6 | export class ExpectedServiceIdentifier 7 | extends Context.Tag("ExpectedServiceIdentifier")() 8 | {} 9 | 10 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 11 | -------------------------------------------------------------------------------- /examples/diagnostics/deterministicKeys_packageIdentifier.ts: -------------------------------------------------------------------------------- 1 | // @effect-diagnostics deterministicKeys:error 2 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "package-identifier" }, { "target": "error", "pattern": "package-identifier" } ] } 3 | import * as Context from "effect/Context" 4 | import * as Data from "effect/Data" 5 | 6 | export class ExpectedServiceIdentifier 7 | extends Context.Tag("ExpectedServiceIdentifier")() 8 | {} 9 | 10 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 11 | -------------------------------------------------------------------------------- /examples/diagnostics/duplicatePackage.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | Effect.runPromise(Effect.succeed(true)) 4 | -------------------------------------------------------------------------------- /examples/diagnostics/effectGenUsesAdapter.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | export const isValid = Effect.gen(function*() { 4 | const x = yield* Effect.succeed(1) 5 | return x 6 | }) 7 | 8 | // when the adapter usage is detected, warn 9 | export const isNotValid = Effect.gen(function*(_) { 10 | const x = yield* Effect.succeed(1) 11 | return x 12 | }) 13 | -------------------------------------------------------------------------------- /examples/diagnostics/effectInVoidSuccess.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | import * as Stream from "effect/Stream" 3 | 4 | export const shouldReport: Effect.Effect = Effect.succeed(Effect.succeed(42)) 5 | 6 | export const shouldReport2 = Effect.suspend((): Effect.Effect => { 7 | return Stream.empty.pipe( 8 | Stream.runCollect, 9 | Effect.interruptible, 10 | Effect.matchCause({ 11 | onSuccess: () => "success", 12 | onFailure: () => Effect.fail("error") 13 | }) 14 | ) 15 | }) 16 | -------------------------------------------------------------------------------- /examples/diagnostics/floatingEffect_disableNextLine.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | Effect.succeed(true) 4 | /** @effect-diagnostics-next-line floatingEffect:off */ 5 | Effect.succeed(42) 6 | Effect.succeed(false) 7 | // @effect-diagnostics-next-line floatingEffect:off 8 | Effect.succeed(42) 9 | -------------------------------------------------------------------------------- /examples/diagnostics/floatingEffect_disableNextLineFix.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | function test() { 4 | Effect.succeed(42) 5 | } 6 | -------------------------------------------------------------------------------- /examples/diagnostics/floatingEffect_disabled.ts: -------------------------------------------------------------------------------- 1 | /** @effect-diagnostics floatingEffect:warning */ 2 | import * as Effect from "effect/Effect" 3 | 4 | Effect.succeed(1) 5 | 6 | /** @effect-diagnostics floatingEffect:off */ 7 | 8 | Effect.succeed(1) 9 | 10 | /** @effect-diagnostics floatingEffect:error */ 11 | 12 | Effect.succeed(1) 13 | 14 | /** @effect-diagnostics floatingEffect:suggestion */ 15 | 16 | Effect.succeed(1) 17 | -------------------------------------------------------------------------------- /examples/diagnostics/floatingEffect_logicalAssignments.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | let logicalAssignment: Effect.Effect | undefined = undefined 4 | logicalAssignment ??= Effect.void 5 | logicalAssignment ||= Effect.void 6 | logicalAssignment &&= Effect.void 7 | -------------------------------------------------------------------------------- /examples/diagnostics/floatingEffect_poolSubtype.ts: -------------------------------------------------------------------------------- 1 | import { Effect, Pool } from "effect" 2 | 3 | export const shouldNotTrigger = Effect.gen(function*() { 4 | yield* Pool.make({ acquire: Effect.succeed(1), size: 10 }) 5 | }) 6 | -------------------------------------------------------------------------------- /examples/diagnostics/floatingEffect_stream.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | import * as Stream from "effect/Stream" 3 | 4 | export const shouldWarn = Effect.gen(function*() { 5 | Stream.succeed(42) 6 | }) 7 | -------------------------------------------------------------------------------- /examples/diagnostics/genericEffectServices.ts: -------------------------------------------------------------------------------- 1 | import { Effect } from "effect" 2 | 3 | export class ShouldNotReport extends Effect.Service()("ShouldNotReport", { 4 | succeed: {} 5 | }) {} 6 | 7 | export class ShouldReport<_A> extends Effect.Service>()("ShouldReport", { 8 | succeed: {} 9 | }) {} 10 | -------------------------------------------------------------------------------- /examples/diagnostics/importFromBarrel.ts: -------------------------------------------------------------------------------- 1 | // @effect-diagnostics importFromBarrel:error 2 | import { Effect } from "effect" 3 | import { Predicate as P } from "effect" 4 | import { pipe } from "effect" 5 | import * as Schema from "effect/Schema" 6 | 7 | export const main = { 8 | a: Effect.void, 9 | b: P.isNumber, 10 | c: Schema.Number 11 | } 12 | -------------------------------------------------------------------------------- /examples/diagnostics/leakingRequirements_genericTag.ts: -------------------------------------------------------------------------------- 1 | import type { Effect } from "effect" 2 | import { Context } from "effect" 3 | 4 | export class FileSystem extends Context.Tag("FileSystem") Effect.Effect 6 | }>() {} 7 | 8 | interface LeakingService { 9 | writeCache: () => Effect.Effect 10 | readCache: Effect.Effect 11 | } 12 | 13 | export const GenericTag = Context.GenericTag("LeakingService") 14 | -------------------------------------------------------------------------------- /examples/diagnostics/leakingRequirements_heuristic.ts: -------------------------------------------------------------------------------- 1 | import type { Effect } from "effect" 2 | import { Context } from "effect" 3 | 4 | export class FileSystem extends Context.Tag("FileSystem") Effect.Effect 6 | }>() {} 7 | 8 | export class ValidTag extends Context.Tag("ValidTag") 10 | writeCache: () => Effect.Effect 11 | readCache: Effect.Effect 12 | }>() {} 13 | -------------------------------------------------------------------------------- /examples/diagnostics/leakingRequirements_leakableJsDoc.ts: -------------------------------------------------------------------------------- 1 | import type { Effect } from "effect" 2 | import { Context } from "effect" 3 | 4 | /** 5 | * @effect-leakable-service 6 | */ 7 | export class FileSystem extends Context.Tag("FileSystem") Effect.Effect 9 | }>() {} 10 | 11 | interface LeakingService { 12 | writeCache: () => Effect.Effect 13 | readCache: Effect.Effect 14 | } 15 | 16 | export const GenericTag = Context.GenericTag("LeakingService") 17 | -------------------------------------------------------------------------------- /examples/diagnostics/leakingRequirements_noScope.ts: -------------------------------------------------------------------------------- 1 | import * as Context from "effect/Context" 2 | import type * as Effect from "effect/Effect" 3 | import type * as Scope from "effect/Scope" 4 | 5 | export class FileSystem extends Context.Tag("FileSystem") Effect.Effect 7 | }>() {} 8 | 9 | interface LeakingScopeIsFine { 10 | writeCache: () => Effect.Effect 11 | readCache: Effect.Effect 12 | } 13 | 14 | export const GenericTag = Context.GenericTag("LeakingScopeIsFine") 15 | -------------------------------------------------------------------------------- /examples/diagnostics/missingEffectContext_conciseBody.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | class ServiceA extends Effect.Service()("ServiceA", { 4 | succeed: { a: 1 } 5 | }) {} 6 | 7 | declare const effectWithServices: Effect.Effect 8 | 9 | // @ts-expect-error 10 | export const conciseBody: () => Effect.Effect = () => effectWithServices 11 | -------------------------------------------------------------------------------- /examples/diagnostics/missingEffectContext_pipe.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | import { pipe } from "effect/Function" 3 | 4 | class ServiceA extends Effect.Service()("ServiceA", { 5 | succeed: { a: 1 } 6 | }) {} 7 | 8 | // @ts-expect-error 9 | pipe(ServiceA, Effect.flatMap(() => Effect.void), Effect.runPromise) 10 | -------------------------------------------------------------------------------- /examples/diagnostics/missingEffectContext_skipArrowDefaults.ts: -------------------------------------------------------------------------------- 1 | import { Effect, type RateLimiter } from "effect" 2 | 3 | const impl = Effect.gen(function*() { 4 | const banana = (rateLimit: RateLimiter.RateLimiter = (_) => _) => Effect.void 5 | 6 | yield* banana() 7 | }) 8 | -------------------------------------------------------------------------------- /examples/diagnostics/missingEffectError_callExpression.ts: -------------------------------------------------------------------------------- 1 | import * as Data from "effect/Data" 2 | import type * as Effect from "effect/Effect" 3 | 4 | class ErrorA extends Data.Error<{ 5 | a: 1 6 | }> {} 7 | 8 | class ErrorB extends Data.Error<{ 9 | a: 2 10 | }> {} 11 | 12 | class ErrorC extends Data.Error<{ 13 | a: 3 14 | }> {} 15 | 16 | declare const effectWithErrors: Effect.Effect 17 | 18 | function testFn(effect: Effect.Effect) { 19 | return effect 20 | } 21 | 22 | // @ts-expect-error 23 | testFn(effectWithErrors) 24 | 25 | function testFnWithServiceAB(effect: Effect.Effect) { 26 | return effect 27 | } 28 | 29 | // @ts-expect-error 30 | testFnWithServiceAB(effectWithErrors) 31 | -------------------------------------------------------------------------------- /examples/diagnostics/missingEffectError_tagged.ts: -------------------------------------------------------------------------------- 1 | import * as Data from "effect/Data" 2 | import type * as Effect from "effect/Effect" 3 | 4 | class ErrorA extends Data.TaggedClass("ErrorA")<{ 5 | a: 1 6 | }> {} 7 | 8 | class ErrorB extends Data.TaggedClass("ErrorB")<{ 9 | a: 2 10 | }> {} 11 | 12 | class ErrorC extends Data.TaggedClass("ErrorC")<{ 13 | a: 3 14 | }> {} 15 | 16 | declare const effectWithErrors: Effect.Effect 17 | 18 | // @ts-expect-error 19 | export const conciseBody: () => Effect.Effect = () => effectWithErrors 20 | 21 | // @ts-expect-error 22 | export const conciseBody2: () => Effect.Effect = () => effectWithErrors 23 | -------------------------------------------------------------------------------- /examples/diagnostics/missingReturnYieldStar.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | export const shouldNotComplain = Effect.gen(function*() { 4 | if (Math.random() < 0.5) return Effect.succeed(42) 5 | return yield* Effect.fail("no.") 6 | }) 7 | 8 | export const shouldComplain = (n: number) => 9 | Effect.gen(function*() { 10 | if (n === 0) { 11 | yield* Effect.fail("no zero!") 12 | } 13 | return n / 1 14 | }) 15 | 16 | export const shouldComplainOther = (n: number) => 17 | Effect.gen(function*() { 18 | yield* Effect.interrupt 19 | yield* Effect.die("lol") 20 | return n / 1 21 | }) 22 | 23 | export const shouldNotComplainThrows = Effect.gen(function*() { 24 | throw yield* Effect.fail(42) 25 | return 42 26 | }) 27 | -------------------------------------------------------------------------------- /examples/diagnostics/missingStarInYieldEffectGen_nested.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | import * as Stream from "effect/Stream" 3 | 4 | export const a = Effect.gen(function*() { 5 | async function* asyncIterable() { 6 | yield 1 7 | yield 2 8 | yield 3 9 | } 10 | 11 | const stream = Stream.fromAsyncIterable(asyncIterable(), (_) => _) 12 | return yield* (Stream.runCollect(stream)) 13 | }) 14 | -------------------------------------------------------------------------------- /examples/diagnostics/outdatedEffectCodegen.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | // @effect-codegens accessors:67e9af40a9b0bd25 4 | export class MyService extends Effect.Service()("MyService", { 5 | accessors: true, 6 | effect: Effect.gen(function*() { 7 | return { 8 | constant: Effect.succeed("Hello, world!"), 9 | method: (value: A, _test: string) => Effect.succeed(value) 10 | } 11 | }) 12 | }) { 13 | static myOtherStuff = 42 14 | } 15 | -------------------------------------------------------------------------------- /examples/diagnostics/overriddenSchemaConstructor_static.ts: -------------------------------------------------------------------------------- 1 | import * as Schema from "effect/Schema" 2 | 3 | export class InvalidBecauseOfConstructor 4 | extends Schema.Class("InvalidBecauseOfConstructor")({ 5 | a: Schema.Number 6 | }) 7 | { 8 | b: number 9 | // should be report here at constructor location 10 | constructor() { 11 | super({ a: 42 }) 12 | this.b = 56 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/diagnostics/returnEffectInGen_warn.ts: -------------------------------------------------------------------------------- 1 | import { Effect } from "effect" 2 | 3 | export const shouldWarn = Effect.gen(function*() { 4 | return Effect.fail("error") 5 | }) 6 | -------------------------------------------------------------------------------- /examples/diagnostics/tryCatchInEffectGen_finally.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | // we consider this fine because there is no error handling, just cleanup 4 | export const shouldNotTrigger = Effect.gen(function*() { 5 | try { 6 | const result = yield* Effect.succeed(42) 7 | return result 8 | } finally { 9 | console.log("exit") 10 | } 11 | }) 12 | -------------------------------------------------------------------------------- /examples/diagnostics/unnecessaryEffectGen.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | export const shouldNotRant = Effect.gen(function*() { 4 | yield* Effect.succeed(true) 5 | return yield* Effect.succeed(42) 6 | }) 7 | 8 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 9 | return 42 10 | }) 11 | 12 | export const shouldRaiseForSingle = Effect.gen(function*() { 13 | return yield* Effect.succeed(42) 14 | }) 15 | -------------------------------------------------------------------------------- /examples/diagnostics/unnecessaryEffectGen_ifBlock.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | export const shouldNotTrigger = Effect.gen(function*() { 4 | const query = yield* Effect.succeed("") 5 | yield* Effect.annotateCurrentSpan("query", query) 6 | if (query.length < 3) { 7 | return yield* Effect.fail("query too short") 8 | } 9 | return yield* Effect.succeed(true) 10 | }) 11 | -------------------------------------------------------------------------------- /examples/diagnostics/unnecessaryEffectGen_noReturn.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | export const shouldNotRant = Effect.gen(function*() { 4 | yield* Effect.succeed(true) 5 | yield* Effect.succeed(42) 6 | }) 7 | 8 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 9 | return 42 10 | }) 11 | 12 | export const shouldRaiseForSingle = Effect.gen(function*() { 13 | yield* Effect.succeed(42) 14 | }) 15 | 16 | export const shouldRaiseForSingleReturnVoid = Effect.gen(function*() { 17 | yield* Effect.void 18 | }) 19 | -------------------------------------------------------------------------------- /examples/diagnostics/unnecessaryPipe.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | import { pipe } from "effect/Function" 3 | 4 | export const shouldNotReport = pipe( 5 | Effect.succeed("Hello"), 6 | Effect.map((x) => x + " World") 7 | ) 8 | 9 | export const shouldNotReport2 = Effect.succeed("Hello").pipe( 10 | Effect.map((x) => x + " World") 11 | ) 12 | 13 | export const shouldReport = pipe(32) 14 | 15 | export const shouldReportNoArgs = Effect.succeed(32).pipe() 16 | -------------------------------------------------------------------------------- /examples/diagnostics/unnecessaryPipeChain.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | import { pipe } from "effect/Function" 3 | 4 | export const asPipeable = Effect.succeed(1).pipe(Effect.map((x) => x + 2)).pipe(Effect.map((x) => x + 3)) 5 | 6 | export const asPipe = pipe(pipe(Effect.succeed(1), Effect.map((x) => x + 2)), Effect.map((x) => x + 3)) 7 | -------------------------------------------------------------------------------- /examples/diagnostics/unsupportedServiceAccessors_primitive.ts: -------------------------------------------------------------------------------- 1 | import * as Effect from "effect/Effect" 2 | 3 | export class ValidService extends Effect.Tag("ValidService")() { 4 | } 5 | 6 | export class ValidService2 extends Effect.Tag("ValidService2")() { 7 | } 8 | 9 | export class ValidService3 extends Effect.Tag("ValidService3")() { 10 | } 11 | 12 | export class ValidService4 extends Effect.Tag("ValidService4")() { 13 | } 14 | 15 | export class ValidService5 extends Effect.Tag("ValidService5")() { 16 | } 17 | -------------------------------------------------------------------------------- /examples/goto/rpc.ts: -------------------------------------------------------------------------------- 1 | import { MyApi } from "@/goto/rpc_defs" 2 | import * as RpcClient from "@effect/rpc/RpcClient" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const program = Effect.gen(function*() { 6 | const client = yield* RpcClient.make(MyApi) 7 | 8 | yield* client.MakeReservation({ seats: 2 }) 9 | }) 10 | -------------------------------------------------------------------------------- /examples/goto/rpc_defs.ts: -------------------------------------------------------------------------------- 1 | import * as Rpc from "@effect/rpc/Rpc" 2 | import * as RpcGroup from "@effect/rpc/RpcGroup" 3 | import * as Schema from "effect/Schema" 4 | 5 | export class MakeReservation extends Schema.TaggedRequest("MakeReservation")("MakeReservation", { 6 | payload: { 7 | seats: Schema.Number 8 | }, 9 | success: Schema.Void, 10 | failure: Schema.Never 11 | }) {} 12 | 13 | export class GetAvailable extends Rpc.make("GetAvailable", {}) {} 14 | 15 | export const MyApi = RpcGroup.make( 16 | Rpc.fromTaggedRequest(MakeReservation) 17 | ) 18 | -------------------------------------------------------------------------------- /examples/layer-graph/effect.ts: -------------------------------------------------------------------------------- 1 | import { Effect, Layer } from "effect" 2 | 3 | class DatabaseContext extends Effect.Service()("DatabaseContext", { 4 | succeed: { 5 | value: "DatabaseContext" as const 6 | } 7 | }) {} 8 | 9 | export const AppLive = Layer.effectDiscard(Effect.gen(function*() { 10 | const databaseContext = yield* DatabaseContext 11 | 12 | return yield* Effect.log(databaseContext.value) 13 | })).pipe(Layer.provide(DatabaseContext.Default)) 14 | -------------------------------------------------------------------------------- /examples/layer-graph/followSymbols.ts: -------------------------------------------------------------------------------- 1 | // @test-config { "layerGraphFollowDepth": 1 } 2 | import { cacheWithFs, DbConnection, simplePipeIn, UserRepository } from "@/layer-graph/simple" 3 | import { Layer } from "effect" 4 | 5 | export const followSymbols = simplePipeIn.pipe(Layer.provide(DbConnection.Default)) 6 | 7 | export const moreComplex = UserRepository.Default.pipe(Layer.provide(cacheWithFs), Layer.merge(DbConnection.Default)) 8 | -------------------------------------------------------------------------------- /examples/layer-graph/generics.ts: -------------------------------------------------------------------------------- 1 | import { Layer } from "effect" 2 | import * as Context from "effect/Context" 3 | 4 | const MyTypeId: unique symbol = Symbol.for("x") 5 | type MyTypeId = typeof MyTypeId 6 | 7 | export interface IsGeneric { 8 | readonly [MyTypeId]: MyTypeId 9 | readonly value: X 10 | } 11 | 12 | interface UserRepository { 13 | getNameById(id: number): string 14 | } 15 | 16 | const UserRepository = Context.GenericTag>("IsGeneric") 17 | const userLayer = Layer.succeed(UserRepository, { getNameById: () => "John" } as any) 18 | 19 | export const NoComment = userLayer 20 | -------------------------------------------------------------------------------- /examples/layer-graph/incorrectInference.ts: -------------------------------------------------------------------------------- 1 | // This test shows incorrect effect usage, but is here just to test that the graph is properly using inference apis of ts 2 | import { Layer } from "effect" 3 | import * as Context from "effect/Context" 4 | 5 | const UsersString = Context.GenericTag<"UsersString", string>("UsersString") 6 | const GenericString = Context.GenericTag("GenericString") 7 | 8 | const providesStringLayer = Layer.succeed(GenericString, "John") 9 | const requiresUser = Layer.effectDiscard(UsersString) 10 | 11 | export const testInference = requiresUser.pipe(Layer.provide(providesStringLayer)) 12 | -------------------------------------------------------------------------------- /examples/layer-graph/specialChars.ts: -------------------------------------------------------------------------------- 1 | import { Layer } from "effect" 2 | import * as Context from "effect/Context" 3 | 4 | const MyTypeId: unique symbol = Symbol.for("x") 5 | type MyTypeId = typeof MyTypeId 6 | 7 | export interface IsGeneric { 8 | readonly [MyTypeId]: MyTypeId 9 | readonly value: X 10 | } 11 | 12 | const WithSpecialChars = Context.GenericTagChars#!">>("IsGeneric") 13 | const withSpecialCharsLayer = Layer.succeed(WithSpecialChars, { value: "WithSpecialChars" } as any) 14 | 15 | export const NoComment = withSpecialCharsLayer 16 | -------------------------------------------------------------------------------- /examples/quickinfo/effectGen.ts: -------------------------------------------------------------------------------- 1 | import * as Data from "effect/Data" 2 | import * as Effect from "effect/Effect" 3 | 4 | class DivisionByZeroError extends Data.TaggedError("DivisionByZeroError")<{}> {} 5 | 6 | const divide = Effect.fn(function*(fa: number, divideBy: number) { 7 | if (divideBy === 0) return yield* new DivisionByZeroError() 8 | return fa / divideBy 9 | }) 10 | 11 | export const program = Effect.gen(function*() { 12 | return yield* divide(42, 2) 13 | }) 14 | -------------------------------------------------------------------------------- /examples/quickinfo/layerInfo_generics.ts: -------------------------------------------------------------------------------- 1 | import { Layer } from "effect" 2 | import * as Context from "effect/Context" 3 | 4 | const MyTypeId: unique symbol = Symbol.for("x") 5 | type MyTypeId = typeof MyTypeId 6 | 7 | export interface IsGeneric { 8 | readonly [MyTypeId]: MyTypeId 9 | readonly value: X 10 | } 11 | 12 | interface UserRepository { 13 | getNameById(id: number): string 14 | } 15 | 16 | const UserRepository = Context.GenericTag>("IsGeneric") 17 | const userLayer = Layer.succeed(UserRepository, { getNameById: () => "John" } as any) 18 | 19 | export const NoComment = userLayer 20 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToFn.ts: -------------------------------------------------------------------------------- 1 | // 4:28 2 | import * as T from "effect/Effect" 3 | 4 | export async function refactorMe(arg: string) { 5 | return await Promise.resolve(1) 6 | } 7 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToFnTryPromise.ts: -------------------------------------------------------------------------------- 1 | // 4:28 2 | import * as T from "effect/Effect" 3 | 4 | export async function refactorMe(arg: string) { 5 | return await Promise.resolve(arg) 6 | } 7 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToFn_fetch.ts: -------------------------------------------------------------------------------- 1 | // 3:30 2 | 3 | export async function getUserName(userId: string) { 4 | const user = await fetch(`https://api.example.com/users/${userId}`) 5 | const userData = await user.json() 6 | return userData.name 7 | } 8 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToFn_generics.ts: -------------------------------------------------------------------------------- 1 | // 4:28 2 | import * as Effect from "effect/Effect" 3 | 4 | export async function refactorMe(arg: X) { 5 | return await Promise.resolve(arg) 6 | } 7 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToGen.ts: -------------------------------------------------------------------------------- 1 | // 4:28 2 | import * as T from "effect/Effect" 3 | 4 | export async function refactorMe(arg: string) { 5 | return await Promise.resolve(1) 6 | } 7 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToGenTryPromise.ts: -------------------------------------------------------------------------------- 1 | // 5:28 2 | import * as Effect from "effect/Effect" 3 | 4 | // this is a function existing jsdoc 5 | export async function refactorMe(arg: string) { 6 | for (let i = 0; i < 10; i++) { 7 | await Promise.resolve(i) 8 | } 9 | return await Promise.resolve(arg) 10 | } 11 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToGenTryPromise_anonymous.ts: -------------------------------------------------------------------------------- 1 | // 4:44,13:41 2 | import * as Effect from "effect/Effect" 3 | 4 | const asyncFunctionDeclaration = async function() { 5 | const response = await fetch("test") 6 | if (response.ok) { 7 | const y = await response.json() 8 | return y 9 | } 10 | return null 11 | } 12 | 13 | const asyncArrowFunctionExpression = async () => { 14 | const response = await fetch("test") 15 | if (response.ok) { 16 | const y = await response.json() 17 | return y 18 | } 19 | return null 20 | } 21 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToGen_anonymous.ts: -------------------------------------------------------------------------------- 1 | // 4:44,13:41 2 | import * as Effect from "effect/Effect" 3 | 4 | const asyncFunctionDeclaration = async function() { 5 | const response = await fetch("test") 6 | if (response.ok) { 7 | const y = await response.json() 8 | return y 9 | } 10 | return null 11 | } 12 | 13 | const asyncArrowFunctionExpression = async () => { 14 | const response = await fetch("test") 15 | if (response.ok) { 16 | const y = await response.json() 17 | return y 18 | } 19 | return null 20 | } 21 | -------------------------------------------------------------------------------- /examples/refactors/asyncAwaitToGen_namedImport.ts: -------------------------------------------------------------------------------- 1 | // 4:28 2 | import { Effect as T } from "effect" 3 | 4 | export async function refactorMe(arg: string) { 5 | return await Promise.resolve(1) 6 | } 7 | -------------------------------------------------------------------------------- /examples/refactors/effectGenToFn_classMethod.ts: -------------------------------------------------------------------------------- 1 | // 6:17 2 | import * as Eff from "effect/Effect" 3 | 4 | class Test { 5 | methodReturnsEffect(arg1: number, arg2: number) { 6 | return Eff.gen(function*() { 7 | const a = yield* Eff.succeed(arg1) 8 | const b = yield* Eff.succeed(arg2) 9 | return a + b 10 | }) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/refactors/effectGenToFn_mixedPipes.ts: -------------------------------------------------------------------------------- 1 | // 7:13 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = () => 6 | pipe( 7 | Effect.gen(function*() { 8 | const test = "test" 9 | return yield* Effect.succeed(test) 10 | }).pipe(Effect.asVoid), 11 | Effect.tapError(Effect.logError) 12 | ) 13 | -------------------------------------------------------------------------------- /examples/refactors/effectGenToFn_withPipes.ts: -------------------------------------------------------------------------------- 1 | // 7:13 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = () => 6 | pipe( 7 | Effect.gen(function*() { 8 | const test = "test" 9 | return yield* Effect.succeed(test) 10 | }), 11 | Effect.tapError(Effect.logError) 12 | ) 13 | -------------------------------------------------------------------------------- /examples/refactors/functionToArrow.ts: -------------------------------------------------------------------------------- 1 | // 5:20,12:20,21:5 2 | /** 3 | * Docs 4 | */ 5 | export function myTest(name: string) { 6 | return name.length 7 | } 8 | 9 | /** 10 | * Docs 11 | */ 12 | export function myTest2(name: string) { 13 | if (name === "LOL") return 42 14 | return name.length 15 | } 16 | 17 | class Sample { 18 | /** 19 | * Docs 20 | */ 21 | test(name: string) { 22 | return name.length 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/refactors/makeSchemaOpaque.ts: -------------------------------------------------------------------------------- 1 | // 4:17 2 | import * as Schema from "effect/Schema" 3 | 4 | export const MyStruct = Schema.Struct({ 5 | id: Schema.Number, 6 | name: Schema.String 7 | }) 8 | -------------------------------------------------------------------------------- /examples/refactors/makeSchemaOpaqueWithNs_shortImport.ts: -------------------------------------------------------------------------------- 1 | // 4:17 2 | import { Schema } from "effect" 3 | 4 | export const MyStruct = Schema.Struct({ 5 | id: Schema.Number, 6 | name: Schema.String 7 | }) 8 | -------------------------------------------------------------------------------- /examples/refactors/makeSchemaOpaque_brand.ts: -------------------------------------------------------------------------------- 1 | // 4:17 2 | import * as Schema from "effect/Schema" 3 | 4 | export const ProductId = Schema.NonEmptyString.pipe(Schema.brand("ProductId")) 5 | -------------------------------------------------------------------------------- /examples/refactors/makeSchemaOpaque_shortImport.ts: -------------------------------------------------------------------------------- 1 | // 4:17 2 | import { Schema } from "effect" 3 | 4 | export const MyStruct = Schema.Struct({ 5 | id: Schema.Number, 6 | name: Schema.String 7 | }) 8 | -------------------------------------------------------------------------------- /examples/refactors/makeSchemaOpaque_shortImportAlias.ts: -------------------------------------------------------------------------------- 1 | // 4:17 2 | import { Schema as S } from "effect" 3 | 4 | export const MyStruct = S.Struct({ 5 | id: S.Number, 6 | name: S.String 7 | }) 8 | -------------------------------------------------------------------------------- /examples/refactors/makeSchemaOpaque_union.ts: -------------------------------------------------------------------------------- 1 | // 4:17 2 | import * as Schema from "effect/Schema" 3 | 4 | export const MyUnion = Schema.Union( 5 | Schema.Literal("A"), 6 | Schema.Literal("B") 7 | ) 8 | -------------------------------------------------------------------------------- /examples/refactors/pipeableToDatafirst.ts: -------------------------------------------------------------------------------- 1 | // 5:16,14:16,20:16 2 | import * as T from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = pipe( 6 | T.succeed("Hello"), 7 | T.flatMap((_) => T.log(_)), 8 | T.zipRight(T.succeed(42)), 9 | T.map((_) => _ * 2) 10 | ) 11 | 12 | const noDataFirst = (value: string) => (eff: T.Effect) => pipe(eff, T.zipLeft(T.log(value))) 13 | 14 | const test2 = pipe( 15 | T.succeed("Hello"), 16 | T.flatMap((_) => T.log(_)), 17 | noDataFirst("42") 18 | ) 19 | 20 | const test3 = pipe( 21 | T.succeed("Hello"), 22 | T.flatMap((_) => T.log(_)), 23 | noDataFirst("a"), 24 | noDataFirst("b"), 25 | noDataFirst("c") 26 | ) 27 | -------------------------------------------------------------------------------- /examples/refactors/removeCurryArrow.ts: -------------------------------------------------------------------------------- 1 | // 7:12 2 | import * as T from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = pipe( 6 | T.succeed("Hello"), 7 | T.tap((_) => T.log(_)) 8 | ) 9 | -------------------------------------------------------------------------------- /examples/refactors/removeUnnecessaryEffectGen.ts: -------------------------------------------------------------------------------- 1 | // 4:24,8:24,12:24,18:24 2 | import * as Effect from "effect/Effect" 3 | 4 | export const test1 = Effect.gen(function*() { 5 | return yield* Effect.succeed(42) 6 | }) 7 | 8 | export const test_ = Effect.gen(function*() { 9 | return yield* Effect.succeed(42) 10 | }) 11 | 12 | export const test2 = Effect.gen(function*() { 13 | return yield* Effect.gen(function*() { 14 | return yield* Effect.succeed(42) 15 | }) 16 | }) 17 | 18 | export const test3 = Effect.succeed(42).pipe( 19 | Effect.andThen((a) => 20 | Effect.gen(function*() { 21 | return yield* Effect.succeed(a) 22 | }) 23 | ) 24 | ) 25 | -------------------------------------------------------------------------------- /examples/refactors/toggleLazyConst.ts: -------------------------------------------------------------------------------- 1 | // 3:7;3:10,5:7;5:10;7:10 2 | 3 | const test1 = 1 4 | 5 | const test2 = () => 1 6 | 7 | const test3 = () => { 8 | console.log("Hello") 9 | } 10 | -------------------------------------------------------------------------------- /examples/refactors/togglePipeStyle.ts: -------------------------------------------------------------------------------- 1 | // 5:54,7:32 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const toRegularPipe = Effect.succeed(42).pipe(Effect.map((x) => x * 2)) 6 | 7 | export const toPipeable = pipe(Effect.succeed(42), Effect.map((x) => x * 2)) 8 | -------------------------------------------------------------------------------- /examples/refactors/toggleReturnTypeAnnotation.ts: -------------------------------------------------------------------------------- 1 | // 4:32,6:32,8:32,12:18,16:18 2 | import * as T from "effect/Effect" 3 | 4 | export const test1 = () => T.succeed(42) 5 | 6 | export const test2 = () => (true ? T.succeed(42) : false) 7 | 8 | function sillyGenerics(value: A) { 9 | return T.fail(value) 10 | } 11 | 12 | function removeAnnotation(): number { 13 | return 42 14 | } 15 | 16 | function removeAnnotationWithSpace(): number { 17 | return 42 18 | } 19 | -------------------------------------------------------------------------------- /examples/refactors/toggleTypeAnnotation_schema.ts: -------------------------------------------------------------------------------- 1 | // 11:15 2 | import * as Effect from "effect/Effect" 3 | import * as ParseResult from "effect/ParseResult" 4 | import * as Schema from "effect/Schema" 5 | import * as ParseOption from "effect/SchemaAST" 6 | 7 | class Person extends Schema.TaggedClass("Person")("Person", { 8 | name: Schema.NonEmptyString, 9 | age: Schema.Int 10 | }) { 11 | static decode = Schema.decode(Person) 12 | } 13 | -------------------------------------------------------------------------------- /examples/refactors/toggleTypeAnnotation_simplify.ts: -------------------------------------------------------------------------------- 1 | // 7:18,8:17,9:18,11:18,13:18,19:18 2 | import * as Context from "effect/Context" 3 | import * as Effect from "effect/Effect" 4 | 5 | export interface Service {} 6 | 7 | export const simple = Effect.succeed(true) 8 | export const simpleFailure = Effect.fail("Hello") 9 | export const simpleRequire = Effect.context() 10 | 11 | export const inUnion = Math.random() > 0.1 ? Effect.succeed(true) : Effect.succeed(42) 12 | 13 | export const asArrowResult = () => Effect.succeed(true) 14 | 15 | declare const withOverloads: 16 | & ((a: 1) => Effect.Effect) 17 | & ((a: 2) => Effect.Effect) 18 | 19 | export const simplifyIntersection = withOverloads 20 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchemaClass.ts: -------------------------------------------------------------------------------- 1 | // 4:21 2 | import * as Schema from "effect/Schema" 3 | 4 | export interface MyStruct { 5 | prop: string 6 | } 7 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_conditionalType.ts: -------------------------------------------------------------------------------- 1 | // 3:15 2 | 3 | export type Test = { a: string } extends Record ? T : never 4 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_dataTypes.ts: -------------------------------------------------------------------------------- 1 | // 8:23 2 | import type * as Chunk from "effect/Chunk" 3 | import type * as Duration from "effect/Duration" 4 | import type * as Either from "effect/Either" 5 | import type * as Option from "effect/Option" 6 | import * as Schema from "effect/Schema" 7 | 8 | export interface MyStruct { 9 | optionProp: Option.Option 10 | eitherProp: Either.Either 11 | pickProp: Pick<{ a: string; b: boolean }, "a"> 12 | omitProp: Omit<{ a: string; b: boolean }, "b"> 13 | chunkProp: Chunk.Chunk 14 | durationProp: Duration.Duration 15 | } 16 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_indexSignature.ts: -------------------------------------------------------------------------------- 1 | // 4:21 2 | import * as Schema from "effect/Schema" 3 | 4 | export interface MyStruct { 5 | prop: 42 6 | [key: number]: string 7 | } 8 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_literal.ts: -------------------------------------------------------------------------------- 1 | // 4:15,6:15 2 | import * as Schema from "effect/Schema" 3 | 4 | export type Test = "a" | "b" | "c" | true | 42 5 | 6 | export type NoLiteralOptimization = { a: boolean } | "a" 7 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_noGenerics.ts: -------------------------------------------------------------------------------- 1 | // 3:22 2 | 3 | export interface MyType { 4 | _A: A 5 | } 6 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_typeAlias.ts: -------------------------------------------------------------------------------- 1 | // 3:15 2 | 3 | export type Test = { a: string; b: boolean } 4 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_typeOf.ts: -------------------------------------------------------------------------------- 1 | // 6:21 2 | import * as Schema from "effect/Schema" 3 | 4 | const myVar = "A" as const 5 | 6 | export interface MyStruct { 7 | prop: typeof myVar 8 | } 9 | -------------------------------------------------------------------------------- /examples/refactors/typeToEffectSchema_typeofKeyof.ts: -------------------------------------------------------------------------------- 1 | // 9:21 2 | import * as Schema from "effect/Schema" 3 | 4 | const myVar = { 5 | a: 1, 6 | b: 2 7 | } as const 8 | 9 | export interface MyStruct { 10 | prop: (typeof myVar)[keyof typeof myVar] 11 | } 12 | -------------------------------------------------------------------------------- /examples/refactors/wrapWithEffectGen.ts: -------------------------------------------------------------------------------- 1 | // 5:22;7:22;9:22;9:22-12:1;14:22;15:5 2 | import { pipe } from "effect" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const test1 = Effect.succeed(42) 6 | 7 | export const test3 = test1 8 | 9 | export const test2 = Effect.succeed(42).pipe( 10 | Effect.map((n) => n + 1), 11 | Effect.map((n) => n - 1) 12 | ) 13 | 14 | export const test4 = pipe( 15 | Effect.succeed(42), 16 | Effect.map((n) => n + 1), 17 | Effect.map((n) => n - 1) 18 | ) 19 | -------------------------------------------------------------------------------- /examples/refactors/wrapWithEffectGen_noclass.ts: -------------------------------------------------------------------------------- 1 | // 4:36 2 | import { Effect } from "effect" 3 | 4 | export class Asd extends Effect.Service()("Asd", { 5 | succeed: {} 6 | }) {} 7 | -------------------------------------------------------------------------------- /examples/refactors/wrapWithPipe.ts: -------------------------------------------------------------------------------- 1 | // 2:13-2:26,3:14-3:21 2 | const txt = "Hello World" 3 | const txt2 = "Hello" 4 | -------------------------------------------------------------------------------- /examples/renames/keyStrings.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Context from "effect/Context" 3 | 4 | export class MyService extends Context.Tag("MyService")() {} 7 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_contextTag.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Context from "effect/Context" 3 | 4 | export class MyClass extends Context.Tag("MyClass")() {} 5 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_dataTaggedClass.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Data from "effect/Data" 3 | 4 | export class MyClass extends Data.TaggedClass("MyClass")<{}> {} 5 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_dataTaggedError.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Data from "effect/Data" 3 | 4 | export class MyError extends Data.TaggedError("MyError")<{}> {} 5 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_effectService.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Effect from "effect/Effect" 3 | 4 | export class MyService extends Effect.Service()("MyService", { 5 | succeed: { value: 42 } 6 | }) {} 7 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_effectTag.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Effect from "effect/Effect" 3 | 4 | export class MyClass extends Effect.Tag("MyClass")() {} 5 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_taggedClass.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Schema from "effect/Schema" 3 | 4 | export class MyService extends Schema.TaggedClass("MyService")("MyService", {}) {} 5 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_taggedError.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Schema from "effect/Schema" 3 | 4 | export class MyService extends Schema.TaggedError("MyService")("MyService", {}) {} 5 | -------------------------------------------------------------------------------- /examples/renames/keyStrings_taggedRequest.ts: -------------------------------------------------------------------------------- 1 | // 4:20 2 | import * as Schema from "effect/Schema" 3 | 4 | export class MyService extends Schema.TaggedRequest("MyService")("MyService", { 5 | payload: {}, 6 | success: Schema.Void, 7 | failure: Schema.Never 8 | }) {} 9 | -------------------------------------------------------------------------------- /src/codegens.ts: -------------------------------------------------------------------------------- 1 | import { accessors } from "./codegens/accessors.js" 2 | 3 | export const codegens = [accessors] 4 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/catchUnfailableEffect.ts.codefixes: -------------------------------------------------------------------------------- 1 | catchUnfailableEffect_skipNextLine from 147 to 162 2 | catchUnfailableEffect_skipFile from 147 to 162 3 | catchUnfailableEffect_skipNextLine from 377 to 392 4 | catchUnfailableEffect_skipFile from 377 to 392 5 | catchUnfailableEffect_skipNextLine from 1067 to 1082 6 | catchUnfailableEffect_skipFile from 1067 to 1082 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/catchUnfailableEffect.ts.output: -------------------------------------------------------------------------------- 1 | Effect.catchAll 2 | 5:2 - 5:17 | 0 | Looks like the previous effect never fails, so probably this error handling will never be triggered. effect(catchUnfailableEffect) 3 | 4 | Effect.catchAll 5 | 14:2 - 14:17 | 0 | Looks like the previous effect never fails, so probably this error handling will never be triggered. effect(catchUnfailableEffect) 6 | 7 | Effect.catchAll 8 | 36:2 - 36:17 | 0 | Looks like the previous effect never fails, so probably this error handling will never be triggered. effect(catchUnfailableEffect) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/catchUnfailableEffect_variants.ts.codefixes: -------------------------------------------------------------------------------- 1 | catchUnfailableEffect_skipNextLine from 172 to 187 2 | catchUnfailableEffect_skipFile from 172 to 187 3 | catchUnfailableEffect_skipNextLine from 311 to 325 4 | catchUnfailableEffect_skipFile from 311 to 325 5 | catchUnfailableEffect_skipNextLine from 485 to 501 6 | catchUnfailableEffect_skipFile from 485 to 501 7 | catchUnfailableEffect_skipNextLine from 662 to 677 8 | catchUnfailableEffect_skipFile from 662 to 677 9 | catchUnfailableEffect_skipNextLine from 816 to 832 10 | catchUnfailableEffect_skipFile from 816 to 832 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch.ts.codefixes: -------------------------------------------------------------------------------- 1 | classSelfMismatch_fix from 578 to 603 2 | classSelfMismatch_skipNextLine from 578 to 603 3 | classSelfMismatch_skipFile from 578 to 603 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch.ts.output: -------------------------------------------------------------------------------- 1 | ValidServiceSelfParameter 2 | 13:25 - 13:50 | 1 | Self type parameter should be 'InvalidServiceSelfParameter' effect(classSelfMismatch) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_contextTag.ts.codefixes: -------------------------------------------------------------------------------- 1 | classSelfMismatch_fix from 543 to 558 2 | classSelfMismatch_skipNextLine from 543 to 558 3 | classSelfMismatch_skipFile from 543 to 558 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_contextTag.ts.output: -------------------------------------------------------------------------------- 1 | ValidContextTag 2 | 11:70 - 11:85 | 1 | Self type parameter should be 'InvalidContextTag' effect(classSelfMismatch) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_effectTag.ts.codefixes: -------------------------------------------------------------------------------- 1 | classSelfMismatch_fix from 539 to 554 2 | classSelfMismatch_skipNextLine from 539 to 554 3 | classSelfMismatch_skipFile from 539 to 554 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_effectTag.ts.output: -------------------------------------------------------------------------------- 1 | ValidContextTag 2 | 11:69 - 11:84 | 1 | Self type parameter should be 'InvalidContextTag' effect(classSelfMismatch) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_schema.ts.codefixes: -------------------------------------------------------------------------------- 1 | classSelfMismatch_fix from 387 to 403 2 | classSelfMismatch_skipNextLine from 387 to 403 3 | classSelfMismatch_skipFile from 387 to 403 4 | classSelfMismatch_fix from 883 to 905 5 | classSelfMismatch_skipNextLine from 883 to 905 6 | classSelfMismatch_skipFile from 883 to 905 7 | classSelfMismatch_fix from 1423 to 1445 8 | classSelfMismatch_skipNextLine from 1423 to 1445 9 | classSelfMismatch_skipFile from 1423 to 1445 10 | classSelfMismatch_fix from 2030 to 2054 11 | classSelfMismatch_skipNextLine from 2030 to 2054 12 | classSelfMismatch_skipFile from 2030 to 2054 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_schema.ts.output: -------------------------------------------------------------------------------- 1 | ValidSchemaClass 2 | 9:53 - 9:69 | 1 | Self type parameter should be 'InvalidSchemaClass' effect(classSelfMismatch) 3 | 4 | ValidSchemaTaggedClass 5 | 21:29 - 21:51 | 1 | Self type parameter should be 'InvalidSchemaTaggedClass' effect(classSelfMismatch) 6 | 7 | ValidSchemaTaggedError 8 | 34:29 - 34:51 | 1 | Self type parameter should be 'InvalidSchemaTaggedError' effect(classSelfMismatch) 9 | 10 | ValidSchemaTaggedRequest 11 | 49:31 - 49:55 | 1 | Self type parameter should be 'InvalidSchemaTaggedRequest' effect(classSelfMismatch) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_schemaFalsePositive.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_schemaFalsePositive.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_unionGiven.ts.classSelfMismatch_fix.from229to253.output: -------------------------------------------------------------------------------- 1 | // code fix classSelfMismatch_fix output for range 229 - 253 2 | import * as Context from "effect/Context" 3 | 4 | interface ServiceShape { 5 | value: number 6 | } 7 | 8 | export class OtherService extends Context.Tag("OtherService")() {} 9 | 10 | export class MyService extends Context.Tag("MyService")() {} 11 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_unionGiven.ts.classSelfMismatch_skipFile.from229to253.output: -------------------------------------------------------------------------------- 1 | // code fix classSelfMismatch_skipFile output for range 229 - 253 2 | /** @effect-diagnostics classSelfMismatch:skip-file */ 3 | import * as Context from "effect/Context" 4 | 5 | interface ServiceShape { 6 | value: number 7 | } 8 | 9 | export class OtherService extends Context.Tag("OtherService")() {} 10 | 11 | export class MyService extends Context.Tag("MyService")() {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_unionGiven.ts.classSelfMismatch_skipNextLine.from229to253.output: -------------------------------------------------------------------------------- 1 | // code fix classSelfMismatch_skipNextLine output for range 229 - 253 2 | import * as Context from "effect/Context" 3 | 4 | interface ServiceShape { 5 | value: number 6 | } 7 | 8 | export class OtherService extends Context.Tag("OtherService")() {} 9 | 10 | // @effect-diagnostics-next-line classSelfMismatch:off 11 | export class MyService extends Context.Tag("MyService")() {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_unionGiven.ts.codefixes: -------------------------------------------------------------------------------- 1 | classSelfMismatch_fix from 229 to 253 2 | classSelfMismatch_skipNextLine from 229 to 253 3 | classSelfMismatch_skipFile from 229 to 253 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/classSelfMismatch_unionGiven.ts.output: -------------------------------------------------------------------------------- 1 | MyService | OtherService 2 | 9:56 - 9:80 | 1 | Self type parameter should be 'MyService' effect(classSelfMismatch) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.codefixes: -------------------------------------------------------------------------------- 1 | deterministicKeys_fix from 317 to 344 2 | deterministicKeys_skipNextLine from 317 to 344 3 | deterministicKeys_skipFile from 317 to 344 4 | deterministicKeys_fix from 428 to 436 5 | deterministicKeys_skipNextLine from 428 to 436 6 | deterministicKeys_skipFile from 428 to 436 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.deterministicKeys_fix.from317to344.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_fix output for range 317 - 344 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default" }, { "target": "error", "pattern": "default" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("@effect/language-service/ExpectedServiceIdentifier")() 9 | {} 10 | 11 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.deterministicKeys_fix.from428to436.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_fix output for range 428 - 436 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default" }, { "target": "error", "pattern": "default" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("ExpectedServiceIdentifier")() 9 | {} 10 | 11 | export class ErrorA extends Data.TaggedError("@effect/language-service/ErrorA")<{}> {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.deterministicKeys_skipFile.from317to344.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipFile output for range 317 - 344 2 | /** @effect-diagnostics deterministicKeys:skip-file */ 3 | // @effect-diagnostics deterministicKeys:error 4 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default" }, { "target": "error", "pattern": "default" } ] } 5 | import * as Context from "effect/Context" 6 | import * as Data from "effect/Data" 7 | 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.deterministicKeys_skipFile.from428to436.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipFile output for range 428 - 436 2 | /** @effect-diagnostics deterministicKeys:skip-file */ 3 | // @effect-diagnostics deterministicKeys:error 4 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default" }, { "target": "error", "pattern": "default" } ] } 5 | import * as Context from "effect/Context" 6 | import * as Data from "effect/Data" 7 | 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.deterministicKeys_skipNextLine.from317to344.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipNextLine output for range 317 - 344 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default" }, { "target": "error", "pattern": "default" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | // @effect-diagnostics-next-line deterministicKeys:off 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.deterministicKeys_skipNextLine.from428to436.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipNextLine output for range 428 - 436 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default" }, { "target": "error", "pattern": "default" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("ExpectedServiceIdentifier")() 9 | {} 10 | 11 | // @effect-diagnostics-next-line deterministicKeys:off 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys.ts.output: -------------------------------------------------------------------------------- 1 | "ExpectedServiceIdentifier" 2 | 7:22 - 7:49 | 1 | Key should be '@effect/language-service/ExpectedServiceIdentifier' effect(deterministicKeys) 3 | 4 | "ErrorA" 5 | 10:45 - 10:53 | 1 | Key should be '@effect/language-service/ErrorA' effect(deterministicKeys) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_custom.ts.codefixes: -------------------------------------------------------------------------------- 1 | deterministicKeys_fix from 388 to 395 2 | deterministicKeys_skipNextLine from 388 to 395 3 | deterministicKeys_skipFile from 388 to 395 4 | deterministicKeys_fix from 530 to 542 5 | deterministicKeys_skipNextLine from 530 to 542 6 | deterministicKeys_skipFile from 530 to 542 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_custom.ts.output: -------------------------------------------------------------------------------- 1 | "Hello" 2 | 11:43 - 11:50 | 1 | Key should be '@effect/language-service/MyClass' effect(deterministicKeys) 3 | 4 | "TTLRequest" 5 | 17:5 - 17:17 | 1 | Key should be '@effect/language-service/TTLRequest' effect(deterministicKeys) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.codefixes: -------------------------------------------------------------------------------- 1 | deterministicKeys_fix from 331 to 358 2 | deterministicKeys_skipNextLine from 331 to 358 3 | deterministicKeys_skipFile from 331 to 358 4 | deterministicKeys_fix from 442 to 450 5 | deterministicKeys_skipNextLine from 442 to 450 6 | deterministicKeys_skipFile from 442 to 450 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.deterministicKeys_fix.from331to358.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_fix output for range 331 - 358 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("4e484a493c98073d")() 9 | {} 10 | 11 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.deterministicKeys_fix.from442to450.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_fix output for range 442 - 450 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("ExpectedServiceIdentifier")() 9 | {} 10 | 11 | export class ErrorA extends Data.TaggedError("34c252132a18b23d")<{}> {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.deterministicKeys_skipFile.from331to358.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipFile output for range 331 - 358 2 | /** @effect-diagnostics deterministicKeys:skip-file */ 3 | // @effect-diagnostics deterministicKeys:error 4 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] } 5 | import * as Context from "effect/Context" 6 | import * as Data from "effect/Data" 7 | 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.deterministicKeys_skipFile.from442to450.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipFile output for range 442 - 450 2 | /** @effect-diagnostics deterministicKeys:skip-file */ 3 | // @effect-diagnostics deterministicKeys:error 4 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] } 5 | import * as Context from "effect/Context" 6 | import * as Data from "effect/Data" 7 | 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.deterministicKeys_skipNextLine.from331to358.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipNextLine output for range 331 - 358 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | // @effect-diagnostics-next-line deterministicKeys:off 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.deterministicKeys_skipNextLine.from442to450.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipNextLine output for range 442 - 450 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "default-hashed" }, { "target": "error", "pattern": "default-hashed" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("ExpectedServiceIdentifier")() 9 | {} 10 | 11 | // @effect-diagnostics-next-line deterministicKeys:off 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_defaultHashed.ts.output: -------------------------------------------------------------------------------- 1 | "ExpectedServiceIdentifier" 2 | 7:22 - 7:49 | 1 | Key should be '4e484a493c98073d' effect(deterministicKeys) 3 | 4 | "ErrorA" 5 | 10:45 - 10:53 | 1 | Key should be '34c252132a18b23d' effect(deterministicKeys) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.codefixes: -------------------------------------------------------------------------------- 1 | deterministicKeys_fix from 339 to 366 2 | deterministicKeys_skipNextLine from 339 to 366 3 | deterministicKeys_skipFile from 339 to 366 4 | deterministicKeys_fix from 450 to 458 5 | deterministicKeys_skipNextLine from 450 to 458 6 | deterministicKeys_skipFile from 450 to 458 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.deterministicKeys_fix.from339to366.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_fix output for range 339 - 366 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "package-identifier" }, { "target": "error", "pattern": "package-identifier" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("@effect/language-service/ExpectedServiceIdentifier")() 9 | {} 10 | 11 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.deterministicKeys_fix.from450to458.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_fix output for range 450 - 458 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "package-identifier" }, { "target": "error", "pattern": "package-identifier" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("ExpectedServiceIdentifier")() 9 | {} 10 | 11 | export class ErrorA extends Data.TaggedError("@effect/language-service/ErrorA")<{}> {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.deterministicKeys_skipFile.from339to366.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipFile output for range 339 - 366 2 | /** @effect-diagnostics deterministicKeys:skip-file */ 3 | // @effect-diagnostics deterministicKeys:error 4 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "package-identifier" }, { "target": "error", "pattern": "package-identifier" } ] } 5 | import * as Context from "effect/Context" 6 | import * as Data from "effect/Data" 7 | 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.deterministicKeys_skipFile.from450to458.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipFile output for range 450 - 458 2 | /** @effect-diagnostics deterministicKeys:skip-file */ 3 | // @effect-diagnostics deterministicKeys:error 4 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "package-identifier" }, { "target": "error", "pattern": "package-identifier" } ] } 5 | import * as Context from "effect/Context" 6 | import * as Data from "effect/Data" 7 | 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.deterministicKeys_skipNextLine.from339to366.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipNextLine output for range 339 - 366 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "package-identifier" }, { "target": "error", "pattern": "package-identifier" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | // @effect-diagnostics-next-line deterministicKeys:off 8 | export class ExpectedServiceIdentifier 9 | extends Context.Tag("ExpectedServiceIdentifier")() 10 | {} 11 | 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.deterministicKeys_skipNextLine.from450to458.output: -------------------------------------------------------------------------------- 1 | // code fix deterministicKeys_skipNextLine output for range 450 - 458 2 | // @effect-diagnostics deterministicKeys:error 3 | // @test-config { "keyPatterns": [ { "target": "service", "pattern": "package-identifier" }, { "target": "error", "pattern": "package-identifier" } ] } 4 | import * as Context from "effect/Context" 5 | import * as Data from "effect/Data" 6 | 7 | export class ExpectedServiceIdentifier 8 | extends Context.Tag("ExpectedServiceIdentifier")() 9 | {} 10 | 11 | // @effect-diagnostics-next-line deterministicKeys:off 12 | export class ErrorA extends Data.TaggedError("ErrorA")<{}> {} 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/deterministicKeys_packageIdentifier.ts.output: -------------------------------------------------------------------------------- 1 | "ExpectedServiceIdentifier" 2 | 7:22 - 7:49 | 1 | Key should be '@effect/language-service/ExpectedServiceIdentifier' effect(deterministicKeys) 3 | 4 | "ErrorA" 5 | 10:45 - 10:53 | 1 | Key should be '@effect/language-service/ErrorA' effect(deterministicKeys) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/duplicatePackage.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/duplicatePackage.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectGenUsesAdapter.ts.codefixes: -------------------------------------------------------------------------------- 1 | effectGenUsesAdapter_skipNextLine from 232 to 233 2 | effectGenUsesAdapter_skipFile from 232 to 233 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectGenUsesAdapter.ts.effectGenUsesAdapter_skipFile.from232to233.output: -------------------------------------------------------------------------------- 1 | // code fix effectGenUsesAdapter_skipFile output for range 232 - 233 2 | /** @effect-diagnostics effectGenUsesAdapter:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | export const isValid = Effect.gen(function*() { 6 | const x = yield* Effect.succeed(1) 7 | return x 8 | }) 9 | 10 | // when the adapter usage is detected, warn 11 | export const isNotValid = Effect.gen(function*(_) { 12 | const x = yield* Effect.succeed(1) 13 | return x 14 | }) 15 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectGenUsesAdapter.ts.effectGenUsesAdapter_skipNextLine.from232to233.output: -------------------------------------------------------------------------------- 1 | // code fix effectGenUsesAdapter_skipNextLine output for range 232 - 233 2 | import * as Effect from "effect/Effect" 3 | 4 | export const isValid = Effect.gen(function*() { 5 | const x = yield* Effect.succeed(1) 6 | return x 7 | }) 8 | 9 | // when the adapter usage is detected, warn 10 | // @effect-diagnostics-next-line effectGenUsesAdapter:off 11 | export const isNotValid = Effect.gen(function*(_) { 12 | const x = yield* Effect.succeed(1) 13 | return x 14 | }) 15 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectGenUsesAdapter.ts.output: -------------------------------------------------------------------------------- 1 | _ 2 | 9:47 - 9:48 | 0 | The adapter of Effect.gen is not required anymore, it is now just an alias of pipe. effect(effectGenUsesAdapter) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectInVoidSuccess.ts.codefixes: -------------------------------------------------------------------------------- 1 | effectInVoidSuccess_skipNextLine from 94 to 106 2 | effectInVoidSuccess_skipFile from 94 to 106 3 | effectInVoidSuccess_skipNextLine from 241 to 428 4 | effectInVoidSuccess_skipFile from 241 to 428 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectInVoidSuccess.ts.effectInVoidSuccess_skipFile.from241to428.output: -------------------------------------------------------------------------------- 1 | // code fix effectInVoidSuccess_skipFile output for range 241 - 428 2 | /** @effect-diagnostics effectInVoidSuccess:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | import * as Stream from "effect/Stream" 5 | 6 | export const shouldReport: Effect.Effect = Effect.succeed(Effect.succeed(42)) 7 | 8 | export const shouldReport2 = Effect.suspend((): Effect.Effect => { 9 | return Stream.empty.pipe( 10 | Stream.runCollect, 11 | Effect.interruptible, 12 | Effect.matchCause({ 13 | onSuccess: () => "success", 14 | onFailure: () => Effect.fail("error") 15 | }) 16 | ) 17 | }) 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectInVoidSuccess.ts.effectInVoidSuccess_skipFile.from94to106.output: -------------------------------------------------------------------------------- 1 | // code fix effectInVoidSuccess_skipFile output for range 94 - 106 2 | /** @effect-diagnostics effectInVoidSuccess:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | import * as Stream from "effect/Stream" 5 | 6 | export const shouldReport: Effect.Effect = Effect.succeed(Effect.succeed(42)) 7 | 8 | export const shouldReport2 = Effect.suspend((): Effect.Effect => { 9 | return Stream.empty.pipe( 10 | Stream.runCollect, 11 | Effect.interruptible, 12 | Effect.matchCause({ 13 | onSuccess: () => "success", 14 | onFailure: () => Effect.fail("error") 15 | }) 16 | ) 17 | }) 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectInVoidSuccess.ts.effectInVoidSuccess_skipNextLine.from241to428.output: -------------------------------------------------------------------------------- 1 | // code fix effectInVoidSuccess_skipNextLine output for range 241 - 428 2 | import * as Effect from "effect/Effect" 3 | import * as Stream from "effect/Stream" 4 | 5 | export const shouldReport: Effect.Effect = Effect.succeed(Effect.succeed(42)) 6 | 7 | export const shouldReport2 = Effect.suspend((): Effect.Effect => { 8 | // @effect-diagnostics-next-line effectInVoidSuccess:off 9 | return Stream.empty.pipe( 10 | Stream.runCollect, 11 | Effect.interruptible, 12 | Effect.matchCause({ 13 | onSuccess: () => "success", 14 | onFailure: () => Effect.fail("error") 15 | }) 16 | ) 17 | }) 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectInVoidSuccess.ts.effectInVoidSuccess_skipNextLine.from94to106.output: -------------------------------------------------------------------------------- 1 | // code fix effectInVoidSuccess_skipNextLine output for range 94 - 106 2 | import * as Effect from "effect/Effect" 3 | import * as Stream from "effect/Stream" 4 | 5 | // @effect-diagnostics-next-line effectInVoidSuccess:off 6 | export const shouldReport: Effect.Effect = Effect.succeed(Effect.succeed(42)) 7 | 8 | export const shouldReport2 = Effect.suspend((): Effect.Effect => { 9 | return Stream.empty.pipe( 10 | Stream.runCollect, 11 | Effect.interruptible, 12 | Effect.matchCause({ 13 | onSuccess: () => "success", 14 | onFailure: () => Effect.fail("error") 15 | }) 16 | ) 17 | }) 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/effectInVoidSuccess.ts.output: -------------------------------------------------------------------------------- 1 | shouldReport 2 | 4:13 - 4:25 | 0 | There is a nested 'Effect' in the 'void' success channel, beware that this could lead to nested Effect> that won't be executed. effect(effectInVoidSuccess) 3 | 4 | return Stream.empty.pipe( 5 | Stream.runCollect, 6 | Effect.interruptible, 7 | Effect.matchCause({ 8 | onSuccess: () => "success", 9 | onFailure: () => Effect.fail("error") 10 | }) 11 | ) 12 | 7:2 - 14:3 | 0 | There is a nested 'Effect' in the 'void' success channel, beware that this could lead to nested Effect> that won't be executed. effect(effectInVoidSuccess) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect.ts.codefixes: -------------------------------------------------------------------------------- 1 | floatingEffect_skipNextLine from 76 to 102 2 | floatingEffect_skipFile from 76 to 102 3 | floatingEffect_skipNextLine from 104 to 116 4 | floatingEffect_skipFile from 104 to 116 5 | floatingEffect_skipNextLine from 202 to 214 6 | floatingEffect_skipFile from 202 to 214 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect.ts.output: -------------------------------------------------------------------------------- 1 | Effect.succeed("floating") 2 | 5:0 - 5:26 | 1 | Effect must be yielded or assigned to a variable. effect(floatingEffect) 3 | 4 | Effect.never 5 | 7:0 - 7:12 | 1 | Effect must be yielded or assigned to a variable. effect(floatingEffect) 6 | 7 | Effect.never 8 | 11:2 - 11:14 | 1 | Effect must be yielded or assigned to a variable. effect(floatingEffect) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLine.ts.codefixes: -------------------------------------------------------------------------------- 1 | floatingEffect_skipNextLine from 41 to 61 2 | floatingEffect_skipFile from 41 to 61 3 | floatingEffect_skipNextLine from 137 to 158 4 | floatingEffect_skipFile from 137 to 158 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLine.ts.floatingEffect_skipFile.from137to158.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipFile output for range 137 - 158 2 | /** @effect-diagnostics floatingEffect:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | Effect.succeed(true) 6 | /** @effect-diagnostics-next-line floatingEffect:off */ 7 | Effect.succeed(42) 8 | Effect.succeed(false) 9 | // @effect-diagnostics-next-line floatingEffect:off 10 | Effect.succeed(42) 11 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLine.ts.floatingEffect_skipFile.from41to61.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipFile output for range 41 - 61 2 | /** @effect-diagnostics floatingEffect:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | Effect.succeed(true) 6 | /** @effect-diagnostics-next-line floatingEffect:off */ 7 | Effect.succeed(42) 8 | Effect.succeed(false) 9 | // @effect-diagnostics-next-line floatingEffect:off 10 | Effect.succeed(42) 11 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLine.ts.floatingEffect_skipNextLine.from137to158.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipNextLine output for range 137 - 158 2 | import * as Effect from "effect/Effect" 3 | 4 | Effect.succeed(true) 5 | /** @effect-diagnostics-next-line floatingEffect:off */ 6 | Effect.succeed(42) 7 | // @effect-diagnostics-next-line floatingEffect:off 8 | Effect.succeed(false) 9 | // @effect-diagnostics-next-line floatingEffect:off 10 | Effect.succeed(42) 11 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLine.ts.floatingEffect_skipNextLine.from41to61.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipNextLine output for range 41 - 61 2 | import * as Effect from "effect/Effect" 3 | 4 | // @effect-diagnostics-next-line floatingEffect:off 5 | Effect.succeed(true) 6 | /** @effect-diagnostics-next-line floatingEffect:off */ 7 | Effect.succeed(42) 8 | Effect.succeed(false) 9 | // @effect-diagnostics-next-line floatingEffect:off 10 | Effect.succeed(42) 11 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLine.ts.output: -------------------------------------------------------------------------------- 1 | Effect.succeed(true) 2 | 3:0 - 3:20 | 1 | Effect must be yielded or assigned to a variable. effect(floatingEffect) 3 | 4 | Effect.succeed(false) 5 | 6:0 - 6:21 | 1 | Effect must be yielded or assigned to a variable. effect(floatingEffect) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLineFix.ts.codefixes: -------------------------------------------------------------------------------- 1 | floatingEffect_skipNextLine from 61 to 79 2 | floatingEffect_skipFile from 61 to 79 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLineFix.ts.floatingEffect_skipFile.from61to79.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipFile output for range 61 - 79 2 | /** @effect-diagnostics floatingEffect:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | function test() { 6 | Effect.succeed(42) 7 | } 8 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLineFix.ts.floatingEffect_skipNextLine.from61to79.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipNextLine output for range 61 - 79 2 | import * as Effect from "effect/Effect" 3 | 4 | function test() { 5 | // @effect-diagnostics-next-line floatingEffect:off 6 | Effect.succeed(42) 7 | } 8 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disableNextLineFix.ts.output: -------------------------------------------------------------------------------- 1 | Effect.succeed(42) 2 | 4:2 - 4:20 | 1 | Effect must be yielded or assigned to a variable. effect(floatingEffect) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.codefixes: -------------------------------------------------------------------------------- 1 | floatingEffect_skipNextLine from 91 to 108 2 | floatingEffect_skipFile from 91 to 108 3 | floatingEffect_skipNextLine from 225 to 242 4 | floatingEffect_skipFile from 225 to 242 5 | floatingEffect_skipNextLine from 298 to 315 6 | floatingEffect_skipFile from 298 to 315 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.floatingEffect_skipFile.from225to242.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipFile output for range 225 - 242 2 | /** @effect-diagnostics floatingEffect:skip-file */ 3 | /** @effect-diagnostics floatingEffect:warning */ 4 | import * as Effect from "effect/Effect" 5 | 6 | Effect.succeed(1) 7 | 8 | /** @effect-diagnostics floatingEffect:off */ 9 | 10 | Effect.succeed(1) 11 | 12 | /** @effect-diagnostics floatingEffect:error */ 13 | 14 | Effect.succeed(1) 15 | 16 | /** @effect-diagnostics floatingEffect:suggestion */ 17 | 18 | Effect.succeed(1) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.floatingEffect_skipFile.from298to315.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipFile output for range 298 - 315 2 | /** @effect-diagnostics floatingEffect:skip-file */ 3 | /** @effect-diagnostics floatingEffect:warning */ 4 | import * as Effect from "effect/Effect" 5 | 6 | Effect.succeed(1) 7 | 8 | /** @effect-diagnostics floatingEffect:off */ 9 | 10 | Effect.succeed(1) 11 | 12 | /** @effect-diagnostics floatingEffect:error */ 13 | 14 | Effect.succeed(1) 15 | 16 | /** @effect-diagnostics floatingEffect:suggestion */ 17 | 18 | Effect.succeed(1) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.floatingEffect_skipFile.from91to108.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipFile output for range 91 - 108 2 | /** @effect-diagnostics floatingEffect:skip-file */ 3 | /** @effect-diagnostics floatingEffect:warning */ 4 | import * as Effect from "effect/Effect" 5 | 6 | Effect.succeed(1) 7 | 8 | /** @effect-diagnostics floatingEffect:off */ 9 | 10 | Effect.succeed(1) 11 | 12 | /** @effect-diagnostics floatingEffect:error */ 13 | 14 | Effect.succeed(1) 15 | 16 | /** @effect-diagnostics floatingEffect:suggestion */ 17 | 18 | Effect.succeed(1) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.floatingEffect_skipNextLine.from225to242.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipNextLine output for range 225 - 242 2 | /** @effect-diagnostics floatingEffect:warning */ 3 | import * as Effect from "effect/Effect" 4 | 5 | Effect.succeed(1) 6 | 7 | /** @effect-diagnostics floatingEffect:off */ 8 | 9 | Effect.succeed(1) 10 | 11 | /** @effect-diagnostics floatingEffect:error */ 12 | 13 | // @effect-diagnostics-next-line floatingEffect:off 14 | Effect.succeed(1) 15 | 16 | /** @effect-diagnostics floatingEffect:suggestion */ 17 | 18 | Effect.succeed(1) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.floatingEffect_skipNextLine.from298to315.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipNextLine output for range 298 - 315 2 | /** @effect-diagnostics floatingEffect:warning */ 3 | import * as Effect from "effect/Effect" 4 | 5 | Effect.succeed(1) 6 | 7 | /** @effect-diagnostics floatingEffect:off */ 8 | 9 | Effect.succeed(1) 10 | 11 | /** @effect-diagnostics floatingEffect:error */ 12 | 13 | Effect.succeed(1) 14 | 15 | /** @effect-diagnostics floatingEffect:suggestion */ 16 | 17 | // @effect-diagnostics-next-line floatingEffect:off 18 | Effect.succeed(1) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.floatingEffect_skipNextLine.from91to108.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipNextLine output for range 91 - 108 2 | /** @effect-diagnostics floatingEffect:warning */ 3 | import * as Effect from "effect/Effect" 4 | 5 | // @effect-diagnostics-next-line floatingEffect:off 6 | Effect.succeed(1) 7 | 8 | /** @effect-diagnostics floatingEffect:off */ 9 | 10 | Effect.succeed(1) 11 | 12 | /** @effect-diagnostics floatingEffect:error */ 13 | 14 | Effect.succeed(1) 15 | 16 | /** @effect-diagnostics floatingEffect:suggestion */ 17 | 18 | Effect.succeed(1) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_disabled.ts.output: -------------------------------------------------------------------------------- 1 | Effect.succeed(1) 2 | 4:0 - 4:17 | 0 | Effect must be yielded or assigned to a variable. effect(floatingEffect) 3 | 4 | Effect.succeed(1) 5 | 12:0 - 12:17 | 1 | Effect must be yielded or assigned to a variable. effect(floatingEffect) 6 | 7 | Effect.succeed(1) 8 | 16:0 - 16:17 | 2 | Effect must be yielded or assigned to a variable. effect(floatingEffect) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_logicalAssignments.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_logicalAssignments.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_poolSubtype.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_poolSubtype.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_stream.ts.codefixes: -------------------------------------------------------------------------------- 1 | floatingEffect_skipNextLine from 134 to 152 2 | floatingEffect_skipFile from 134 to 152 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_stream.ts.floatingEffect_skipFile.from134to152.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipFile output for range 134 - 152 2 | /** @effect-diagnostics floatingEffect:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | import * as Stream from "effect/Stream" 5 | 6 | export const shouldWarn = Effect.gen(function*() { 7 | Stream.succeed(42) 8 | }) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_stream.ts.floatingEffect_skipNextLine.from134to152.output: -------------------------------------------------------------------------------- 1 | // code fix floatingEffect_skipNextLine output for range 134 - 152 2 | import * as Effect from "effect/Effect" 3 | import * as Stream from "effect/Stream" 4 | 5 | export const shouldWarn = Effect.gen(function*() { 6 | // @effect-diagnostics-next-line floatingEffect:off 7 | Stream.succeed(42) 8 | }) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/floatingEffect_stream.ts.output: -------------------------------------------------------------------------------- 1 | Stream.succeed(42) 2 | 5:2 - 5:20 | 1 | Effect-able Stream must be yielded or assigned to a variable. effect(floatingEffect) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/genericEffectServices.ts.codefixes: -------------------------------------------------------------------------------- 1 | genericEffectServices_skipNextLine from 159 to 171 2 | genericEffectServices_skipFile from 159 to 171 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/genericEffectServices.ts.genericEffectServices_skipFile.from159to171.output: -------------------------------------------------------------------------------- 1 | // code fix genericEffectServices_skipFile output for range 159 - 171 2 | /** @effect-diagnostics genericEffectServices:skip-file */ 3 | import { Effect } from "effect" 4 | 5 | export class ShouldNotReport extends Effect.Service()("ShouldNotReport", { 6 | succeed: {} 7 | }) {} 8 | 9 | export class ShouldReport<_A> extends Effect.Service>()("ShouldReport", { 10 | succeed: {} 11 | }) {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/genericEffectServices.ts.genericEffectServices_skipNextLine.from159to171.output: -------------------------------------------------------------------------------- 1 | // code fix genericEffectServices_skipNextLine output for range 159 - 171 2 | import { Effect } from "effect" 3 | 4 | export class ShouldNotReport extends Effect.Service()("ShouldNotReport", { 5 | succeed: {} 6 | }) {} 7 | 8 | // @effect-diagnostics-next-line genericEffectServices:off 9 | export class ShouldReport<_A> extends Effect.Service>()("ShouldReport", { 10 | succeed: {} 11 | }) {} 12 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/genericEffectServices.ts.output: -------------------------------------------------------------------------------- 1 | ShouldReport 2 | 7:13 - 7:25 | 0 | Effect Services with type parameters are not supported because they cannot be properly discriminated at runtime, which may cause unexpected behavior. effect(genericEffectServices) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.codefixes: -------------------------------------------------------------------------------- 1 | replaceWithUnbarrelledImport from 55 to 61 2 | importFromBarrel_skipNextLine from 55 to 61 3 | importFromBarrel_skipFile from 55 to 61 4 | replaceWithUnbarrelledImport from 87 to 101 5 | importFromBarrel_skipNextLine from 87 to 101 6 | importFromBarrel_skipFile from 87 to 101 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.importFromBarrel_skipFile.from55to61.output: -------------------------------------------------------------------------------- 1 | // code fix importFromBarrel_skipFile output for range 55 - 61 2 | /** @effect-diagnostics importFromBarrel:skip-file */ 3 | // @effect-diagnostics importFromBarrel:error 4 | import { Effect } from "effect" 5 | import { Predicate as P } from "effect" 6 | import { pipe } from "effect" 7 | import * as Schema from "effect/Schema" 8 | 9 | export const main = { 10 | a: Effect.void, 11 | b: P.isNumber, 12 | c: Schema.Number 13 | } 14 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.importFromBarrel_skipFile.from87to101.output: -------------------------------------------------------------------------------- 1 | // code fix importFromBarrel_skipFile output for range 87 - 101 2 | /** @effect-diagnostics importFromBarrel:skip-file */ 3 | // @effect-diagnostics importFromBarrel:error 4 | import { Effect } from "effect" 5 | import { Predicate as P } from "effect" 6 | import { pipe } from "effect" 7 | import * as Schema from "effect/Schema" 8 | 9 | export const main = { 10 | a: Effect.void, 11 | b: P.isNumber, 12 | c: Schema.Number 13 | } 14 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.importFromBarrel_skipNextLine.from55to61.output: -------------------------------------------------------------------------------- 1 | // code fix importFromBarrel_skipNextLine output for range 55 - 61 2 | // @effect-diagnostics importFromBarrel:error 3 | // @effect-diagnostics-next-line importFromBarrel:off 4 | import { Effect } from "effect" 5 | import { Predicate as P } from "effect" 6 | import { pipe } from "effect" 7 | import * as Schema from "effect/Schema" 8 | 9 | export const main = { 10 | a: Effect.void, 11 | b: P.isNumber, 12 | c: Schema.Number 13 | } 14 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.importFromBarrel_skipNextLine.from87to101.output: -------------------------------------------------------------------------------- 1 | // code fix importFromBarrel_skipNextLine output for range 87 - 101 2 | // @effect-diagnostics importFromBarrel:error 3 | import { Effect } from "effect" 4 | // @effect-diagnostics-next-line importFromBarrel:off 5 | import { Predicate as P } from "effect" 6 | import { pipe } from "effect" 7 | import * as Schema from "effect/Schema" 8 | 9 | export const main = { 10 | a: Effect.void, 11 | b: P.isNumber, 12 | c: Schema.Number 13 | } 14 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.output: -------------------------------------------------------------------------------- 1 | Effect 2 | 2:9 - 2:15 | 1 | Importing from barrel module effect is not allowed. effect(importFromBarrel) 3 | 4 | Predicate as P 5 | 3:9 - 3:23 | 1 | Importing from barrel module effect is not allowed. effect(importFromBarrel) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.replaceWithUnbarrelledImport.from55to61.output: -------------------------------------------------------------------------------- 1 | // code fix replaceWithUnbarrelledImport output for range 55 - 61 2 | // @effect-diagnostics importFromBarrel:error 3 | import * as Effect from "./node_modules/effect/dist/dts/Effect" 4 | import { Predicate as P } from "effect" 5 | import { pipe } from "effect" 6 | import * as Schema from "effect/Schema" 7 | 8 | export const main = { 9 | a: Effect.void, 10 | b: P.isNumber, 11 | c: Schema.Number 12 | } 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/importFromBarrel.ts.replaceWithUnbarrelledImport.from87to101.output: -------------------------------------------------------------------------------- 1 | // code fix replaceWithUnbarrelledImport output for range 87 - 101 2 | // @effect-diagnostics importFromBarrel:error 3 | import { Effect } from "effect" 4 | import * as P from "./node_modules/effect/dist/dts/Predicate" 5 | import { pipe } from "effect" 6 | import * as Schema from "effect/Schema" 7 | 8 | export const main = { 9 | a: Effect.void, 10 | b: P.isNumber, 11 | c: Schema.Number 12 | } 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements.ts.codefixes: -------------------------------------------------------------------------------- 1 | leakingRequirements_skipNextLine from 219 to 230 2 | leakingRequirements_skipFile from 219 to 230 3 | leakingRequirements_skipNextLine from 572 to 585 4 | leakingRequirements_skipFile from 572 to 585 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_genericTag.ts.codefixes: -------------------------------------------------------------------------------- 1 | leakingRequirements_skipNextLine from 373 to 425 2 | leakingRequirements_skipFile from 373 to 425 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_genericTag.ts.leakingRequirements_skipFile.from373to425.output: -------------------------------------------------------------------------------- 1 | // code fix leakingRequirements_skipFile output for range 373 - 425 2 | /** @effect-diagnostics leakingRequirements:skip-file */ 3 | import type { Effect } from "effect" 4 | import { Context } from "effect" 5 | 6 | export class FileSystem extends Context.Tag("FileSystem") Effect.Effect 8 | }>() {} 9 | 10 | interface LeakingService { 11 | writeCache: () => Effect.Effect 12 | readCache: Effect.Effect 13 | } 14 | 15 | export const GenericTag = Context.GenericTag("LeakingService") 16 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_genericTag.ts.leakingRequirements_skipNextLine.from373to425.output: -------------------------------------------------------------------------------- 1 | // code fix leakingRequirements_skipNextLine output for range 373 - 425 2 | import type { Effect } from "effect" 3 | import { Context } from "effect" 4 | 5 | export class FileSystem extends Context.Tag("FileSystem") Effect.Effect 7 | }>() {} 8 | 9 | interface LeakingService { 10 | writeCache: () => Effect.Effect 11 | readCache: Effect.Effect 12 | } 13 | 14 | // @effect-diagnostics-next-line leakingRequirements:off 15 | export const GenericTag = Context.GenericTag("LeakingService") 16 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_genericTag.ts.output: -------------------------------------------------------------------------------- 1 | Context.GenericTag("LeakingService") 2 | 13:26 - 13:78 | 2 | This Service is leaking the FileSystem requirement. 3 | If these requirements cannot be cached and are expected to be provided per method invocation (e.g. HttpServerRequest), you can either safely disable this diagnostic for this line through quickfixes or mark the service declaration with a JSDoc @effect-leakable-service. 4 | More info at https://effect.website/docs/requirements-management/layers/#avoiding-requirement-leakage effect(leakingRequirements) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_heuristic.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_heuristic.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_leakableJsDoc.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_leakableJsDoc.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_noScope.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/leakingRequirements_noScope.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_arrowReturnType.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectContext_skipNextLine from 703 to 740 2 | missingEffectContext_skipFile from 703 to 740 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_arrowReturnType.ts.output: -------------------------------------------------------------------------------- 1 | Effect.void.pipe(Effect.andThen(eff)) 2 | 19:2 - 19:39 | 1 | Missing 'R' in the expected Effect context. effect(missingEffectContext) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_callExpression.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectContext_skipNextLine from 505 to 523 2 | missingEffectContext_skipFile from 505 to 523 3 | missingEffectContext_skipNextLine from 675 to 693 4 | missingEffectContext_skipFile from 675 to 693 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_callExpression.ts.output: -------------------------------------------------------------------------------- 1 | effectWithServices 2 | 22:7 - 22:25 | 1 | Missing 'ServiceA | ServiceB | ServiceC' in the expected Effect context. effect(missingEffectContext) 3 | 4 | effectWithServices 5 | 29:20 - 29:38 | 1 | Missing 'ServiceC' in the expected Effect context. effect(missingEffectContext) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_conciseBody.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectContext_skipNextLine from 288 to 306 2 | missingEffectContext_skipFile from 288 to 306 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_conciseBody.ts.missingEffectContext_skipFile.from288to306.output: -------------------------------------------------------------------------------- 1 | // code fix missingEffectContext_skipFile output for range 288 - 306 2 | /** @effect-diagnostics missingEffectContext:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | class ServiceA extends Effect.Service()("ServiceA", { 6 | succeed: { a: 1 } 7 | }) {} 8 | 9 | declare const effectWithServices: Effect.Effect 10 | 11 | // @ts-expect-error 12 | export const conciseBody: () => Effect.Effect = () => effectWithServices 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_conciseBody.ts.missingEffectContext_skipNextLine.from288to306.output: -------------------------------------------------------------------------------- 1 | // code fix missingEffectContext_skipNextLine output for range 288 - 306 2 | import * as Effect from "effect/Effect" 3 | 4 | class ServiceA extends Effect.Service()("ServiceA", { 5 | succeed: { a: 1 } 6 | }) {} 7 | 8 | declare const effectWithServices: Effect.Effect 9 | 10 | // @ts-expect-error 11 | // @effect-diagnostics-next-line missingEffectContext:off 12 | export const conciseBody: () => Effect.Effect = () => effectWithServices 13 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_conciseBody.ts.output: -------------------------------------------------------------------------------- 1 | effectWithServices 2 | 10:62 - 10:80 | 1 | Missing 'ServiceA' in the expected Effect context. effect(missingEffectContext) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_lazy.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectContext_skipNextLine from 762 to 813 2 | missingEffectContext_skipFile from 762 to 813 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_lazy.ts.output: -------------------------------------------------------------------------------- 1 | return Effect.onExit(evaluate(), () => Effect.void) 2 | 19:2 - 19:53 | 1 | Missing 'ServiceA' in the expected Effect context. effect(missingEffectContext) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_pipe.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_pipe.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_plainAssignment.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectContext_skipNextLine from 555 to 573 2 | missingEffectContext_skipFile from 555 to 573 3 | missingEffectContext_skipNextLine from 652 to 667 4 | missingEffectContext_skipFile from 652 to 667 5 | missingEffectContext_skipNextLine from 867 to 895 6 | missingEffectContext_skipFile from 867 to 895 7 | missingEffectContext_skipNextLine from 1167 to 1185 8 | missingEffectContext_skipFile from 1167 to 1185 9 | missingEffectContext_skipNextLine from 1036 to 1051 10 | missingEffectContext_skipFile from 1036 to 1051 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_plainAssignment.ts.output: -------------------------------------------------------------------------------- 1 | missingAllServices 2 | 21:13 - 21:31 | 1 | Missing 'ServiceA | ServiceB | ServiceC' in the expected Effect context. effect(missingEffectContext) 3 | 4 | missingServiceC 5 | 24:13 - 24:28 | 1 | Missing 'ServiceC' in the expected Effect context. effect(missingEffectContext) 6 | 7 | missingServiceCWithSubtyping 8 | 29:13 - 29:41 | 1 | Missing 'ServiceC' in the expected Effect context. effect(missingEffectContext) 9 | 10 | missingServiceA 11 | 33:8 - 33:23 | 1 | Missing 'A' in the expected Effect context. effect(missingEffectContext) 12 | 13 | effectWithServices 14 | 38:10 - 38:28 | 1 | Missing 'ServiceA | ServiceB | ServiceC' in the expected Effect context. effect(missingEffectContext) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_returnSignature.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectContext_skipNextLine from 484 to 509 2 | missingEffectContext_skipFile from 484 to 509 3 | missingEffectContext_skipNextLine from 595 to 613 4 | missingEffectContext_skipFile from 595 to 613 5 | missingEffectContext_skipNextLine from 744 to 762 6 | missingEffectContext_skipFile from 744 to 762 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_returnSignature.ts.output: -------------------------------------------------------------------------------- 1 | return effectWithServices 2 | 19:2 - 19:27 | 1 | Missing 'ServiceA | ServiceB | ServiceC' in the expected Effect context. effect(missingEffectContext) 3 | 4 | effectWithServices 5 | 23:62 - 23:80 | 1 | Missing 'ServiceA | ServiceB | ServiceC' in the expected Effect context. effect(missingEffectContext) 6 | 7 | effectWithServices 8 | 27:2 - 27:20 | 1 | Missing 'ServiceC' in the expected Effect context. effect(missingEffectContext) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_skipArrowDefaults.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectContext_skipArrowDefaults.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_callExpression.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectError_catchAll from 402 to 418 2 | missingEffectError_skipNextLine from 402 to 418 3 | missingEffectError_skipFile from 402 to 418 4 | missingEffectError_skipNextLine from 559 to 575 5 | missingEffectError_skipFile from 559 to 575 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_callExpression.ts.output: -------------------------------------------------------------------------------- 1 | effectWithErrors 2 | 23:7 - 23:23 | 1 | Missing 'ErrorA | ErrorB | ErrorC' in the expected Effect errors. effect(missingEffectError) 3 | 4 | effectWithErrors 5 | 30:20 - 30:36 | 1 | Missing 'ErrorC' in the expected Effect errors. effect(missingEffectError) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_plainAssignment.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectError_catchAll from 400 to 416 2 | missingEffectError_skipNextLine from 400 to 416 3 | missingEffectError_skipFile from 400 to 416 4 | missingEffectError_skipNextLine from 493 to 506 5 | missingEffectError_skipFile from 493 to 506 6 | missingEffectError_skipNextLine from 682 to 708 7 | missingEffectError_skipFile from 682 to 708 8 | missingEffectError_catchAll from 956 to 972 9 | missingEffectError_skipNextLine from 956 to 972 10 | missingEffectError_skipFile from 956 to 972 11 | missingEffectError_catchAll from 843 to 856 12 | missingEffectError_skipNextLine from 843 to 856 13 | missingEffectError_skipFile from 843 to 856 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_plainAssignment.ts.output: -------------------------------------------------------------------------------- 1 | missingAllErrors 2 | 21:13 - 21:29 | 1 | Missing 'ErrorA | ErrorB | ErrorC' in the expected Effect errors. effect(missingEffectError) 3 | 4 | missingErrorC 5 | 24:13 - 24:26 | 1 | Missing 'ErrorC' in the expected Effect errors. effect(missingEffectError) 6 | 7 | missingErrorCWithSubtyping 8 | 29:13 - 29:39 | 1 | Missing 'ErrorC' in the expected Effect errors. effect(missingEffectError) 9 | 10 | missingErrorA 11 | 33:8 - 33:21 | 1 | Missing 'A' in the expected Effect errors. effect(missingEffectError) 12 | 13 | effectWithErrors 14 | 38:10 - 38:26 | 1 | Missing 'ErrorA | ErrorB | ErrorC' in the expected Effect errors. effect(missingEffectError) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_returnSignature.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectError_skipNextLine from 381 to 404 2 | missingEffectError_skipFile from 381 to 404 3 | missingEffectError_catchAll from 490 to 506 4 | missingEffectError_skipNextLine from 490 to 506 5 | missingEffectError_skipFile from 490 to 506 6 | missingEffectError_skipNextLine from 622 to 638 7 | missingEffectError_skipFile from 622 to 638 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_returnSignature.ts.output: -------------------------------------------------------------------------------- 1 | return effectWithErrors 2 | 20:2 - 20:25 | 1 | Missing 'ErrorA | ErrorB | ErrorC' in the expected Effect errors. effect(missingEffectError) 3 | 4 | effectWithErrors 5 | 24:62 - 24:78 | 1 | Missing 'ErrorA | ErrorB | ErrorC' in the expected Effect errors. effect(missingEffectError) 6 | 7 | effectWithErrors 8 | 27:94 - 27:110 | 1 | Missing 'ErrorC' in the expected Effect errors. effect(missingEffectError) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_tagged.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectError_catchAll from 437 to 453 2 | missingEffectError_tagged from 437 to 453 3 | missingEffectError_skipNextLine from 437 to 453 4 | missingEffectError_skipFile from 437 to 453 5 | missingEffectError_tagged from 546 to 562 6 | missingEffectError_skipNextLine from 546 to 562 7 | missingEffectError_skipFile from 546 to 562 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectError_tagged.ts.output: -------------------------------------------------------------------------------- 1 | effectWithErrors 2 | 19:62 - 19:78 | 1 | Missing 'ErrorA | ErrorB | ErrorC' in the expected Effect errors. effect(missingEffectError) 3 | 4 | effectWithErrors 5 | 22:71 - 22:87 | 1 | Missing 'ErrorA | ErrorC' in the expected Effect errors. effect(missingEffectError) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectServiceDependency.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingEffectServiceDependency_skipNextLine from 1006 to 1021 2 | missingEffectServiceDependency_skipFile from 1006 to 1021 3 | missingEffectServiceDependency_skipNextLine from 1405 to 1420 4 | missingEffectServiceDependency_skipFile from 1405 to 1420 5 | missingEffectServiceDependency_skipNextLine from 2492 to 2507 6 | missingEffectServiceDependency_skipFile from 2492 to 2507 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingEffectServiceDependency.ts.output: -------------------------------------------------------------------------------- 1 | InvalidService2 2 | 33:13 - 33:28 | 1 | Service 'SampleService1' is required but not provided by dependencies effect(missingEffectServiceDependency) 3 | 4 | InvalidService3 5 | 44:13 - 44:28 | 1 | Service 'SampleService2' is required but not provided by dependencies effect(missingEffectServiceDependency) 6 | 7 | InvalidService4 8 | 71:13 - 71:28 | 1 | Service 'SampleService2' is required but not provided by dependencies effect(missingEffectServiceDependency) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingReturnYieldStar.ts.codefixes: -------------------------------------------------------------------------------- 1 | missingReturnYieldStar_fix from 429 to 452 2 | missingReturnYieldStar_skipNextLine from 429 to 452 3 | missingReturnYieldStar_skipFile from 429 to 452 4 | missingReturnYieldStar_fix from 457 to 481 5 | missingReturnYieldStar_skipNextLine from 457 to 481 6 | missingReturnYieldStar_skipFile from 457 to 481 7 | missingReturnYieldStar_fix from 288 to 318 8 | missingReturnYieldStar_skipNextLine from 288 to 318 9 | missingReturnYieldStar_skipFile from 288 to 318 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingReturnYieldStar.ts.output: -------------------------------------------------------------------------------- 1 | yield* Effect.fail("no zero!") 2 | 11:6 - 11:36 | 1 | It is recommended to use return yield* for Effects that never succeed to signal a definitive exit point for type narrowing and tooling support. effect(missingReturnYieldStar) 3 | 4 | yield* Effect.interrupt 5 | 18:4 - 18:27 | 1 | It is recommended to use return yield* for Effects that never succeed to signal a definitive exit point for type narrowing and tooling support. effect(missingReturnYieldStar) 6 | 7 | yield* Effect.die("lol") 8 | 19:4 - 19:28 | 1 | It is recommended to use return yield* for Effects that never succeed to signal a definitive exit point for type narrowing and tooling support. effect(missingReturnYieldStar) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingStarInYieldEffectGen_nested.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/missingStarInYieldEffectGen_nested.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/multipleEffectProvide.ts.codefixes: -------------------------------------------------------------------------------- 1 | multipleEffectProvide_fix from 430 to 464 2 | multipleEffectProvide_skipNextLine from 430 to 464 3 | multipleEffectProvide_skipFile from 430 to 464 4 | multipleEffectProvide_fix from 564 to 598 5 | multipleEffectProvide_skipNextLine from 564 to 598 6 | multipleEffectProvide_skipFile from 564 to 598 7 | multipleEffectProvide_fix from 663 to 697 8 | multipleEffectProvide_skipNextLine from 663 to 697 9 | multipleEffectProvide_skipFile from 663 to 697 10 | multipleEffectProvide_fix from 793 to 827 11 | multipleEffectProvide_skipNextLine from 793 to 827 12 | multipleEffectProvide_skipFile from 793 to 827 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/outdatedEffectCodegen.ts.codefixes: -------------------------------------------------------------------------------- 1 | outdatedEffectCodegen_fix from 61 to 87 2 | outdatedEffectCodegen_ignore from 61 to 87 3 | outdatedEffectCodegen_skipNextLine from 61 to 87 4 | outdatedEffectCodegen_skipFile from 61 to 87 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/outdatedEffectCodegen.ts.outdatedEffectCodegen_fix.from61to87.output: -------------------------------------------------------------------------------- 1 | // code fix outdatedEffectCodegen_fix output for range 61 - 87 2 | import * as Effect from "effect/Effect" 3 | 4 | // @effect-codegens accessors:c9a2c8e8112b9d74 5 | export class MyService extends Effect.Service()("MyService", { 6 | accessors: true, 7 | effect: Effect.gen(function*() { 8 | return { 9 | constant: Effect.succeed("Hello, world!"), 10 | method: (value: A, _test: string) => Effect.succeed(value) 11 | } 12 | }) 13 | }) {static override method: ((value: A, _test: string) => Effect.Effect) = (...args) => Effect.andThen(MyService, _ => _.method(...args)) 14 | 15 | static myOtherStuff = 42 16 | } 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/outdatedEffectCodegen.ts.outdatedEffectCodegen_ignore.from61to87.output: -------------------------------------------------------------------------------- 1 | // code fix outdatedEffectCodegen_ignore output for range 61 - 87 2 | import * as Effect from "effect/Effect" 3 | 4 | // @effect-codegens accessors:c9a2c8e8112b9d74 5 | export class MyService extends Effect.Service()("MyService", { 6 | accessors: true, 7 | effect: Effect.gen(function*() { 8 | return { 9 | constant: Effect.succeed("Hello, world!"), 10 | method: (value: A, _test: string) => Effect.succeed(value) 11 | } 12 | }) 13 | }) { 14 | static myOtherStuff = 42 15 | } 16 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/outdatedEffectCodegen.ts.outdatedEffectCodegen_skipFile.from61to87.output: -------------------------------------------------------------------------------- 1 | // code fix outdatedEffectCodegen_skipFile output for range 61 - 87 2 | /** @effect-diagnostics outdatedEffectCodegen:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | // @effect-codegens accessors:67e9af40a9b0bd25 6 | export class MyService extends Effect.Service()("MyService", { 7 | accessors: true, 8 | effect: Effect.gen(function*() { 9 | return { 10 | constant: Effect.succeed("Hello, world!"), 11 | method: (value: A, _test: string) => Effect.succeed(value) 12 | } 13 | }) 14 | }) { 15 | static myOtherStuff = 42 16 | } 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/outdatedEffectCodegen.ts.outdatedEffectCodegen_skipNextLine.from61to87.output: -------------------------------------------------------------------------------- 1 | // code fix outdatedEffectCodegen_skipNextLine output for range 61 - 87 2 | import * as Effect from "effect/Effect" 3 | 4 | // @effect-codegens accessors:67e9af40a9b0bd25 5 | // @effect-diagnostics-next-line outdatedEffectCodegen:off 6 | export class MyService extends Effect.Service()("MyService", { 7 | accessors: true, 8 | effect: Effect.gen(function*() { 9 | return { 10 | constant: Effect.succeed("Hello, world!"), 11 | method: (value: A, _test: string) => Effect.succeed(value) 12 | } 13 | }) 14 | }) { 15 | static myOtherStuff = 42 16 | } 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/outdatedEffectCodegen.ts.output: -------------------------------------------------------------------------------- 1 | accessors:67e9af40a9b0bd25 2 | 3:20 - 3:46 | 0 | Codegen accessors result is outdated effect(outdatedEffectCodegen) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor.ts.codefixes: -------------------------------------------------------------------------------- 1 | overriddenSchemaConstructor_static from 660 to 700 2 | overriddenSchemaConstructor_fix from 660 to 700 3 | overriddenSchemaConstructor_skipNextLine from 660 to 700 4 | overriddenSchemaConstructor_skipFile from 660 to 700 5 | overriddenSchemaConstructor_static from 889 to 938 6 | overriddenSchemaConstructor_fix from 889 to 938 7 | overriddenSchemaConstructor_skipNextLine from 889 to 938 8 | overriddenSchemaConstructor_skipFile from 889 to 938 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor.ts.output: -------------------------------------------------------------------------------- 1 | constructor() { 2 | super({ a: 42 }) 3 | } 4 | 29:2 - 31:3 | 1 | Classes extending Schema must not override the constructor; this is because it silently breaks the schema decoding behaviour. If that's needed, we recommend instead to use a static 'new' method that constructs the instance. effect(overriddenSchemaConstructor) 5 | 6 | constructor() { 7 | super({} as any as never) 8 | } 9 | 36:2 - 38:3 | 1 | Classes extending Schema must not override the constructor; this is because it silently breaks the schema decoding behaviour. If that's needed, we recommend instead to use a static 'new' method that constructs the instance. effect(overriddenSchemaConstructor) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor_static.ts.codefixes: -------------------------------------------------------------------------------- 1 | overriddenSchemaConstructor_static from 260 to 316 2 | overriddenSchemaConstructor_fix from 260 to 316 3 | overriddenSchemaConstructor_skipNextLine from 260 to 316 4 | overriddenSchemaConstructor_skipFile from 260 to 316 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor_static.ts.output: -------------------------------------------------------------------------------- 1 | constructor() { 2 | super({ a: 42 }) 3 | this.b = 56 4 | } 5 | 10:2 - 13:3 | 1 | Classes extending Schema must not override the constructor; this is because it silently breaks the schema decoding behaviour. If that's needed, we recommend instead to use a static 'new' method that constructs the instance. effect(overriddenSchemaConstructor) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_fix.from260to316.output: -------------------------------------------------------------------------------- 1 | // code fix overriddenSchemaConstructor_fix output for range 260 - 316 2 | import * as Schema from "effect/Schema" 3 | 4 | export class InvalidBecauseOfConstructor 5 | extends Schema.Class("InvalidBecauseOfConstructor")({ 6 | a: Schema.Number 7 | }) 8 | { 9 | b: number 10 | } 11 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_skipFile.from260to316.output: -------------------------------------------------------------------------------- 1 | // code fix overriddenSchemaConstructor_skipFile output for range 260 - 316 2 | /** @effect-diagnostics overriddenSchemaConstructor:skip-file */ 3 | import * as Schema from "effect/Schema" 4 | 5 | export class InvalidBecauseOfConstructor 6 | extends Schema.Class("InvalidBecauseOfConstructor")({ 7 | a: Schema.Number 8 | }) 9 | { 10 | b: number 11 | // should be report here at constructor location 12 | constructor() { 13 | super({ a: 42 }) 14 | this.b = 56 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_skipNextLine.from260to316.output: -------------------------------------------------------------------------------- 1 | // code fix overriddenSchemaConstructor_skipNextLine output for range 260 - 316 2 | import * as Schema from "effect/Schema" 3 | 4 | // @effect-diagnostics-next-line overriddenSchemaConstructor:off 5 | export class InvalidBecauseOfConstructor 6 | extends Schema.Class("InvalidBecauseOfConstructor")({ 7 | a: Schema.Number 8 | }) 9 | { 10 | b: number 11 | // should be report here at constructor location 12 | constructor() { 13 | super({ a: 42 }) 14 | this.b = 56 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/overriddenSchemaConstructor_static.ts.overriddenSchemaConstructor_static.from260to316.output: -------------------------------------------------------------------------------- 1 | // code fix overriddenSchemaConstructor_static output for range 260 - 316 2 | import * as Schema from "effect/Schema" 3 | 4 | export class InvalidBecauseOfConstructor 5 | extends Schema.Class("InvalidBecauseOfConstructor")({ 6 | a: Schema.Number 7 | }) 8 | { 9 | b: number 10 | // should be report here at constructor location 11 | public static new() { 12 | const _this = new this({ a: 42 }) 13 | _this.b = 56 14 | return _this 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/returnEffectInGen_noDiagnostics.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/returnEffectInGen_noDiagnostics.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/returnEffectInGen_warn.ts.codefixes: -------------------------------------------------------------------------------- 1 | returnEffectInGen_fix from 86 to 113 2 | returnEffectInGen_skipNextLine from 86 to 113 3 | returnEffectInGen_skipFile from 86 to 113 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/returnEffectInGen_warn.ts.output: -------------------------------------------------------------------------------- 1 | return Effect.fail("error") 2 | 4:2 - 4:29 | 2 | You are returning an Effect-able type inside a generator function, and will result in nested Effect>. 3 | Maybe you wanted to return yield* instead? 4 | Nested Effect-able types may be intended if you plan to later manually flatten or unwrap this Effect, if so you can safely disable this diagnostic for this line through quickfixes. effect(returnEffectInGen) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/returnEffectInGen_warn.ts.returnEffectInGen_fix.from86to113.output: -------------------------------------------------------------------------------- 1 | // code fix returnEffectInGen_fix output for range 86 - 113 2 | import { Effect } from "effect" 3 | 4 | export const shouldWarn = Effect.gen(function*() { 5 | return yield* Effect.fail("error") 6 | }) 7 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/returnEffectInGen_warn.ts.returnEffectInGen_skipFile.from86to113.output: -------------------------------------------------------------------------------- 1 | // code fix returnEffectInGen_skipFile output for range 86 - 113 2 | /** @effect-diagnostics returnEffectInGen:skip-file */ 3 | import { Effect } from "effect" 4 | 5 | export const shouldWarn = Effect.gen(function*() { 6 | return Effect.fail("error") 7 | }) 8 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/returnEffectInGen_warn.ts.returnEffectInGen_skipNextLine.from86to113.output: -------------------------------------------------------------------------------- 1 | // code fix returnEffectInGen_skipNextLine output for range 86 - 113 2 | import { Effect } from "effect" 3 | 4 | export const shouldWarn = Effect.gen(function*() { 5 | // @effect-diagnostics-next-line returnEffectInGen:off 6 | return Effect.fail("error") 7 | }) 8 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/scopeInLayerEffect.ts.codefixes: -------------------------------------------------------------------------------- 1 | scopeInLayerEffect_skipNextLine from 296 to 500 2 | scopeInLayerEffect_skipFile from 296 to 500 3 | scopeInLayerEffect_skipNextLine from 502 to 740 4 | scopeInLayerEffect_skipFile from 502 to 740 5 | scopeInLayerEffect_scoped from 940 to 1082 6 | scopeInLayerEffect_skipNextLine from 940 to 1082 7 | scopeInLayerEffect_skipFile from 940 to 1082 8 | scopeInLayerEffect_scoped from 1108 to 1296 9 | scopeInLayerEffect_skipNextLine from 1108 to 1296 10 | scopeInLayerEffect_skipFile from 1108 to 1296 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/strictEffectProvide.ts.codefixes: -------------------------------------------------------------------------------- 1 | strictEffectProvide_skipNextLine from 569 to 616 2 | strictEffectProvide_skipFile from 569 to 616 3 | strictEffectProvide_skipNextLine from 427 to 461 4 | strictEffectProvide_skipFile from 427 to 461 5 | strictEffectProvide_skipNextLine from 735 to 769 6 | strictEffectProvide_skipFile from 735 to 769 7 | strictEffectProvide_skipNextLine from 893 to 963 8 | strictEffectProvide_skipFile from 893 to 963 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/tryCatchInEffectGen.ts.codefixes: -------------------------------------------------------------------------------- 1 | tryCatchInEffectGen_skipNextLine from 97 to 214 2 | tryCatchInEffectGen_skipFile from 97 to 214 3 | tryCatchInEffectGen_skipNextLine from 334 to 415 4 | tryCatchInEffectGen_skipFile from 334 to 415 5 | tryCatchInEffectGen_skipNextLine from 901 to 991 6 | tryCatchInEffectGen_skipFile from 901 to 991 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/tryCatchInEffectGen_finally.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/tryCatchInEffectGen_finally.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen.ts.codefixes: -------------------------------------------------------------------------------- 1 | unnecessaryEffectGen_fix from 283 to 345 2 | unnecessaryEffectGen_skipNextLine from 283 to 345 3 | unnecessaryEffectGen_skipFile from 283 to 345 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen.ts.output: -------------------------------------------------------------------------------- 1 | Effect.gen(function*() { 2 | return yield* Effect.succeed(42) 3 | }) 4 | 12:36 - 14:2 | 2 | This Effect.gen contains a single return statement. effect(unnecessaryEffectGen) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen.ts.unnecessaryEffectGen_fix.from283to345.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_fix output for range 283 - 345 2 | import * as Effect from "effect/Effect" 3 | 4 | export const shouldNotRant = Effect.gen(function*() { 5 | yield* Effect.succeed(true) 6 | return yield* Effect.succeed(42) 7 | }) 8 | 9 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 10 | return 42 11 | }) 12 | 13 | export const shouldRaiseForSingle = Effect.succeed(42) 14 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen.ts.unnecessaryEffectGen_skipFile.from283to345.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_skipFile output for range 283 - 345 2 | /** @effect-diagnostics unnecessaryEffectGen:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | export const shouldNotRant = Effect.gen(function*() { 6 | yield* Effect.succeed(true) 7 | return yield* Effect.succeed(42) 8 | }) 9 | 10 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 11 | return 42 12 | }) 13 | 14 | export const shouldRaiseForSingle = Effect.gen(function*() { 15 | return yield* Effect.succeed(42) 16 | }) 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen.ts.unnecessaryEffectGen_skipNextLine.from283to345.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_skipNextLine output for range 283 - 345 2 | import * as Effect from "effect/Effect" 3 | 4 | export const shouldNotRant = Effect.gen(function*() { 5 | yield* Effect.succeed(true) 6 | return yield* Effect.succeed(42) 7 | }) 8 | 9 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 10 | return 42 11 | }) 12 | 13 | // @effect-diagnostics-next-line unnecessaryEffectGen:off 14 | export const shouldRaiseForSingle = Effect.gen(function*() { 15 | return yield* Effect.succeed(42) 16 | }) 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_ifBlock.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_ifBlock.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.codefixes: -------------------------------------------------------------------------------- 1 | unnecessaryEffectGen_fix from 276 to 331 2 | unnecessaryEffectGen_skipNextLine from 276 to 331 3 | unnecessaryEffectGen_skipFile from 276 to 331 4 | unnecessaryEffectGen_fix from 379 to 427 5 | unnecessaryEffectGen_skipNextLine from 379 to 427 6 | unnecessaryEffectGen_skipFile from 379 to 427 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.output: -------------------------------------------------------------------------------- 1 | Effect.gen(function*() { 2 | yield* Effect.succeed(42) 3 | }) 4 | 12:36 - 14:2 | 2 | This Effect.gen contains a single return statement. effect(unnecessaryEffectGen) 5 | 6 | Effect.gen(function*() { 7 | yield* Effect.void 8 | }) 9 | 16:46 - 18:2 | 2 | This Effect.gen contains a single return statement. effect(unnecessaryEffectGen) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_fix.from276to331.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_fix output for range 276 - 331 2 | import * as Effect from "effect/Effect" 3 | 4 | export const shouldNotRant = Effect.gen(function*() { 5 | yield* Effect.succeed(true) 6 | yield* Effect.succeed(42) 7 | }) 8 | 9 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 10 | return 42 11 | }) 12 | 13 | export const shouldRaiseForSingle = Effect.asVoid(Effect.succeed(42)) 14 | 15 | export const shouldRaiseForSingleReturnVoid = Effect.gen(function*() { 16 | yield* Effect.void 17 | }) 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_fix.from379to427.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_fix output for range 379 - 427 2 | import * as Effect from "effect/Effect" 3 | 4 | export const shouldNotRant = Effect.gen(function*() { 5 | yield* Effect.succeed(true) 6 | yield* Effect.succeed(42) 7 | }) 8 | 9 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 10 | return 42 11 | }) 12 | 13 | export const shouldRaiseForSingle = Effect.gen(function*() { 14 | yield* Effect.succeed(42) 15 | }) 16 | 17 | export const shouldRaiseForSingleReturnVoid = Effect.void 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipFile.from276to331.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_skipFile output for range 276 - 331 2 | /** @effect-diagnostics unnecessaryEffectGen:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | export const shouldNotRant = Effect.gen(function*() { 6 | yield* Effect.succeed(true) 7 | yield* Effect.succeed(42) 8 | }) 9 | 10 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 11 | return 42 12 | }) 13 | 14 | export const shouldRaiseForSingle = Effect.gen(function*() { 15 | yield* Effect.succeed(42) 16 | }) 17 | 18 | export const shouldRaiseForSingleReturnVoid = Effect.gen(function*() { 19 | yield* Effect.void 20 | }) 21 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipFile.from379to427.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_skipFile output for range 379 - 427 2 | /** @effect-diagnostics unnecessaryEffectGen:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | 5 | export const shouldNotRant = Effect.gen(function*() { 6 | yield* Effect.succeed(true) 7 | yield* Effect.succeed(42) 8 | }) 9 | 10 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 11 | return 42 12 | }) 13 | 14 | export const shouldRaiseForSingle = Effect.gen(function*() { 15 | yield* Effect.succeed(42) 16 | }) 17 | 18 | export const shouldRaiseForSingleReturnVoid = Effect.gen(function*() { 19 | yield* Effect.void 20 | }) 21 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipNextLine.from276to331.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_skipNextLine output for range 276 - 331 2 | import * as Effect from "effect/Effect" 3 | 4 | export const shouldNotRant = Effect.gen(function*() { 5 | yield* Effect.succeed(true) 6 | yield* Effect.succeed(42) 7 | }) 8 | 9 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 10 | return 42 11 | }) 12 | 13 | // @effect-diagnostics-next-line unnecessaryEffectGen:off 14 | export const shouldRaiseForSingle = Effect.gen(function*() { 15 | yield* Effect.succeed(42) 16 | }) 17 | 18 | export const shouldRaiseForSingleReturnVoid = Effect.gen(function*() { 19 | yield* Effect.void 20 | }) 21 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryEffectGen_noReturn.ts.unnecessaryEffectGen_skipNextLine.from379to427.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryEffectGen_skipNextLine output for range 379 - 427 2 | import * as Effect from "effect/Effect" 3 | 4 | export const shouldNotRant = Effect.gen(function*() { 5 | yield* Effect.succeed(true) 6 | yield* Effect.succeed(42) 7 | }) 8 | 9 | export const shouldNotRaiseForNonEffect = Effect.gen(function*() { 10 | return 42 11 | }) 12 | 13 | export const shouldRaiseForSingle = Effect.gen(function*() { 14 | yield* Effect.succeed(42) 15 | }) 16 | 17 | // @effect-diagnostics-next-line unnecessaryEffectGen:off 18 | export const shouldRaiseForSingleReturnVoid = Effect.gen(function*() { 19 | yield* Effect.void 20 | }) 21 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.codefixes: -------------------------------------------------------------------------------- 1 | unnecessaryPipe_fix from 308 to 316 2 | unnecessaryPipe_skipNextLine from 308 to 316 3 | unnecessaryPipe_skipFile from 308 to 316 4 | unnecessaryPipe_fix from 352 to 377 5 | unnecessaryPipe_skipNextLine from 352 to 377 6 | unnecessaryPipe_skipFile from 352 to 377 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.output: -------------------------------------------------------------------------------- 1 | pipe(32) 2 | 13:28 - 13:36 | 2 | This pipe call contains no arguments. effect(unnecessaryPipe) 3 | 4 | Effect.succeed(32).pipe() 5 | 15:34 - 15:59 | 2 | This pipe call contains no arguments. effect(unnecessaryPipe) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.unnecessaryPipe_fix.from308to316.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipe_fix output for range 308 - 316 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const shouldNotReport = pipe( 6 | Effect.succeed("Hello"), 7 | Effect.map((x) => x + " World") 8 | ) 9 | 10 | export const shouldNotReport2 = Effect.succeed("Hello").pipe( 11 | Effect.map((x) => x + " World") 12 | ) 13 | 14 | export const shouldReport = 32 15 | 16 | export const shouldReportNoArgs = Effect.succeed(32).pipe() 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.unnecessaryPipe_fix.from352to377.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipe_fix output for range 352 - 377 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const shouldNotReport = pipe( 6 | Effect.succeed("Hello"), 7 | Effect.map((x) => x + " World") 8 | ) 9 | 10 | export const shouldNotReport2 = Effect.succeed("Hello").pipe( 11 | Effect.map((x) => x + " World") 12 | ) 13 | 14 | export const shouldReport = pipe(32) 15 | 16 | export const shouldReportNoArgs = Effect.succeed(32) 17 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.unnecessaryPipe_skipFile.from308to316.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipe_skipFile output for range 308 - 316 2 | /** @effect-diagnostics unnecessaryPipe:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | import { pipe } from "effect/Function" 5 | 6 | export const shouldNotReport = pipe( 7 | Effect.succeed("Hello"), 8 | Effect.map((x) => x + " World") 9 | ) 10 | 11 | export const shouldNotReport2 = Effect.succeed("Hello").pipe( 12 | Effect.map((x) => x + " World") 13 | ) 14 | 15 | export const shouldReport = pipe(32) 16 | 17 | export const shouldReportNoArgs = Effect.succeed(32).pipe() 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.unnecessaryPipe_skipFile.from352to377.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipe_skipFile output for range 352 - 377 2 | /** @effect-diagnostics unnecessaryPipe:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | import { pipe } from "effect/Function" 5 | 6 | export const shouldNotReport = pipe( 7 | Effect.succeed("Hello"), 8 | Effect.map((x) => x + " World") 9 | ) 10 | 11 | export const shouldNotReport2 = Effect.succeed("Hello").pipe( 12 | Effect.map((x) => x + " World") 13 | ) 14 | 15 | export const shouldReport = pipe(32) 16 | 17 | export const shouldReportNoArgs = Effect.succeed(32).pipe() 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.unnecessaryPipe_skipNextLine.from308to316.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipe_skipNextLine output for range 308 - 316 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const shouldNotReport = pipe( 6 | Effect.succeed("Hello"), 7 | Effect.map((x) => x + " World") 8 | ) 9 | 10 | export const shouldNotReport2 = Effect.succeed("Hello").pipe( 11 | Effect.map((x) => x + " World") 12 | ) 13 | 14 | // @effect-diagnostics-next-line unnecessaryPipe:off 15 | export const shouldReport = pipe(32) 16 | 17 | export const shouldReportNoArgs = Effect.succeed(32).pipe() 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipe.ts.unnecessaryPipe_skipNextLine.from352to377.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipe_skipNextLine output for range 352 - 377 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const shouldNotReport = pipe( 6 | Effect.succeed("Hello"), 7 | Effect.map((x) => x + " World") 8 | ) 9 | 10 | export const shouldNotReport2 = Effect.succeed("Hello").pipe( 11 | Effect.map((x) => x + " World") 12 | ) 13 | 14 | export const shouldReport = pipe(32) 15 | 16 | // @effect-diagnostics-next-line unnecessaryPipe:off 17 | export const shouldReportNoArgs = Effect.succeed(32).pipe() 18 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.codefixes: -------------------------------------------------------------------------------- 1 | unnecessaryPipeChain_fix from 106 to 185 2 | unnecessaryPipeChain_skipNextLine from 106 to 185 3 | unnecessaryPipeChain_skipFile from 106 to 185 4 | unnecessaryPipeChain_fix from 209 to 290 5 | unnecessaryPipeChain_skipNextLine from 209 to 290 6 | unnecessaryPipeChain_skipFile from 209 to 290 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.output: -------------------------------------------------------------------------------- 1 | Effect.succeed(1).pipe(Effect.map((x) => x + 2)).pipe(Effect.map((x) => x + 3)) 2 | 4:26 - 4:105 | 2 | Chained pipe calls can be simplified to a single pipe call effect(unnecessaryPipeChain) 3 | 4 | pipe(pipe(Effect.succeed(1), Effect.map((x) => x + 2)), Effect.map((x) => x + 3)) 5 | 6:22 - 6:103 | 2 | Chained pipe calls can be simplified to a single pipe call effect(unnecessaryPipeChain) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.unnecessaryPipeChain_fix.from106to185.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipeChain_fix output for range 106 - 185 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const asPipeable = Effect.succeed(1).pipe(Effect.map((x) => x + 2), Effect.map((x) => x + 3)) 6 | 7 | export const asPipe = pipe(pipe(Effect.succeed(1), Effect.map((x) => x + 2)), Effect.map((x) => x + 3)) 8 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.unnecessaryPipeChain_fix.from209to290.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipeChain_fix output for range 209 - 290 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const asPipeable = Effect.succeed(1).pipe(Effect.map((x) => x + 2)).pipe(Effect.map((x) => x + 3)) 6 | 7 | export const asPipe = pipe(Effect.succeed(1), Effect.map((x) => x + 2), Effect.map((x) => x + 3)) 8 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.unnecessaryPipeChain_skipFile.from106to185.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipeChain_skipFile output for range 106 - 185 2 | /** @effect-diagnostics unnecessaryPipeChain:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | import { pipe } from "effect/Function" 5 | 6 | export const asPipeable = Effect.succeed(1).pipe(Effect.map((x) => x + 2)).pipe(Effect.map((x) => x + 3)) 7 | 8 | export const asPipe = pipe(pipe(Effect.succeed(1), Effect.map((x) => x + 2)), Effect.map((x) => x + 3)) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.unnecessaryPipeChain_skipFile.from209to290.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipeChain_skipFile output for range 209 - 290 2 | /** @effect-diagnostics unnecessaryPipeChain:skip-file */ 3 | import * as Effect from "effect/Effect" 4 | import { pipe } from "effect/Function" 5 | 6 | export const asPipeable = Effect.succeed(1).pipe(Effect.map((x) => x + 2)).pipe(Effect.map((x) => x + 3)) 7 | 8 | export const asPipe = pipe(pipe(Effect.succeed(1), Effect.map((x) => x + 2)), Effect.map((x) => x + 3)) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.unnecessaryPipeChain_skipNextLine.from106to185.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipeChain_skipNextLine output for range 106 - 185 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | // @effect-diagnostics-next-line unnecessaryPipeChain:off 6 | export const asPipeable = Effect.succeed(1).pipe(Effect.map((x) => x + 2)).pipe(Effect.map((x) => x + 3)) 7 | 8 | export const asPipe = pipe(pipe(Effect.succeed(1), Effect.map((x) => x + 2)), Effect.map((x) => x + 3)) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unnecessaryPipeChain.ts.unnecessaryPipeChain_skipNextLine.from209to290.output: -------------------------------------------------------------------------------- 1 | // code fix unnecessaryPipeChain_skipNextLine output for range 209 - 290 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const asPipeable = Effect.succeed(1).pipe(Effect.map((x) => x + 2)).pipe(Effect.map((x) => x + 3)) 6 | 7 | // @effect-diagnostics-next-line unnecessaryPipeChain:off 8 | export const asPipe = pipe(pipe(Effect.succeed(1), Effect.map((x) => x + 2)), Effect.map((x) => x + 3)) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unsupportedServiceAccessors.ts.codefixes: -------------------------------------------------------------------------------- 1 | unsupportedServiceAccessors_enableCodegen from 1258 to 1286 2 | unsupportedServiceAccessors_skipNextLine from 1258 to 1286 3 | unsupportedServiceAccessors_skipFile from 1258 to 1286 4 | unsupportedServiceAccessors_enableCodegen from 1692 to 1730 5 | unsupportedServiceAccessors_skipNextLine from 1692 to 1730 6 | unsupportedServiceAccessors_skipFile from 1692 to 1730 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unsupportedServiceAccessors.ts.output: -------------------------------------------------------------------------------- 1 | ShouldWarnMethodWithGenerics 2 | 42:13 - 42:41 | 0 | Even if accessors are enabled, accessors for 'method' won't be available because the signature have generic type parameters or multiple call signatures. effect(unsupportedServiceAccessors) 3 | 4 | ShouldWarnMethodWithMultipleSignatures 5 | 56:13 - 56:51 | 0 | Even if accessors are enabled, accessors for 'methodWithMultipleSignaturesNoGenerics' won't be available because the signature have generic type parameters or multiple call signatures. effect(unsupportedServiceAccessors) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unsupportedServiceAccessors_effectTag.ts.codefixes: -------------------------------------------------------------------------------- 1 | unsupportedServiceAccessors_enableCodegen from 783 to 811 2 | unsupportedServiceAccessors_skipNextLine from 783 to 811 3 | unsupportedServiceAccessors_skipFile from 783 to 811 4 | unsupportedServiceAccessors_enableCodegen from 1152 to 1190 5 | unsupportedServiceAccessors_skipNextLine from 1152 to 1190 6 | unsupportedServiceAccessors_skipFile from 1152 to 1190 -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unsupportedServiceAccessors_effectTag.ts.output: -------------------------------------------------------------------------------- 1 | ShouldWarnMethodWithGenerics 2 | 20:13 - 20:41 | 0 | Even if accessors are enabled, accessors for 'method' won't be available because the signature have generic type parameters or multiple call signatures. effect(unsupportedServiceAccessors) 3 | 4 | ShouldWarnMethodWithMultipleSignatures 5 | 29:13 - 29:51 | 0 | Even if accessors are enabled, accessors for 'methodWithMultipleSignaturesNoGenerics' won't be available because the signature have generic type parameters or multiple call signatures. effect(unsupportedServiceAccessors) -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unsupportedServiceAccessors_primitive.ts.codefixes: -------------------------------------------------------------------------------- 1 | no codefixes -------------------------------------------------------------------------------- /test/__snapshots__/diagnostics/unsupportedServiceAccessors_primitive.ts.output: -------------------------------------------------------------------------------- 1 | // no diagnostics -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/duplicated.ts_AppLive.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["AppService.Default"] 3 | 1["EventService.Default"] 4 | 2["Analytics.Default"] 5 | 3["EventsRepository.Default"] 6 | 4["Database.Default"] 7 | 5["UserService.Default"] 8 | 6["UserRepository.Default"] 9 | 0 --> 1 10 | 0 --> 5 11 | 1 --> 3 12 | 1 --> 2 13 | 3 --> 4 14 | 5 --> 2 15 | 5 --> 6 16 | 6 --> 4 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/effect.ts_AppLive.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["DatabaseContext.Default"] 3 | 1["Layer.effectDiscard#40;Effect.gen#40;function*#40;#41; #123;
const databaseContext = yield* DatabaseContext

return yield* Effect.log#40;databaseContext.value#41;
#125;#41;#41;"] 4 | 1 --> 0 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/effect.ts_AppLive.quickinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Effect-TS/language-service/d6d5954f54f786f54245263f487d3d2bf8fb81da/test/__snapshots__/layer-graph/effect.ts_AppLive.quickinfo -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/followSymbols.ts_followSymbols.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["DbConnection.Default"] 3 | 1["Cache.Default
_in simple.ts at ln 18 col 70_"] 4 | 2["UserRepository.Default
_in simple.ts at ln 18 col 28_"] 5 | 2 --> 1 6 | 2 --> 0 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/followSymbols.ts_followSymbols.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - UserRepository provided at in simple.ts at ln 18 col 28 by `UserRepository.Default` 3 | * 4 | * - FileSystem required at in simple.ts at ln 18 col 70 by `Cache.Default` 5 | */ -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/followSymbols.ts_moreComplex.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["DbConnection.Default"] 3 | 1["FileSystem.Default
_in simple.ts at ln 25 col 60_"] 4 | 2["Cache.Default
_in simple.ts at ln 25 col 27_"] 5 | 3["UserRepository.Default"] 6 | 2 --> 1 7 | 3 --> 2 8 | 3 --> 0 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/followSymbols.ts_moreComplex.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - DbConnection provided at ln 7 col 95 by `DbConnection.Default` 3 | * - UserRepository provided at ln 7 col 27 by `UserRepository.Default` 4 | * 5 | * - DbConnection required at ln 7 col 27 by `UserRepository.Default` 6 | */ -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/generics.ts_NoComment.nested: -------------------------------------------------------------------------------- 1 | flowchart TB 2 | subgraph 0 ["`NoComment
_ln 19 col 13_`"] 3 | subgraph 0_wrap[" "] 4 | subgraph 0_provides [Provides] 5 | 0_provides_0["IsGeneric#lt;UserRepository#gt;"] 6 | end 7 | style 0_provides stroke:none 8 | end 9 | style 0_wrap fill:transparent 10 | style 0_wrap stroke:none 11 | end 12 | style 0 fill:transparent -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/generics.ts_NoComment.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["NoComment"] -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/generics.ts_NoComment.output: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["userLayer
provides: IsGeneric#lt;UserRepository#gt;
requires: "] -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/generics.ts_NoComment.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - IsGeneric provided at ln 19 col 13 by `NoComment` 3 | */ -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/incorrectInference.ts_testInference.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["providesStringLayer"] 3 | 1["requiresUser"] 4 | 1 --> 0 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/incorrectInference.ts_testInference.output: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["providesStringLayer
provides: string
requires: "] 3 | 1["Layer.provide#40;providesStringLayer#41;
provides:
requires: "] 4 | 2["requiresUser
provides:
requires: #quot;UsersString#quot;"] 5 | 3["requiresUser.pipe#40;Layer.provide#40;providesStringLayer#41;#41;
provides:
requires: "] 6 | 1 -->|"#123;#quot;relationship#quot;:#quot;call#quot;,#quot;argumentIndex#quot;:0#125;"| 0 7 | 1 -->|"#123;#quot;relationship#quot;:#quot;pipe#quot;#125;"| 2 8 | 3 -->|"#123;#quot;relationship#quot;:#quot;pipe#quot;#125;"| 1 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/incorrectInference.ts_testInference.quickinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Effect-TS/language-service/d6d5954f54f786f54245263f487d3d2bf8fb81da/test/__snapshots__/layer-graph/incorrectInference.ts_testInference.quickinfo -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/multiple.ts_AppLive.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["AppService.Default"] 3 | 1["EventService.Default"] 4 | 2["UserService.Default"] 5 | 3["Analytics.Default"] 6 | 4["EventsRepository.Default"] 7 | 5["UserRepository.Default"] 8 | 6["DatabaseLive"] 9 | 0 --> 1 10 | 0 --> 2 11 | 1 --> 4 12 | 1 --> 3 13 | 2 --> 3 14 | 2 --> 5 15 | 4 --> 6 16 | 5 --> 6 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_cacheWithFs.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["FileSystem.Default"] 3 | 1["Cache.Default"] 4 | 1 --> 0 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_cacheWithFs.output: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["FileSystem.Default
provides: FileSystem
requires: "] 3 | 1["Layer.provide#40;FileSystem.Default#41;
provides: Cache
requires: "] 4 | 2["Cache.Default
provides: Cache
requires: FileSystem"] 5 | 3["Cache.Default.pipe#40;Layer.provide#40;FileSystem.Default#41;#41;
provides: Cache
requires: "] 6 | 1 -->|"#123;#quot;relationship#quot;:#quot;call#quot;,#quot;argumentIndex#quot;:0#125;"| 0 7 | 1 -->|"#123;#quot;relationship#quot;:#quot;pipe#quot;#125;"| 2 8 | 3 -->|"#123;#quot;relationship#quot;:#quot;pipe#quot;#125;"| 1 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_cacheWithFs.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - Cache provided at ln 25 col 27 by `Cache.Default` 3 | */ -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_expect.nested: -------------------------------------------------------------------------------- 1 | flowchart TB 2 | subgraph 0 ["`expect
_ln 16 col 13_`"] 3 | subgraph 0_wrap[" "] 4 | subgraph 0_requires [Requires] 5 | 0_requires_0["Cache"] 6 | 0_requires_1["DbConnection"] 7 | end 8 | style 0_requires stroke:none 9 | subgraph 0_provides [Provides] 10 | 0_provides_0["UserRepository"] 11 | end 12 | style 0_provides stroke:none 13 | end 14 | style 0_wrap fill:transparent 15 | style 0_wrap stroke:none 16 | end 17 | style 0 fill:transparent -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_expect.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["expect"] -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_expect.output: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["UserRepository.Default
provides: UserRepository
requires: Cache, DbConnection"] -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_expect.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - UserRepository provided at ln 16 col 13 by `expect` 3 | * 4 | * - Cache required at ln 16 col 13 by `expect` 5 | * - DbConnection required at ln 16 col 13 by `expect` 6 | */ -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_liveWithPipeable.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["DbConnection.Default"] 3 | 1["Cache.Default"] 4 | 2["UserRepository.Default"] 5 | 2 --> 1 6 | 2 --> 0 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_liveWithPipeable.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - Cache provided at ln 21 col 21 by `Cache.Default` 3 | * - DbConnection provided at ln 22 col 14 by `DbConnection.Default` 4 | * - UserRepository provided at ln 20 col 32 by `UserRepository.Default` 5 | * 6 | * - DbConnection required at ln 20 col 32 by `UserRepository.Default` 7 | * - FileSystem required at ln 21 col 21 by `Cache.Default` 8 | */ -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_simplePipeIn.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["Cache.Default"] 3 | 1["UserRepository.Default"] 4 | 1 --> 0 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_simplePipeIn.output: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["Cache.Default
provides: Cache
requires: FileSystem"] 3 | 1["Layer.provide#40;Cache.Default#41;
provides: UserRepository
requires: FileSystem, DbConnection"] 4 | 2["UserRepository.Default
provides: UserRepository
requires: Cache, DbConnection"] 5 | 3["UserRepository.Default.pipe#40;Layer.provide#40;Cache.Default#41;#41;
provides: UserRepository
requires: FileSystem, DbConnection"] 6 | 1 -->|"#123;#quot;relationship#quot;:#quot;call#quot;,#quot;argumentIndex#quot;:0#125;"| 0 7 | 1 -->|"#123;#quot;relationship#quot;:#quot;pipe#quot;#125;"| 2 8 | 3 -->|"#123;#quot;relationship#quot;:#quot;pipe#quot;#125;"| 1 -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/simple.ts_simplePipeIn.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - UserRepository provided at ln 18 col 28 by `UserRepository.Default` 3 | * 4 | * - DbConnection required at ln 18 col 28 by `UserRepository.Default` 5 | * - FileSystem required at ln 18 col 70 by `Cache.Default` 6 | */ -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/specialChars.ts_NoComment.nested: -------------------------------------------------------------------------------- 1 | flowchart TB 2 | subgraph 0 ["`NoComment
_ln 15 col 13_`"] 3 | subgraph 0_wrap[" "] 4 | subgraph 0_provides [Provides] 5 | 0_provides_0["IsGeneric#lt;#quot;With#lt;Special#gt;Chars#!#quot;#gt;"] 6 | end 7 | style 0_provides stroke:none 8 | end 9 | style 0_wrap fill:transparent 10 | style 0_wrap stroke:none 11 | end 12 | style 0 fill:transparent -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/specialChars.ts_NoComment.outline: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["NoComment"] -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/specialChars.ts_NoComment.output: -------------------------------------------------------------------------------- 1 | flowchart TD 2 | 0["withSpecialCharsLayer
provides: IsGeneric#lt;#quot;With#lt;Special#gt;Chars#35;!#quot;#gt;
requires: "] -------------------------------------------------------------------------------- /test/__snapshots__/layer-graph/specialChars.ts_NoComment.quickinfo: -------------------------------------------------------------------------------- 1 | /** 2 | * - IsGeneric<"WithChars#!"> provided at ln 15 col 13 by `NoComment` 3 | */ -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToFn.ts.ln4col28.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToFn at position 4:28 2 | import * as T from "effect/Effect" 3 | 4 | export const refactorMe = T.fn("refactorMe")(function*(arg: string) { 5 | return yield* T.promise(() => Promise.resolve(1)) 6 | }) 7 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToFnTryPromise.ts.ln4col28.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToFnTryPromise at position 4:28 2 | import * as T from "effect/Effect" 3 | 4 | export class Error1 extends Data.TaggedError("Error1")<{ 5 | cause: unknown 6 | }> { } 7 | 8 | export const refactorMe = T.fn("refactorMe")(function*(arg: string) { 9 | return yield* T.tryPromise({ try: () => Promise.resolve(arg), catch: cause => new Error1({ cause }) }) 10 | }) 11 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToFn_fetch.ts.ln3col30.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToFn at position 3:30 2 | 3 | export const getUserName = Effect.fn("getUserName")(function*(userId: string) { 4 | const user = yield* Effect.promise(() => fetch(`https://api.example.com/users/${userId}`)) 5 | const userData = yield* Effect.promise(() => user.json()) 6 | return userData.name 7 | }) 8 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToFn_generics.ts.ln4col28.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToFn at position 4:28 2 | import * as Effect from "effect/Effect" 3 | 4 | export const refactorMe = Effect.fn("refactorMe")(function* (arg: X) { 5 | return yield* Effect.promise(() => Promise.resolve(arg)) 6 | }) 7 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToGen.ts.ln4col28.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToGen at position 4:28 2 | import * as T from "effect/Effect" 3 | 4 | export function refactorMe(arg: string) { 5 | return T.gen(function*() { 6 | return yield* T.promise(() => Promise.resolve(1)) 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToGen_anonymous.ts.ln13col41.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToGen at position 13:41 2 | import * as Effect from "effect/Effect" 3 | 4 | const asyncFunctionDeclaration = async function() { 5 | const response = await fetch("test") 6 | if (response.ok) { 7 | const y = await response.json() 8 | return y 9 | } 10 | return null 11 | } 12 | 13 | const asyncArrowFunctionExpression = () => Effect.gen(function*() { 14 | const response = yield* Effect.promise(() => fetch("test")) 15 | if (response.ok) { 16 | const y = yield* Effect.promise(() => response.json()) 17 | return y 18 | } 19 | return null 20 | }) 21 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToGen_anonymous.ts.ln4col44.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToGen at position 4:44 2 | import * as Effect from "effect/Effect" 3 | 4 | const asyncFunctionDeclaration = function() { 5 | return Effect.gen(function*() { 6 | const response = yield* Effect.promise(() => fetch("test")) 7 | if (response.ok) { 8 | const y = yield* Effect.promise(() => response.json()) 9 | return y 10 | } 11 | return null 12 | }) 13 | } 14 | 15 | const asyncArrowFunctionExpression = async () => { 16 | const response = await fetch("test") 17 | if (response.ok) { 18 | const y = await response.json() 19 | return y 20 | } 21 | return null 22 | } 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/asyncAwaitToGen_namedImport.ts.ln4col28.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor asyncAwaitToGen at position 4:28 2 | import { Effect as T } from "effect" 3 | 4 | export function refactorMe(arg: string) { 5 | return T.gen(function*() { 6 | return yield* T.promise(() => Promise.resolve(1)) 7 | }) 8 | } 9 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/effectGenToFn_classMethod.ts.ln6col17.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor effectGenToFn at position 6:17 2 | import * as Eff from "effect/Effect" 3 | 4 | class Test { 5 | methodReturnsEffect = Eff.fn("methodReturnsEffect")(function*(arg1: number, arg2: number) { 6 | const a = yield* Eff.succeed(arg1) 7 | const b = yield* Eff.succeed(arg2) 8 | return a + b 9 | }) 10 | } 11 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/effectGenToFn_mixedPipes.ts.ln7col13.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor effectGenToFn at position 7:13 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = Effect.fn("test")(function*() { 6 | const test = "test" 7 | return yield* Effect.succeed(test) 8 | }, Effect.asVoid, Effect.tapError(Effect.logError)) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/effectGenToFn_withPipes.ts.ln7col13.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor effectGenToFn at position 7:13 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = Effect.fn("test")(function*() { 6 | const test = "test" 7 | return yield* Effect.succeed(test) 8 | }, Effect.tapError(Effect.logError)) 9 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/functionToArrow.ts.ln12col20.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor functionToArrow at position 12:20 2 | /** 3 | * Docs 4 | */ 5 | export function myTest(name: string) { 6 | return name.length 7 | } 8 | 9 | /** 10 | * Docs 11 | */ 12 | export const myTest2 = (name: string) => { 13 | if (name === "LOL") return 42 14 | return name.length 15 | } 16 | 17 | class Sample { 18 | /** 19 | * Docs 20 | */ 21 | test(name: string) { 22 | return name.length 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/functionToArrow.ts.ln21col5.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor functionToArrow at position 21:5 2 | /** 3 | * Docs 4 | */ 5 | export function myTest(name: string) { 6 | return name.length 7 | } 8 | 9 | /** 10 | * Docs 11 | */ 12 | export function myTest2(name: string) { 13 | if (name === "LOL") return 42 14 | return name.length 15 | } 16 | 17 | class Sample { 18 | /** 19 | * Docs 20 | */ 21 | test = (name: string) => name.length 22 | } 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/functionToArrow.ts.ln5col20.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor functionToArrow at position 5:20 2 | /** 3 | * Docs 4 | */ 5 | export const myTest = (name: string) => name.length 6 | 7 | /** 8 | * Docs 9 | */ 10 | export function myTest2(name: string) { 11 | if (name === "LOL") return 42 12 | return name.length 13 | } 14 | 15 | class Sample { 16 | /** 17 | * Docs 18 | */ 19 | test(name: string) { 20 | return name.length 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/makeSchemaOpaque.ts.ln4col17.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor makeSchemaOpaque at position 4:17 2 | import * as Schema from "effect/Schema" 3 | 4 | export const MyStruct_ = Schema.Struct({ 5 | id: Schema.Number, 6 | name: Schema.String 7 | }) 8 | 9 | export interface MyStruct extends Schema.Schema.Type { } 10 | export interface MyStructEncoded extends Schema.Schema.Encoded { } 11 | export type MyStructContext = Schema.Schema.Context 12 | export const MyStruct: Schema.Schema = MyStruct_ 13 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/makeSchemaOpaqueWithNs_shortImport.ts.ln4col17.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor makeSchemaOpaqueWithNs at position 4:17 2 | import { Schema } from "effect" 3 | 4 | export const MyStruct_ = Schema.Struct({ 5 | id: Schema.Number, 6 | name: Schema.String 7 | }) 8 | 9 | export interface MyStruct extends Schema.Schema.Type { } 10 | export namespace MyStruct { 11 | export interface Encoded extends Schema.Schema.Encoded { } 12 | export type Context = Schema.Schema.Context 13 | } 14 | export const MyStruct: Schema.Schema = MyStruct_ 15 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/makeSchemaOpaque_brand.ts.ln4col17.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor makeSchemaOpaque at position 4:17 2 | import * as Schema from "effect/Schema" 3 | 4 | export const ProductId_ = Schema.NonEmptyString.pipe(Schema.brand("ProductId")) 5 | 6 | export type ProductId = Schema.Schema.Type 7 | export type ProductIdEncoded = Schema.Schema.Encoded 8 | export type ProductIdContext = Schema.Schema.Context 9 | export const ProductId: Schema.Schema = ProductId_ 10 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/makeSchemaOpaque_shortImport.ts.ln4col17.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor makeSchemaOpaque at position 4:17 2 | import { Schema } from "effect" 3 | 4 | export const MyStruct_ = Schema.Struct({ 5 | id: Schema.Number, 6 | name: Schema.String 7 | }) 8 | 9 | export interface MyStruct extends Schema.Schema.Type { } 10 | export interface MyStructEncoded extends Schema.Schema.Encoded { } 11 | export type MyStructContext = Schema.Schema.Context 12 | export const MyStruct: Schema.Schema = MyStruct_ 13 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/makeSchemaOpaque_shortImportAlias.ts.ln4col17.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor makeSchemaOpaque at position 4:17 2 | import { Schema as S } from "effect" 3 | 4 | export const MyStruct_ = S.Struct({ 5 | id: S.Number, 6 | name: S.String 7 | }) 8 | 9 | export interface MyStruct extends S.Schema.Type { } 10 | export interface MyStructEncoded extends S.Schema.Encoded { } 11 | export type MyStructContext = S.Schema.Context 12 | export const MyStruct: S.Schema = MyStruct_ 13 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/makeSchemaOpaque_union.ts.ln4col17.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor makeSchemaOpaque at position 4:17 2 | import * as Schema from "effect/Schema" 3 | 4 | export const MyUnion_ = Schema.Union( 5 | Schema.Literal("A"), 6 | Schema.Literal("B") 7 | ) 8 | 9 | export type MyUnion = Schema.Schema.Type 10 | export type MyUnionEncoded = Schema.Schema.Encoded 11 | export type MyUnionContext = Schema.Schema.Context 12 | export const MyUnion: Schema.Schema = MyUnion_ 13 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/pipeableToDatafirst.ts.ln14col16.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor pipeableToDatafirst at position 14:16 2 | import * as T from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = pipe( 6 | T.succeed("Hello"), 7 | T.flatMap((_) => T.log(_)), 8 | T.zipRight(T.succeed(42)), 9 | T.map((_) => _ * 2) 10 | ) 11 | 12 | const noDataFirst = (value: string) => (eff: T.Effect) => pipe(eff, T.zipLeft(T.log(value))) 13 | 14 | const test2 = pipe(T.flatMap(T.succeed("Hello"), (_) => T.log(_)), noDataFirst("42")) 15 | 16 | const test3 = pipe( 17 | T.succeed("Hello"), 18 | T.flatMap((_) => T.log(_)), 19 | noDataFirst("a"), 20 | noDataFirst("b"), 21 | noDataFirst("c") 22 | ) 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/pipeableToDatafirst.ts.ln20col16.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor pipeableToDatafirst at position 20:16 2 | import * as T from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = pipe( 6 | T.succeed("Hello"), 7 | T.flatMap((_) => T.log(_)), 8 | T.zipRight(T.succeed(42)), 9 | T.map((_) => _ * 2) 10 | ) 11 | 12 | const noDataFirst = (value: string) => (eff: T.Effect) => pipe(eff, T.zipLeft(T.log(value))) 13 | 14 | const test2 = pipe( 15 | T.succeed("Hello"), 16 | T.flatMap((_) => T.log(_)), 17 | noDataFirst("42") 18 | ) 19 | 20 | const test3 = pipe(T.flatMap(T.succeed("Hello"), (_) => T.log(_)), noDataFirst("a"), 21 | noDataFirst("b"), 22 | noDataFirst("c")) 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/pipeableToDatafirst.ts.ln5col16.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor pipeableToDatafirst at position 5:16 2 | import * as T from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | const test = T.map(T.zipRight(T.flatMap(T.succeed("Hello"), (_) => T.log(_)), T.succeed(42)), (_) => _ * 2) 6 | 7 | const noDataFirst = (value: string) => (eff: T.Effect) => pipe(eff, T.zipLeft(T.log(value))) 8 | 9 | const test2 = pipe( 10 | T.succeed("Hello"), 11 | T.flatMap((_) => T.log(_)), 12 | noDataFirst("42") 13 | ) 14 | 15 | const test3 = pipe( 16 | T.succeed("Hello"), 17 | T.flatMap((_) => T.log(_)), 18 | noDataFirst("a"), 19 | noDataFirst("b"), 20 | noDataFirst("c") 21 | ) 22 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/removeUnnecessaryEffectGen.ts.ln12col24.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor removeUnnecessaryEffectGen at position 12:24 2 | import * as Effect from "effect/Effect" 3 | 4 | export const test1 = Effect.gen(function*() { 5 | return yield* Effect.succeed(42) 6 | }) 7 | 8 | export const test_ = Effect.gen(function*() { 9 | return yield* Effect.succeed(42) 10 | }) 11 | 12 | export const test2 = Effect.gen(function*() { 13 | return yield* Effect.succeed(42) 14 | }) 15 | 16 | export const test3 = Effect.succeed(42).pipe( 17 | Effect.andThen((a) => 18 | Effect.gen(function*() { 19 | return yield* Effect.succeed(a) 20 | }) 21 | ) 22 | ) 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/removeUnnecessaryEffectGen.ts.ln18col24.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor removeUnnecessaryEffectGen at position 18:24 2 | import * as Effect from "effect/Effect" 3 | 4 | export const test1 = Effect.gen(function*() { 5 | return yield* Effect.succeed(42) 6 | }) 7 | 8 | export const test_ = Effect.gen(function*() { 9 | return yield* Effect.succeed(42) 10 | }) 11 | 12 | export const test2 = Effect.gen(function*() { 13 | return yield* Effect.gen(function*() { 14 | return yield* Effect.succeed(42) 15 | }) 16 | }) 17 | 18 | export const test3 = Effect.succeed(42).pipe( 19 | Effect.andThen((a) => 20 | Effect.gen(function*() { 21 | return yield* Effect.succeed(a) 22 | }) 23 | ) 24 | ) 25 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/removeUnnecessaryEffectGen.ts.ln4col24.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor removeUnnecessaryEffectGen at position 4:24 2 | import * as Effect from "effect/Effect" 3 | 4 | export const test1 = Effect.succeed(42) 5 | 6 | export const test_ = Effect.gen(function*() { 7 | return yield* Effect.succeed(42) 8 | }) 9 | 10 | export const test2 = Effect.gen(function*() { 11 | return yield* Effect.gen(function*() { 12 | return yield* Effect.succeed(42) 13 | }) 14 | }) 15 | 16 | export const test3 = Effect.succeed(42).pipe( 17 | Effect.andThen((a) => 18 | Effect.gen(function*() { 19 | return yield* Effect.succeed(a) 20 | }) 21 | ) 22 | ) 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/removeUnnecessaryEffectGen.ts.ln8col24.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor removeUnnecessaryEffectGen at position 8:24 2 | import * as Effect from "effect/Effect" 3 | 4 | export const test1 = Effect.gen(function*() { 5 | return yield* Effect.succeed(42) 6 | }) 7 | 8 | export const test_ = Effect.succeed(42) 9 | 10 | export const test2 = Effect.gen(function*() { 11 | return yield* Effect.gen(function*() { 12 | return yield* Effect.succeed(42) 13 | }) 14 | }) 15 | 16 | export const test3 = Effect.succeed(42).pipe( 17 | Effect.andThen((a) => 18 | Effect.gen(function*() { 19 | return yield* Effect.succeed(a) 20 | }) 21 | ) 22 | ) 23 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleLazyConst.ts.ln3col10.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleLazyConst at position 3:10 2 | 3 | const test1 = () => 1 4 | 5 | const test2 = () => 1 6 | 7 | const test3 = () => { 8 | console.log("Hello") 9 | } 10 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleLazyConst.ts.ln3col7.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleLazyConst at position 3:7 2 | 3 | const test1 = () => 1 4 | 5 | const test2 = () => 1 6 | 7 | const test3 = () => { 8 | console.log("Hello") 9 | } 10 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleLazyConst.ts.ln5col10.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleLazyConst at position 5:10 2 | 3 | const test1 = 1 4 | 5 | const test2 = 1 6 | 7 | const test3 = () => { 8 | console.log("Hello") 9 | } 10 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleLazyConst.ts.ln5col7.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleLazyConst at position 5:7 2 | 3 | const test1 = 1 4 | 5 | const test2 = 1 6 | 7 | const test3 = () => { 8 | console.log("Hello") 9 | } 10 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleLazyConst.ts.ln7col10.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleLazyConst at position 7:10 2 | 3 | const test1 = 1 4 | 5 | const test2 = () => 1 6 | 7 | const test3 = () => { 8 | console.log("Hello") 9 | } 10 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/togglePipeStyle.ts.ln5col54.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor togglePipeStyle at position 5:54 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const toRegularPipe = pipe(Effect.succeed(42), Effect.map((x) => x * 2)) 6 | 7 | export const toPipeable = pipe(Effect.succeed(42), Effect.map((x) => x * 2)) 8 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/togglePipeStyle.ts.ln7col32.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor togglePipeStyle at position 7:32 2 | import * as Effect from "effect/Effect" 3 | import { pipe } from "effect/Function" 4 | 5 | export const toRegularPipe = Effect.succeed(42).pipe(Effect.map((x) => x * 2)) 6 | 7 | export const toPipeable = Effect.succeed(42).pipe(Effect.map((x) => x * 2)) 8 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleReturnTypeAnnotation.ts.ln12col18.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleReturnTypeAnnotation at position 12:18 2 | import * as T from "effect/Effect" 3 | 4 | export const test1 = () => T.succeed(42) 5 | 6 | export const test2 = () => (true ? T.succeed(42) : false) 7 | 8 | function sillyGenerics
(value: A) { 9 | return T.fail(value) 10 | } 11 | 12 | function removeAnnotation() { 13 | return 42 14 | } 15 | 16 | function removeAnnotationWithSpace(): number { 17 | return 42 18 | } 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleReturnTypeAnnotation.ts.ln16col18.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleReturnTypeAnnotation at position 16:18 2 | import * as T from "effect/Effect" 3 | 4 | export const test1 = () => T.succeed(42) 5 | 6 | export const test2 = () => (true ? T.succeed(42) : false) 7 | 8 | function sillyGenerics(value: A) { 9 | return T.fail(value) 10 | } 11 | 12 | function removeAnnotation(): number { 13 | return 42 14 | } 15 | 16 | function removeAnnotationWithSpace() { 17 | return 42 18 | } 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleReturnTypeAnnotation.ts.ln4col32.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleReturnTypeAnnotation at position 4:32 2 | import * as T from "effect/Effect" 3 | 4 | export const test1 = (): T.Effect => T.succeed(42) 5 | 6 | export const test2 = () => (true ? T.succeed(42) : false) 7 | 8 | function sillyGenerics(value: A) { 9 | return T.fail(value) 10 | } 11 | 12 | function removeAnnotation(): number { 13 | return 42 14 | } 15 | 16 | function removeAnnotationWithSpace(): number { 17 | return 42 18 | } 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleReturnTypeAnnotation.ts.ln6col32.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleReturnTypeAnnotation at position 6:32 2 | import * as T from "effect/Effect" 3 | 4 | export const test1 = () => T.succeed(42) 5 | 6 | export const test2 = (): T.Effect | false => (true ? T.succeed(42) : false) 7 | 8 | function sillyGenerics(value: A) { 9 | return T.fail(value) 10 | } 11 | 12 | function removeAnnotation(): number { 13 | return 42 14 | } 15 | 16 | function removeAnnotationWithSpace(): number { 17 | return 42 18 | } 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleReturnTypeAnnotation.ts.ln8col32.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleReturnTypeAnnotation at position 8:32 2 | import * as T from "effect/Effect" 3 | 4 | export const test1 = () => T.succeed(42) 5 | 6 | export const test2 = () => (true ? T.succeed(42) : false) 7 | 8 | function sillyGenerics(value: A): T.Effect { 9 | return T.fail(value) 10 | } 11 | 12 | function removeAnnotation(): number { 13 | return 42 14 | } 15 | 16 | function removeAnnotationWithSpace(): number { 17 | return 42 18 | } 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/toggleTypeAnnotation_schema.ts.ln11col15.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor toggleTypeAnnotation at position 11:15 2 | import * as Effect from "effect/Effect" 3 | import * as ParseResult from "effect/ParseResult" 4 | import * as Schema from "effect/Schema" 5 | import * as ParseOption from "effect/SchemaAST" 6 | 7 | class Person extends Schema.TaggedClass("Person")("Person", { 8 | name: Schema.NonEmptyString, 9 | age: Schema.Int 10 | }) { 11 | static decode: (i: { readonly name: string; readonly age: number; readonly _tag: "Person" }, overrideOptions?: ParseOption.ParseOptions) => Effect.Effect = Schema.decode(Person) 12 | } 13 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchemaClass.ts.ln4col21.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchemaClass at position 4:21 2 | import * as Schema from "effect/Schema" 3 | 4 | export class MyStruct extends Schema.Class("MyStruct")({ 5 | prop: Schema.String 6 | }) { } 7 | 8 | export interface MyStruct { 9 | prop: string 10 | } 11 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_conditionalType.ts.ln3col15.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 3:15 2 | 3 | export const Test = /* Not supported conversion: { a: string } extends Record ? T : never */; 4 | 5 | export type Test = { a: string } extends Record ? T : never 6 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_indexSignature.ts.ln4col21.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 4:21 2 | import * as Schema from "effect/Schema" 3 | 4 | export const MyStruct = Schema.Struct({ 5 | prop: Schema.Literal(42) 6 | }, { key: Schema.Number, value: Schema.String }) 7 | 8 | export interface MyStruct { 9 | prop: 42 10 | [key: number]: string 11 | } 12 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_literal.ts.ln4col15.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 4:15 2 | import * as Schema from "effect/Schema" 3 | 4 | export const Test = Schema.Literal("a", "b", "c", true, 42) 5 | 6 | export type Test = "a" | "b" | "c" | true | 42 7 | 8 | export type NoLiteralOptimization = { a: boolean } | "a" 9 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_literal.ts.ln6col15.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 6:15 2 | import * as Schema from "effect/Schema" 3 | 4 | export type Test = "a" | "b" | "c" | true | 42 5 | 6 | export const NoLiteralOptimization = Schema.Union(Schema.Struct({ 7 | a: Schema.Boolean 8 | }), Schema.Literal("a")) 9 | 10 | export type NoLiteralOptimization = { a: boolean } | "a" 11 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_noGenerics.ts.ln3col22.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 3:22 2 | 3 | export interface MyType { 4 | _A: A 5 | } 6 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_typeAlias.ts.ln3col15.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 3:15 2 | 3 | export const Test = Schema.Struct({ 4 | a: Schema.String, 5 | b: Schema.Boolean 6 | }); 7 | 8 | export type Test = { a: string; b: boolean } 9 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_typeOf.ts.ln6col21.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 6:21 2 | import * as Schema from "effect/Schema" 3 | 4 | const myVar = "A" as const 5 | 6 | export const MyStruct = Schema.Struct({ 7 | prop: Schema.Literal("A") 8 | }) 9 | 10 | export interface MyStruct { 11 | prop: typeof myVar 12 | } 13 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/typeToEffectSchema_typeofKeyof.ts.ln9col21.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor typeToEffectSchema at position 9:21 2 | import * as Schema from "effect/Schema" 3 | 4 | const myVar = { 5 | a: 1, 6 | b: 2 7 | } as const 8 | 9 | export const MyStruct = Schema.Struct({ 10 | prop: Schema.Literal(1, 2) 11 | }) 12 | 13 | export interface MyStruct { 14 | prop: (typeof myVar)[keyof typeof myVar] 15 | } 16 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithEffectGen.ts.ln14col22.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithEffectGen at position 14:22 2 | import { pipe } from "effect" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const test1 = Effect.succeed(42) 6 | 7 | export const test3 = test1 8 | 9 | export const test2 = Effect.succeed(42).pipe( 10 | Effect.map((n) => n + 1), 11 | Effect.map((n) => n - 1) 12 | ) 13 | 14 | export const test4 = Effect.gen(function*() { 15 | return yield* pipe( 16 | Effect.succeed(42), 17 | Effect.map((n) => n + 1), 18 | Effect.map((n) => n - 1) 19 | ) 20 | }) 21 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithEffectGen.ts.ln15col5.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithEffectGen at position 15:5 2 | import { pipe } from "effect" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const test1 = Effect.succeed(42) 6 | 7 | export const test3 = test1 8 | 9 | export const test2 = Effect.succeed(42).pipe( 10 | Effect.map((n) => n + 1), 11 | Effect.map((n) => n - 1) 12 | ) 13 | 14 | export const test4 = pipe( 15 | Effect.gen(function*() { return yield* Effect.succeed(42) }), 16 | Effect.map((n) => n + 1), 17 | Effect.map((n) => n - 1) 18 | ) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithEffectGen.ts.ln5col22.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithEffectGen at position 5:22 2 | import { pipe } from "effect" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const test1 = Effect.gen(function*() { return yield* Effect.succeed(42) }) 6 | 7 | export const test3 = test1 8 | 9 | export const test2 = Effect.succeed(42).pipe( 10 | Effect.map((n) => n + 1), 11 | Effect.map((n) => n - 1) 12 | ) 13 | 14 | export const test4 = pipe( 15 | Effect.succeed(42), 16 | Effect.map((n) => n + 1), 17 | Effect.map((n) => n - 1) 18 | ) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithEffectGen.ts.ln7col22.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithEffectGen at position 7:22 2 | import { pipe } from "effect" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const test1 = Effect.succeed(42) 6 | 7 | export const test3 = Effect.gen(function*() { return yield* test1 }) 8 | 9 | export const test2 = Effect.succeed(42).pipe( 10 | Effect.map((n) => n + 1), 11 | Effect.map((n) => n - 1) 12 | ) 13 | 14 | export const test4 = pipe( 15 | Effect.succeed(42), 16 | Effect.map((n) => n + 1), 17 | Effect.map((n) => n - 1) 18 | ) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithEffectGen.ts.ln9col22-ln12col1.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithEffectGen at position 9:22-12:1 2 | import { pipe } from "effect" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const test1 = Effect.succeed(42) 6 | 7 | export const test3 = test1 8 | 9 | export const test2 = Effect.gen(function*() { 10 | return yield* Effect.succeed(42).pipe( 11 | Effect.map((n) => n + 1), 12 | Effect.map((n) => n - 1) 13 | ) 14 | }) 15 | 16 | export const test4 = pipe( 17 | Effect.succeed(42), 18 | Effect.map((n) => n + 1), 19 | Effect.map((n) => n - 1) 20 | ) 21 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithEffectGen.ts.ln9col22.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithEffectGen at position 9:22 2 | import { pipe } from "effect" 3 | import * as Effect from "effect/Effect" 4 | 5 | export const test1 = Effect.succeed(42) 6 | 7 | export const test3 = test1 8 | 9 | export const test2 = Effect.gen(function*() { return yield* Effect.succeed(42) }).pipe( 10 | Effect.map((n) => n + 1), 11 | Effect.map((n) => n - 1) 12 | ) 13 | 14 | export const test4 = pipe( 15 | Effect.succeed(42), 16 | Effect.map((n) => n + 1), 17 | Effect.map((n) => n - 1) 18 | ) 19 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithEffectGen_noclass.ts.ln4col36.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithEffectGen at position 4:36 2 | import { Effect } from "effect" 3 | 4 | export class Asd extends Effect.Service()("Asd", { 5 | succeed: {} 6 | }) {} 7 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithPipe.ts.ln2col13-ln2col26.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithPipe at position 2:13-2:26 2 | const txt = pipe("Hello World") 3 | const txt2 = "Hello" 4 | -------------------------------------------------------------------------------- /test/__snapshots__/refactors/wrapWithPipe.ts.ln3col14-ln3col21.output: -------------------------------------------------------------------------------- 1 | // Result of running refactor wrapWithPipe at position 3:14-3:21 2 | const txt = "Hello World" 3 | const txt2 = pipe("Hello") 4 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Context from "effect/Context" 3 | 4 | export class MyService extends Context.Tag("NewText")() {} 7 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_contextTag.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Context from "effect/Context" 3 | 4 | export class MyClass extends Context.Tag("NewText")() {} 5 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_dataTaggedClass.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Data from "effect/Data" 3 | 4 | export class MyClass extends Data.TaggedClass("NewText")<{}> {} 5 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_dataTaggedError.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Data from "effect/Data" 3 | 4 | export class MyError extends Data.TaggedError("NewText")<{}> {} 5 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_effectService.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Effect from "effect/Effect" 3 | 4 | export class MyService extends Effect.Service()("NewText", { 5 | succeed: { value: 42 } 6 | }) {} 7 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_effectTag.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Effect from "effect/Effect" 3 | 4 | export class MyClass extends Effect.Tag("NewText")() {} 5 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_taggedClass.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Schema from "effect/Schema" 3 | 4 | export class MyService extends Schema.TaggedClass("NewText")("NewText", {}) {} 5 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_taggedError.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Schema from "effect/Schema" 3 | 4 | export class MyService extends Schema.TaggedError("NewText")("NewText", {}) {} 5 | -------------------------------------------------------------------------------- /test/__snapshots__/renames/keyStrings_taggedRequest.ts.ln4col20.output: -------------------------------------------------------------------------------- 1 | // Result of running rename keyStrings at position 4:20 2 | import * as Schema from "effect/Schema" 3 | 4 | export class MyService extends Schema.TaggedRequest("NewText")("NewText", { 5 | payload: {}, 6 | success: Schema.Void, 7 | failure: Schema.Never 8 | }) {} 9 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.src.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": ".tsbuildinfo/build.tsbuildinfo", 5 | "outDir": "build/esm", 6 | "declarationDir": "build/dts", 7 | "stripInternal": true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tsconfig.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "files": [ 4 | "tsup.config.ts", 5 | "vitest.config.mts" 6 | ], 7 | "compilerOptions": { 8 | "tsBuildInfoFile": ".tsbuildinfo/config.tsbuildinfo", 9 | "noEmit": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tsconfig.examples.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "include": [ 4 | "examples" 5 | ], 6 | "exclude": [ 7 | "examples/completions/**.ts" 8 | ], 9 | "references": [ 10 | { 11 | "path": "./tsconfig.src.json" 12 | } 13 | ], 14 | "compilerOptions": { 15 | "tsBuildInfoFile": ".tsbuildinfo/examples.tsbuildinfo", 16 | "rootDir": "examples", 17 | "noEmit": true, 18 | "noUnusedLocals": false, 19 | "strict": true, 20 | "paths": { 21 | "@/*": [ 22 | "./examples/*" 23 | ] 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "references": [ 4 | { 5 | "path": "./tsconfig.src.json" 6 | }, 7 | { 8 | "path": "./tsconfig.test.json" 9 | }, 10 | { 11 | "path": "./tsconfig.examples.json" 12 | }, 13 | { 14 | "path": "./tsconfig.config.json" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /tsconfig.src.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "include": ["src"], 4 | "compilerOptions": { 5 | "outDir": "build/src", 6 | "tsBuildInfoFile": ".tsbuildinfo/src.tsbuildinfo", 7 | "rootDir": "src" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tsconfig.test.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.base.json", 3 | "include": ["test"], 4 | "references": [ 5 | { 6 | "path": "./tsconfig.src.json" 7 | } 8 | ], 9 | "compilerOptions": { 10 | "tsBuildInfoFile": ".tsbuildinfo/test.tsbuildinfo", 11 | "rootDir": "test", 12 | "noEmit": true, 13 | "baseUrl": ".", 14 | "paths": { 15 | "@effect/language-service/*": ["./src/*.js"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vitest.config.mts: -------------------------------------------------------------------------------- 1 | import * as path from "path" 2 | import { defineConfig } from "vitest/config" 3 | 4 | export default defineConfig({ 5 | test: { 6 | include: ["test/**/*.{test,spec}.?(c|m)[jt]s?(x)"] 7 | }, 8 | resolve: { 9 | alias: { 10 | "@effect/language-service/test": path.join(__dirname, "test"), 11 | "@effect/language-service": path.join(__dirname, "src") 12 | } 13 | } 14 | }) 15 | --------------------------------------------------------------------------------