@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/index.js CHANGED
@@ -4318,9 +4318,11 @@ var anyUnknownInErrorContext = createDiagnostic({
4318
4318
  }
4319
4319
  if (ts.isParameter(node) || ts.isPropertyDeclaration(node) || ts.isVariableDeclaration(node)) {
4320
4320
  if (node.type) {
4321
+ const typeNode = node.type;
4321
4322
  const type2 = typeChecker.getTypeAtLocation(node.type);
4322
4323
  const expectedEffect = yield* pipe(
4323
4324
  typeParser.strictEffectType(type2, node.type),
4325
+ orElse2(() => typeParser.layerType(type2, typeNode)),
4324
4326
  orElse2(() => void_)
4325
4327
  );
4326
4328
  if (expectedEffect) continue;
@@ -4342,8 +4344,9 @@ var anyUnknownInErrorContext = createDiagnostic({
4342
4344
  if (!type) continue;
4343
4345
  yield* pipe(
4344
4346
  typeParser.strictEffectType(type, node),
4345
- map5((effect) => {
4346
- const { E, R } = effect;
4347
+ orElse2(() => pipe(typeParser.layerType(type, node), map5(({ E, RIn }) => ({ E, R: RIn })))),
4348
+ map5((effectOrLayer) => {
4349
+ const { E, R } = effectOrLayer;
4347
4350
  const hasAnyUnknownR = isAnyOrUnknown(R);
4348
4351
  const hasAnyUnknownE = isAnyOrUnknown(E);
4349
4352
  if (hasAnyUnknownR || hasAnyUnknownE) {
@@ -4366,7 +4369,7 @@ var anyUnknownInErrorContext = createDiagnostic({
4366
4369
  matchingNodes.splice(i, 1);
4367
4370
  }
4368
4371
  }
4369
- const suggestions = [`This Effect has ${channels.join(" and ")} which is not recommended.`];
4372
+ const suggestions = [`This has ${channels.join(" and ")} which is not recommended.`];
4370
4373
  if (hasAnyUnknownR) {
4371
4374
  suggestions.push(`Only service identifiers should appear in the requirements channel.`);
4372
4375
  }