@effect/language-service 0.31.1 → 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) {