@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.
package/cli.js CHANGED
@@ -33698,9 +33698,11 @@ var anyUnknownInErrorContext = createDiagnostic({
33698
33698
  }
33699
33699
  if (ts.isParameter(node) || ts.isPropertyDeclaration(node) || ts.isVariableDeclaration(node)) {
33700
33700
  if (node.type) {
33701
+ const typeNode = node.type;
33701
33702
  const type3 = typeChecker.getTypeAtLocation(node.type);
33702
33703
  const expectedEffect = yield* pipe(
33703
33704
  typeParser.strictEffectType(type3, node.type),
33705
+ orElse14(() => typeParser.layerType(type3, typeNode)),
33704
33706
  orElse14(() => void_8)
33705
33707
  );
33706
33708
  if (expectedEffect) continue;
@@ -33708,6 +33710,10 @@ var anyUnknownInErrorContext = createDiagnostic({
33708
33710
  }
33709
33711
  ts.forEachChild(node, appendNodeToVisit);
33710
33712
  if (!ts.isExpression(node)) continue;
33713
+ if (node.parent && ts.isJsxSelfClosingElement(node.parent) && node.parent.tagName === node) continue;
33714
+ if (node.parent && ts.isJsxOpeningElement(node.parent) && node.parent.tagName === node) continue;
33715
+ if (node.parent && ts.isJsxClosingElement(node.parent) && node.parent.tagName === node) continue;
33716
+ if (node.parent && ts.isJsxAttribute(node.parent) && node.parent.name === node) continue;
33711
33717
  let type2 = typeChecker.getTypeAtLocation(node);
33712
33718
  if (ts.isCallExpression(node)) {
33713
33719
  const resolvedSignature = typeChecker.getResolvedSignature(node);
@@ -33718,8 +33724,9 @@ var anyUnknownInErrorContext = createDiagnostic({
33718
33724
  if (!type2) continue;
33719
33725
  yield* pipe(
33720
33726
  typeParser.strictEffectType(type2, node),
33721
- map34((effect3) => {
33722
- const { E, R } = effect3;
33727
+ orElse14(() => pipe(typeParser.layerType(type2, node), map34(({ E, RIn }) => ({ E, R: RIn })))),
33728
+ map34((effectOrLayer) => {
33729
+ const { E, R } = effectOrLayer;
33723
33730
  const hasAnyUnknownR = isAnyOrUnknown(R);
33724
33731
  const hasAnyUnknownE = isAnyOrUnknown(E);
33725
33732
  if (hasAnyUnknownR || hasAnyUnknownE) {
@@ -33742,7 +33749,7 @@ var anyUnknownInErrorContext = createDiagnostic({
33742
33749
  matchingNodes.splice(i, 1);
33743
33750
  }
33744
33751
  }
33745
- const suggestions = [`This Effect has ${channels.join(" and ")} which is not recommended.`];
33752
+ const suggestions = [`This has ${channels.join(" and ")} which is not recommended.`];
33746
33753
  if (hasAnyUnknownR) {
33747
33754
  suggestions.push(`Only service identifiers should appear in the requirements channel.`);
33748
33755
  }