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