@effect/language-service
Advanced tools
Changelog
0.4.0
#66 89d6fa9
Thanks @mattiamanzati! - Remove old transformer
#67 5111a65
Thanks @mattiamanzati! - Handle Effect.fn and Effect.fnUntraced in missing yield star diagnostic
f8d5018
Thanks @mattiamanzati! - Upgrade used TS versionChangelog
0.3.2
#61 796db99
Thanks @mattiamanzati! - Fix binary assignment reported as floating effect
#63 ae973cb
Thanks @mattiamanzati! - Allow Exit subtype to be a floating Effect
Changelog
0.3.1
#58 d5fcb9e
Thanks @mattiamanzati! - Allow Fiber and FiberRuntime to be floating
#60 bf12970
Thanks @mattiamanzati! - Additional notice for misused yield instead of yield* in generators
Changelog
0.3.0
#54 19e5a77
Thanks @mattiamanzati! - - Update internal version of effect from 2.x beta to 3.12.5
#56 5b2b27c
Thanks @mattiamanzati! - Add support for Effect diagnostics
With this release of the language service plugin, we aim to improve the overall Effect experience by providing additional diagnostics that tries to fix misleading or hard to read TypeScript errors.
All of the diagnostics provided by the language service are available only in editor-mode, that means that they won't show up when using tsc.
Diagnostics are enabled by default, but you can opt-out of them by changing the language service configuration and provide diagnostics: false.
{
"plugins": [
{
"name": "@effect/language-service",
"diagnostics": false
}
]
}
Please report any false positive or missing diagnostic you encounter over the Github repository.
Additionally to the standard TypeScript error that may be cryptic at first:
Argument of type 'Effect<number, never, ServiceB | ServiceA | ServiceC>' is not assignable to parameter of type 'Effect<number, never, ServiceB | ServiceA>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Type 'ServiceB | ServiceA | ServiceC' is not assignable to type 'ServiceB | ServiceA'.
Type 'ServiceC' is not assignable to type 'ServiceB | ServiceA'.
Type 'ServiceC' is not assignable to type 'ServiceA'.
Types of property 'a' are incompatible.
Type '3' is not assignable to type '1'.ts(2379)
you'll now receive an additional error:
Missing 'ServiceC' in the expected Effect context.
In some situation you may not receive any compile error at all, but that's because you may have forgot to yield your effects inside gen!
Floating Effects that are not assigned to a variable will be reported into the Effect diagnostics.
Effect.runPromise(
Effect.gen(function* () {
Effect.sync(() => console.log("Hello!"));
// ^- Effect must be yielded or assigned to a variable.
})
);
Similarly, yield instead of yield* won't result in a type error by itself, but is not the intended usage.
This yield will be reported in the effect diagnostics.
Effect.runPromise(
Effect.gen(function* () {
yield Effect.sync(() => console.log("Hello!"));
// ^- When yielding Effects inside Effect.gen, you should use yield* instead of yield.
})
);
Changelog
0.2.0
f3ff991
Thanks @mattiamanzati! - Dedupe identical JSDoc tags in hover quickinfoChangelog
0.0.19
282adf4
Thanks @mattiamanzati! - Improve handling of non-datafirst in pipeable-to-datafirst rewrite