@effect/language-service 0.38.1 → 0.38.3

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
@@ -29138,10 +29138,10 @@ function makeTypeScriptUtils(ts4) {
29138
29138
  if (!hasProperty(packageJsonScope.contents, "packageJsonContent")) return;
29139
29139
  const packageJsonContent = packageJsonScope.contents.packageJsonContent;
29140
29140
  if (!hasProperty(packageJsonContent, "name")) return;
29141
- if (!hasProperty(packageJsonContent, "version")) return;
29142
29141
  if (!hasProperty(packageJsonScope, "packageDirectory")) return;
29143
29142
  if (!isString(packageJsonScope.packageDirectory)) return;
29144
- const { name, version } = packageJsonContent;
29143
+ const { name } = packageJsonContent;
29144
+ const version = hasProperty(packageJsonScope, "version") ? packageJsonScope.version : "";
29145
29145
  if (!isString(name)) return;
29146
29146
  if (!isString(version)) return;
29147
29147
  const hasEffectInPeerDependencies = hasProperty(packageJsonContent, "peerDependencies") && isObject(packageJsonContent.peerDependencies) && hasProperty(packageJsonContent.peerDependencies, "effect");
@@ -29163,9 +29163,20 @@ function makeTypeScriptUtils(ts4) {
29163
29163
  exportsKeys
29164
29164
  };
29165
29165
  }
29166
- function resolveModulePattern(sourceFile, pattern2) {
29166
+ function resolveModulePattern(program, sourceFile, pattern2) {
29167
29167
  if (pattern2.indexOf("*") === -1) return [pattern2.toLowerCase()];
29168
- const packageJsonScope = parsePackageContentNameAndVersionFromScope(sourceFile);
29168
+ let packageJsonScope = parsePackageContentNameAndVersionFromScope(sourceFile);
29169
+ if (!packageJsonScope && hasProperty(ts4, "getPackageScopeForPath") && isFunction2(ts4.getPackageScopeForPath) && hasProperty(ts4, "getTemporaryModuleResolutionState") && isFunction2(ts4.getTemporaryModuleResolutionState) && hasProperty(ts4, "getPackageScopeForPath") && isFunction2(ts4.getPackageScopeForPath)) {
29170
+ const temporaryModuleResolutionState = ts4.getTemporaryModuleResolutionState(
29171
+ void 0,
29172
+ program,
29173
+ program.getCompilerOptions()
29174
+ );
29175
+ packageJsonScope = parsePackageContentNameAndVersionFromScope({
29176
+ ...sourceFile,
29177
+ packageJsonScope: ts4.getPackageScopeForPath(sourceFile.fileName, temporaryModuleResolutionState)
29178
+ });
29179
+ }
29169
29180
  const referencedPackages = [];
29170
29181
  for (const statement of sourceFile.statements) {
29171
29182
  if (ts4.isImportDeclaration(statement) && ts4.isStringLiteral(statement.moduleSpecifier)) {