@effect/language-service 0.31.0 → 0.31.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
@@ -2993,6 +2993,7 @@ function make3(ts, tsUtils, typeChecker) {
2993
2993
  className: atLocation.name,
2994
2994
  selfTypeNode,
2995
2995
  args: wholeCall.arguments,
2996
+ options: wholeCall.arguments[1],
2996
2997
  accessors: accessors2,
2997
2998
  dependencies
2998
2999
  };
@@ -4109,7 +4110,7 @@ var missingEffectServiceDependency = createDiagnostic({
4109
4110
  orElse2(() => void_)
4110
4111
  );
4111
4112
  if (serviceResult) {
4112
- const { className, dependencies } = serviceResult;
4113
+ const { className, options } = serviceResult;
4113
4114
  const classSymbol = typeChecker.getSymbolAtLocation(className);
4114
4115
  if (classSymbol) {
4115
4116
  const classType = typeChecker.getTypeOfSymbol(classSymbol);
@@ -4130,11 +4131,17 @@ var missingEffectServiceDependency = createDiagnostic({
4130
4131
  excludeNever
4131
4132
  );
4132
4133
  const providedIndexes = /* @__PURE__ */ new Set();
4133
- const dependenciesToProcess = dependencies || [];
4134
- for (const depExpression of dependenciesToProcess) {
4135
- const depType = typeChecker.getTypeAtLocation(depExpression);
4134
+ const optionsType = typeChecker.getTypeAtLocation(options);
4135
+ const dependenciesProperty = typeChecker.getPropertyOfType(optionsType, "dependencies");
4136
+ let types = [];
4137
+ if (dependenciesProperty) {
4138
+ const dependenciesTypes = typeChecker.getTypeOfSymbolAtLocation(dependenciesProperty, options);
4139
+ const numberIndexType = dependenciesTypes.getNumberIndexType();
4140
+ types = numberIndexType ? unrollUnionMembers(numberIndexType) : [];
4141
+ }
4142
+ for (const depType of types) {
4136
4143
  const depLayerResult = yield* pipe(
4137
- typeParser.layerType(depType, depExpression),
4144
+ typeParser.layerType(depType, options),
4138
4145
  orElse2(() => void_)
4139
4146
  );
4140
4147
  if (depLayerResult) {
@@ -10492,7 +10499,7 @@ function layerInfo(sourceFile, position, quickInfo2) {
10492
10499
  const providesNode = findInnermostGraphEdge(rootNode, "rout", providesKey);
10493
10500
  appendInfo(providesNode, graphCtx.services.get(providesKey), "provided");
10494
10501
  }
10495
- lines.push("");
10502
+ if (lines.length > 0) lines.push("");
10496
10503
  for (const requiresKey of rootNode.rin) {
10497
10504
  const requiresNode = findInnermostGraphEdge(rootNode, "rin", requiresKey);
10498
10505
  appendInfo(requiresNode, graphCtx.services.get(requiresKey), "required");
@@ -10506,6 +10513,7 @@ function layerInfo(sourceFile, position, quickInfo2) {
10506
10513
  linkParts.push({ kind: "link", text: "}" });
10507
10514
  linkParts.push({ kind: "space", text: "\n" });
10508
10515
  }
10516
+ if (lines.length === 0) return linkParts;
10509
10517
  return [
10510
10518
  {
10511
10519
  kind: "text",