@effect/language-service 0.55.3 → 0.55.5

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
@@ -31978,6 +31978,7 @@ function make64(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
31978
31978
  const getSourceFilesDeclaringSymbolModule = (packageName) => cachedBy(
31979
31979
  fn2("TypeParser.getSourceFilesDeclaringSymbolModule")(function* (symbol3) {
31980
31980
  const result = [];
31981
+ if (!symbol3) return result;
31981
31982
  if (!symbol3.declarations) return yield* typeParserIssue("Symbol has no declarations", void 0, void 0);
31982
31983
  for (const sourceFile of symbol3.declarations) {
31983
31984
  if (!ts.isSourceFile(sourceFile)) continue;
@@ -32015,6 +32016,7 @@ function make64(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
32015
32016
  const getSourceFilesDeclaringSymbolExportedUnderPackageModule = (packageName, memberName) => cachedBy(
32016
32017
  fn2("TypeParser.getSourceFilesDeclaringSymbolUnderPackageExportedMember")(function* (symbol3) {
32017
32018
  const result = [];
32019
+ if (!symbol3) return result;
32018
32020
  if (!symbol3.declarations) return yield* typeParserIssue("Symbol has no declarations", void 0, void 0);
32019
32021
  for (const declaration of symbol3.declarations) {
32020
32022
  const sourceFile = tsUtils.getSourceFileOfNode(declaration);
@@ -32236,14 +32238,14 @@ function make64(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
32236
32238
  );
32237
32239
  const importedContextModule = cachedBy(
32238
32240
  fn2("TypeParser.importedContextModule")(function* (node) {
32241
+ if (!ts.isIdentifier(node)) {
32242
+ return yield* typeParserIssue("Node is not an identifier", void 0, node);
32243
+ }
32239
32244
  const type2 = typeChecker.getTypeAtLocation(node);
32240
32245
  const propertySymbol = typeChecker.getPropertyOfType(type2, "Tag");
32241
32246
  if (!propertySymbol) {
32242
32247
  return yield* typeParserIssue("Type has no 'Tag' property", type2, node);
32243
32248
  }
32244
- if (!ts.isIdentifier(node)) {
32245
- return yield* typeParserIssue("Node is not an identifier", type2, node);
32246
- }
32247
32249
  const sourceFile = tsUtils.getSourceFileOfNode(node);
32248
32250
  if (!sourceFile) {
32249
32251
  return yield* typeParserIssue("Node is not in a source file", void 0, node);
@@ -32270,14 +32272,14 @@ function make64(ts, tsUtils, typeChecker, typeCheckerUtils, program) {
32270
32272
  );
32271
32273
  const importedDataModule = cachedBy(
32272
32274
  fn2("TypeParser.importedDataModule")(function* (node) {
32275
+ if (!ts.isIdentifier(node)) {
32276
+ return yield* typeParserIssue("Node is not an expression", void 0, node);
32277
+ }
32273
32278
  const type2 = typeChecker.getTypeAtLocation(node);
32274
32279
  const propertySymbol = typeChecker.getPropertyOfType(type2, "TaggedError");
32275
32280
  if (!propertySymbol) {
32276
32281
  return yield* typeParserIssue("Type has no 'TaggedError' property", type2, node);
32277
32282
  }
32278
- if (!ts.isIdentifier(node)) {
32279
- return yield* typeParserIssue("Node is not an expression", type2, node);
32280
- }
32281
32283
  const sourceFile = tsUtils.getSourceFileOfNode(node);
32282
32284
  if (!sourceFile) {
32283
32285
  return yield* typeParserIssue("Node is not in a source file", void 0, node);
@@ -33919,9 +33921,10 @@ var leakingRequirements = createDiagnostic({
33919
33921
  (type2) => {
33920
33922
  let symbol3 = type2.symbol;
33921
33923
  if (symbol3 && symbol3.flags & ts.SymbolFlags.Alias) {
33922
- symbol3 = typeChecker.getAliasedSymbol(symbol3);
33924
+ symbol3 = typeChecker.getAliasedSymbol(symbol3) || symbol3;
33923
33925
  }
33924
- return !(symbol3.declarations || []).some((declaration) => {
33926
+ if (!symbol3) return false;
33927
+ return !(symbol3?.declarations || []).some((declaration) => {
33925
33928
  const declarationSource = tsUtils.getSourceFileOfNode(declaration);
33926
33929
  if (!declarationSource) return false;
33927
33930
  return declarationSource.text.substring(declaration.pos, declaration.end).toLowerCase().indexOf(
@@ -35478,6 +35481,7 @@ var strictBooleanExpressions = createDiagnostic({
35478
35481
  for (const nodeToCheck of nodes) {
35479
35482
  if (!nodeToCheck) continue;
35480
35483
  if (!conditionChecks.has(nodeToCheck.parent)) continue;
35484
+ if (!ts.isExpression(nodeToCheck)) continue;
35481
35485
  const nodeType = typeChecker.getTypeAtLocation(nodeToCheck);
35482
35486
  const constrainedType = typeChecker.getBaseConstraintOfType(nodeType);
35483
35487
  let typesToCheck = [constrainedType || nodeType];