@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.
@@ -3685,9 +3685,11 @@ var anyUnknownInErrorContext = createDiagnostic({
3685
3685
  }
3686
3686
  if (ts.isParameter(node) || ts.isPropertyDeclaration(node) || ts.isVariableDeclaration(node)) {
3687
3687
  if (node.type) {
3688
+ const typeNode = node.type;
3688
3689
  const type2 = typeChecker.getTypeAtLocation(node.type);
3689
3690
  const expectedEffect = yield* pipe(
3690
3691
  typeParser.strictEffectType(type2, node.type),
3692
+ orElse2(() => typeParser.layerType(type2, typeNode)),
3691
3693
  orElse2(() => void_)
3692
3694
  );
3693
3695
  if (expectedEffect) continue;
@@ -3709,8 +3711,9 @@ var anyUnknownInErrorContext = createDiagnostic({
3709
3711
  if (!type) continue;
3710
3712
  yield* pipe(
3711
3713
  typeParser.strictEffectType(type, node),
3712
- map4((effect) => {
3713
- const { E, R } = effect;
3714
+ orElse2(() => pipe(typeParser.layerType(type, node), map4(({ E, RIn }) => ({ E, R: RIn })))),
3715
+ map4((effectOrLayer) => {
3716
+ const { E, R } = effectOrLayer;
3714
3717
  const hasAnyUnknownR = isAnyOrUnknown(R);
3715
3718
  const hasAnyUnknownE = isAnyOrUnknown(E);
3716
3719
  if (hasAnyUnknownR || hasAnyUnknownE) {
@@ -3733,7 +3736,7 @@ var anyUnknownInErrorContext = createDiagnostic({
3733
3736
  matchingNodes.splice(i, 1);
3734
3737
  }
3735
3738
  }
3736
- const suggestions = [`This Effect has ${channels.join(" and ")} which is not recommended.`];
3739
+ const suggestions = [`This has ${channels.join(" and ")} which is not recommended.`];
3737
3740
  if (hasAnyUnknownR) {
3738
3741
  suggestions.push(`Only service identifiers should appear in the requirements channel.`);
3739
3742
  }