@effect/language-service 0.58.0 → 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;
@@ -3695,6 +3697,10 @@ var anyUnknownInErrorContext = createDiagnostic({
3695
3697
  }
3696
3698
  ts.forEachChild(node, appendNodeToVisit);
3697
3699
  if (!ts.isExpression(node)) continue;
3700
+ if (node.parent && ts.isJsxSelfClosingElement(node.parent) && node.parent.tagName === node) continue;
3701
+ if (node.parent && ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node) continue;
3702
+ if (node.parent && ts.isJsxClosingElement(node.parent) && node.parent.tagName === node) continue;
3703
+ if (node.parent && ts.isJsxAttribute(node.parent) && node.parent.name === node) continue;
3698
3704
  let type = typeChecker.getTypeAtLocation(node);
3699
3705
  if (ts.isCallExpression(node)) {
3700
3706
  const resolvedSignature = typeChecker.getResolvedSignature(node);
@@ -3705,8 +3711,9 @@ var anyUnknownInErrorContext = createDiagnostic({
3705
3711
  if (!type) continue;
3706
3712
  yield* pipe(
3707
3713
  typeParser.strictEffectType(type, node),
3708
- map4((effect) => {
3709
- 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;
3710
3717
  const hasAnyUnknownR = isAnyOrUnknown(R);
3711
3718
  const hasAnyUnknownE = isAnyOrUnknown(E);
3712
3719
  if (hasAnyUnknownR || hasAnyUnknownE) {
@@ -3729,7 +3736,7 @@ var anyUnknownInErrorContext = createDiagnostic({
3729
3736
  matchingNodes.splice(i, 1);
3730
3737
  }
3731
3738
  }
3732
- const suggestions = [`This Effect has ${channels.join(" and ")} which is not recommended.`];
3739
+ const suggestions = [`This has ${channels.join(" and ")} which is not recommended.`];
3733
3740
  if (hasAnyUnknownR) {
3734
3741
  suggestions.push(`Only service identifiers should appear in the requirements channel.`);
3735
3742
  }