From 089e1644baf8dc6c41c4d59fc1b1c89e12d70fae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 1 Mar 2025 15:01:59 +0000 Subject: [PATCH] Version Packages --- .changeset/cuddly-mangos-unite.md | 6 --- .changeset/wet-ducks-flow.md | 73 ----------------------------- CHANGELOG.md | 78 +++++++++++++++++++++++++++++++ package.json | 2 +- 4 files changed, 79 insertions(+), 80 deletions(-) delete mode 100644 .changeset/cuddly-mangos-unite.md delete mode 100644 .changeset/wet-ducks-flow.md diff --git a/.changeset/cuddly-mangos-unite.md b/.changeset/cuddly-mangos-unite.md deleted file mode 100644 index 36358a0..0000000 --- a/.changeset/cuddly-mangos-unite.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@effect/language-service": minor ---- - -- Update internal version of effect from 2.x beta to 3.12.5 -- Remove adapter from gen refactors diff --git a/.changeset/wet-ducks-flow.md b/.changeset/wet-ducks-flow.md deleted file mode 100644 index 61c7106..0000000 --- a/.changeset/wet-ducks-flow.md +++ /dev/null @@ -1,73 +0,0 @@ ---- -"@effect/language-service": minor ---- - -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. - -```json -{ - "plugins": [ - { - "name": "@effect/language-service", - "diagnostics": false - } - ] -} -``` - -Please report any false positive or missing diagnostic you encounter over the Github repository. - -## Missing Errors and Services in Effects - -Additionally to the standard TypeScript error that may be cryptic at first: - -``` -Argument of type 'Effect' is not assignable to parameter of type 'Effect' 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. -``` - -## Floating Effect - -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. - -```ts -Effect.runPromise( - Effect.gen(function* () { - Effect.sync(() => console.log("Hello!")); - // ^- Effect must be yielded or assigned to a variable. - }) -); -``` - -## Used yield instead of yield\* - -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. - -```ts -Effect.runPromise( - Effect.gen(function* () { - yield Effect.sync(() => console.log("Hello!")); - // ^- When yielding Effects inside Effect.gen, you should use yield* instead of yield. - }) -); -``` diff --git a/CHANGELOG.md b/CHANGELOG.md index 69844d3..b1add7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,83 @@ # @effect/language-service +## 0.3.0 + +### Minor Changes + +- [#54](https://github.com/Effect-TS/language-service/pull/54) [`19e5a77`](https://github.com/Effect-TS/language-service/commit/19e5a7744c443ca10ab5cea1bcd70f636c3142d7) Thanks [@mattiamanzati](https://github.com/mattiamanzati)! - - Update internal version of effect from 2.x beta to 3.12.5 + + - Remove adapter from gen refactors + +- [#56](https://github.com/Effect-TS/language-service/pull/56) [`5b2b27c`](https://github.com/Effect-TS/language-service/commit/5b2b27c835752650e870534890112d20f36cb530) Thanks [@mattiamanzati](https://github.com/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. + + ```json + { + "plugins": [ + { + "name": "@effect/language-service", + "diagnostics": false + } + ] + } + ``` + + Please report any false positive or missing diagnostic you encounter over the Github repository. + + ## Missing Errors and Services in Effects + + Additionally to the standard TypeScript error that may be cryptic at first: + + ``` + Argument of type 'Effect' is not assignable to parameter of type 'Effect' 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. + ``` + + ## Floating Effect + + 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. + + ```ts + Effect.runPromise( + Effect.gen(function* () { + Effect.sync(() => console.log("Hello!")); + // ^- Effect must be yielded or assigned to a variable. + }), + ); + ``` + + ## Used yield instead of yield\* + + 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. + + ```ts + Effect.runPromise( + Effect.gen(function* () { + yield Effect.sync(() => console.log("Hello!")); + // ^- When yielding Effects inside Effect.gen, you should use yield* instead of yield. + }), + ); + ``` + ## 0.2.0 ### Minor Changes diff --git a/package.json b/package.json index 6f7d1b4..f2b31bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@effect/language-service", - "version": "0.2.0", + "version": "0.3.0", "type": "module", "packageManager": "pnpm@8.11.0", "publishConfig": {