@effect/language-service 0.58.1 → 0.58.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/language-service",
3
- "version": "0.58.1",
3
+ "version": "0.58.2",
4
4
  "description": "A Language-Service Plugin to Refactor and Diagnostic effect-ts projects",
5
5
  "main": "index.cjs",
6
6
  "bin": {
package/transform.js CHANGED
@@ -3681,9 +3681,11 @@ var anyUnknownInErrorContext = createDiagnostic({
3681
3681
  }
3682
3682
  if (ts.isParameter(node) || ts.isPropertyDeclaration(node) || ts.isVariableDeclaration(node)) {
3683
3683
  if (node.type) {
3684
+ const typeNode = node.type;
3684
3685
  const type2 = typeChecker.getTypeAtLocation(node.type);
3685
3686
  const expectedEffect = yield* pipe(
3686
3687
  typeParser.strictEffectType(type2, node.type),
3688
+ orElse2(() => typeParser.layerType(type2, typeNode)),
3687
3689
  orElse2(() => void_)
3688
3690
  );
3689
3691
  if (expectedEffect) continue;
@@ -3705,8 +3707,9 @@ var anyUnknownInErrorContext = createDiagnostic({
3705
3707
  if (!type) continue;
3706
3708
  yield* pipe(
3707
3709
  typeParser.strictEffectType(type, node),
3708
- map4((effect) => {
3709
- const { E, R } = effect;
3710
+ orElse2(() => pipe(typeParser.layerType(type, node), map4(({ E, RIn }) => ({ E, R: RIn })))),
3711
+ map4((effectOrLayer) => {
3712
+ const { E, R } = effectOrLayer;
3710
3713
  const hasAnyUnknownR = isAnyOrUnknown(R);
3711
3714
  const hasAnyUnknownE = isAnyOrUnknown(E);
3712
3715
  if (hasAnyUnknownR || hasAnyUnknownE) {
@@ -3729,7 +3732,7 @@ var anyUnknownInErrorContext = createDiagnostic({
3729
3732
  matchingNodes.splice(i, 1);
3730
3733
  }
3731
3734
  }
3732
- const suggestions = [`This Effect has ${channels.join(" and ")} which is not recommended.`];
3735
+ const suggestions = [`This has ${channels.join(" and ")} which is not recommended.`];
3733
3736
  if (hasAnyUnknownR) {
3734
3737
  suggestions.push(`Only service identifiers should appear in the requirements channel.`);
3735
3738
  }