@angular/language-server 19.2.4 → 20.0.0

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.
Files changed (2) hide show
  1. package/index.js +48 -46
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -771,9 +771,9 @@ var require_server_host = __commonJS({
771
771
  }
772
772
  });
773
773
 
774
- // ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@registry.npmjs.org+@angular+language-service@19.2.7/node_modules/@angular/language-service/api_bundle.js
774
+ // ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@registry.npmjs.org+@angular+language-service@20.0.0-rc.0/node_modules/@angular/language-service/api_bundle.js
775
775
  var require_api_bundle = __commonJS({
776
- "../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@registry.npmjs.org+@angular+language-service@19.2.7/node_modules/@angular/language-service/api_bundle.js"(exports2, module2) {
776
+ "../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@registry.npmjs.org+@angular+language-service@20.0.0-rc.0/node_modules/@angular/language-service/api_bundle.js"(exports2, module2) {
777
777
  var __defProp2 = Object.defineProperty;
778
778
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
779
779
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
@@ -5812,9 +5812,9 @@ var require_source_map_support = __commonJS({
5812
5812
  }
5813
5813
  });
5814
5814
 
5815
- // ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/typescript@registry.npmjs.org+typescript@5.8.1-rc/node_modules/typescript/lib/typescript.js
5815
+ // ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/typescript@registry.npmjs.org+typescript@5.8.3/node_modules/typescript/lib/typescript.js
5816
5816
  var require_typescript = __commonJS({
5817
- "../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/typescript@registry.npmjs.org+typescript@5.8.1-rc/node_modules/typescript/lib/typescript.js"(exports2, module2) {
5817
+ "../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/typescript@registry.npmjs.org+typescript@5.8.3/node_modules/typescript/lib/typescript.js"(exports2, module2) {
5818
5818
  var ts = {};
5819
5819
  ((module3) => {
5820
5820
  "use strict";
@@ -8084,7 +8084,7 @@ var require_typescript = __commonJS({
8084
8084
  });
8085
8085
  module3.exports = __toCommonJS(typescript_exports);
8086
8086
  var versionMajorMinor = "5.8";
8087
- var version = "5.8.1-rc";
8087
+ var version = "5.8.3";
8088
8088
  var Comparison = ((Comparison3) => {
8089
8089
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
8090
8090
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -65117,11 +65117,12 @@ ${lanes.join("\n")}
65117
65117
  serializeExistingTypeNode(context, typeNode, addUndefined) {
65118
65118
  return serializeExistingTypeNode(context, typeNode, !!addUndefined);
65119
65119
  },
65120
- serializeReturnTypeForSignature(syntacticContext, signatureDeclaration) {
65120
+ serializeReturnTypeForSignature(syntacticContext, signatureDeclaration, symbol) {
65121
65121
  var _a;
65122
65122
  const context = syntacticContext;
65123
65123
  const signature = getSignatureFromDeclaration(signatureDeclaration);
65124
- const returnType = (_a = context.enclosingSymbolTypes.get(getSymbolId(getSymbolOfDeclaration(signatureDeclaration)))) != null ? _a : instantiateType(getReturnTypeOfSignature(signature), context.mapper);
65124
+ symbol != null ? symbol : symbol = getSymbolOfDeclaration(signatureDeclaration);
65125
+ const returnType = (_a = context.enclosingSymbolTypes.get(getSymbolId(symbol))) != null ? _a : instantiateType(getReturnTypeOfSignature(signature), context.mapper);
65125
65126
  return serializeInferredReturnTypeForSignature(context, signature, returnType);
65126
65127
  },
65127
65128
  serializeTypeOfExpression(syntacticContext, expr) {
@@ -65135,7 +65136,7 @@ ${lanes.join("\n")}
65135
65136
  symbol != null ? symbol : symbol = getSymbolOfDeclaration(declaration);
65136
65137
  let type = (_a = context.enclosingSymbolTypes) == null ? void 0 : _a.get(getSymbolId(symbol));
65137
65138
  if (type === void 0) {
65138
- type = symbol && !(symbol.flags & (2048 | 131072)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType;
65139
+ type = symbol.flags & 98304 && declaration.kind === 178 ? instantiateType(getWriteTypeOfSymbol(symbol), context.mapper) : symbol && !(symbol.flags & (2048 | 131072)) ? instantiateType(getWidenedLiteralType(getTypeOfSymbol(symbol)), context.mapper) : errorType;
65139
65140
  }
65140
65141
  const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration);
65141
65142
  if (addUndefinedForParameter) {
@@ -65202,6 +65203,7 @@ ${lanes.join("\n")}
65202
65203
  const context = syntacticContext;
65203
65204
  if (context.bundled || context.enclosingFile !== getSourceFileOfNode(lit)) {
65204
65205
  let name = lit.text;
65206
+ const originalName = name;
65205
65207
  const nodeSymbol = getNodeLinks(parent2).resolvedSymbol;
65206
65208
  const meaning = parent2.isTypeOf ? 111551 : 788968;
65207
65209
  const parentSymbol = nodeSymbol && isSymbolAccessible(
@@ -65231,7 +65233,9 @@ ${lanes.join("\n")}
65231
65233
  context.tracker.reportLikelyUnsafeImportRequiredError(name);
65232
65234
  }
65233
65235
  }
65234
- return name;
65236
+ if (name !== originalName) {
65237
+ return name;
65238
+ }
65235
65239
  }
65236
65240
  },
65237
65241
  canReuseTypeNode(context, typeNode) {
@@ -66422,6 +66426,7 @@ ${lanes.join("\n")}
66422
66426
  if (propertySymbol.flags & 98304) {
66423
66427
  const writeType = getWriteTypeOfSymbol(propertySymbol);
66424
66428
  if (propertyType !== writeType && !isErrorType(propertyType) && !isErrorType(writeType)) {
66429
+ const symbolMapper = getSymbolLinks(propertySymbol).mapper;
66425
66430
  const getterDeclaration = getDeclarationOfKind(
66426
66431
  propertySymbol,
66427
66432
  177
@@ -66431,7 +66436,7 @@ ${lanes.join("\n")}
66431
66436
  typeElements.push(
66432
66437
  setCommentRange2(
66433
66438
  context,
66434
- signatureToSignatureDeclarationHelper(getterSignature, 177, context, { name: propertyName }),
66439
+ signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(getterSignature, symbolMapper) : getterSignature, 177, context, { name: propertyName }),
66435
66440
  getterDeclaration
66436
66441
  )
66437
66442
  );
@@ -66444,7 +66449,7 @@ ${lanes.join("\n")}
66444
66449
  typeElements.push(
66445
66450
  setCommentRange2(
66446
66451
  context,
66447
- signatureToSignatureDeclarationHelper(setterSignature, 178, context, { name: propertyName }),
66452
+ signatureToSignatureDeclarationHelper(symbolMapper ? instantiateSignature(setterSignature, symbolMapper) : setterSignature, 178, context, { name: propertyName }),
66448
66453
  setterDeclaration
66449
66454
  )
66450
66455
  );
@@ -67723,13 +67728,13 @@ ${lanes.join("\n")}
67723
67728
  const addUndefinedForParameter = declaration && (isParameter(declaration) || isJSDocParameterTag(declaration)) && requiresAddingImplicitUndefined(declaration, context.enclosingDeclaration);
67724
67729
  const decl = (_b = (_a2 = declaration != null ? declaration : symbol.valueDeclaration) != null ? _a2 : getDeclarationWithTypeAnnotation(symbol)) != null ? _b : (_a = symbol.declarations) == null ? void 0 : _a[0];
67725
67730
  if (decl) {
67731
+ const restore = addSymbolTypeToContext(context, symbol, type);
67726
67732
  if (isAccessor(decl)) {
67727
67733
  result = syntacticNodeBuilder.serializeTypeOfAccessor(decl, symbol, context);
67728
67734
  } else if (hasInferredType(decl) && !nodeIsSynthesized(decl) && !(getObjectFlags(type) & 196608)) {
67729
- const restore = addSymbolTypeToContext(context, symbol, type);
67730
67735
  result = syntacticNodeBuilder.serializeTypeOfDeclaration(decl, symbol, context);
67731
- restore();
67732
67736
  }
67737
+ restore();
67733
67738
  }
67734
67739
  if (!result) {
67735
67740
  if (addUndefinedForParameter) {
@@ -67902,10 +67907,7 @@ ${lanes.join("\n")}
67902
67907
  /*context*/
67903
67908
  void 0
67904
67909
  );
67905
- if (updated !== node2) {
67906
- setTextRange2(context, updated, node2);
67907
- }
67908
- return updated;
67910
+ return setTextRange2(context, updated, node2);
67909
67911
  }
67910
67912
  }
67911
67913
  function serializeTypeName(context, node, isTypeOf, typeArguments) {
@@ -93639,6 +93641,11 @@ ${lanes.join("\n")}
93639
93641
  ])) {
93640
93642
  grammarErrorOnNode(node, Diagnostics.This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead);
93641
93643
  }
93644
+ if (compilerOptions.erasableSyntaxOnly) {
93645
+ const start = skipTrivia(file.text, node.pos);
93646
+ const end = node.expression.pos;
93647
+ diagnostics.add(createFileDiagnostic(file, start, end - start, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled));
93648
+ }
93642
93649
  }
93643
93650
  return checkAssertionWorker(node, checkMode);
93644
93651
  }
@@ -102614,11 +102621,10 @@ ${lanes.join("\n")}
102614
102621
  return;
102615
102622
  }
102616
102623
  checkGrammarModifiers(node);
102617
- const isImportEquals = isInternalModuleImportEqualsDeclaration(node);
102618
- if (compilerOptions.erasableSyntaxOnly && isImportEquals && !(node.flags & 33554432)) {
102624
+ if (compilerOptions.erasableSyntaxOnly && !(node.flags & 33554432)) {
102619
102625
  error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
102620
102626
  }
102621
- if (isImportEquals || checkExternalImportOrExportDeclaration(node)) {
102627
+ if (isInternalModuleImportEqualsDeclaration(node) || checkExternalImportOrExportDeclaration(node)) {
102622
102628
  checkImportBinding(node);
102623
102629
  markLinkedReferences(
102624
102630
  node,
@@ -102762,6 +102768,9 @@ ${lanes.join("\n")}
102762
102768
  if (checkGrammarModuleElementContext(node, illegalContextMessage)) {
102763
102769
  return;
102764
102770
  }
102771
+ if (compilerOptions.erasableSyntaxOnly && node.isExportEquals && !(node.flags & 33554432)) {
102772
+ error2(node, Diagnostics.This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled);
102773
+ }
102765
102774
  const container = node.parent.kind === 307 ? node.parent : node.parent.parent;
102766
102775
  if (container.kind === 267 && !isAmbientModule(container)) {
102767
102776
  if (node.isExportEquals) {
@@ -153158,9 +153167,11 @@ ${lanes.join("\n")}
153158
153167
  if (!resolver.canReuseTypeNode(context, node)) {
153159
153168
  return resolver.serializeExistingTypeNode(context, node);
153160
153169
  }
153170
+ const specifier = rewriteModuleSpecifier2(node, node.argument.literal);
153171
+ const literal = specifier === node.argument.literal ? reuseNode(context, node.argument.literal) : specifier;
153161
153172
  return factory.updateImportTypeNode(
153162
153173
  node,
153163
- factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier2(node, node.argument.literal)),
153174
+ literal === node.argument.literal ? reuseNode(context, node.argument) : factory.createLiteralTypeNode(literal),
153164
153175
  visitNode(node.attributes, visitExistingNodeTreeSymbols, isImportAttributes),
153165
153176
  visitNode(node.qualifier, visitExistingNodeTreeSymbols, isEntityName),
153166
153177
  visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
@@ -153322,10 +153333,7 @@ ${lanes.join("\n")}
153322
153333
  }
153323
153334
  function rewriteModuleSpecifier2(parent2, lit) {
153324
153335
  const newName = resolver.getModuleSpecifierOverride(context, parent2, lit);
153325
- if (newName) {
153326
- return setOriginalNode(factory.createStringLiteral(newName), lit);
153327
- }
153328
- return visitNode(lit, visitExistingNodeTreeSymbols, isStringLiteral);
153336
+ return newName ? setOriginalNode(factory.createStringLiteral(newName), lit) : lit;
153329
153337
  }
153330
153338
  }
153331
153339
  }
@@ -153507,12 +153515,7 @@ ${lanes.join("\n")}
153507
153515
  });
153508
153516
  }
153509
153517
  if (accessorDeclarations.getAccessor) {
153510
- return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature(
153511
- accessorDeclarations.getAccessor,
153512
- /*symbol*/
153513
- void 0,
153514
- context
153515
- ));
153518
+ return withNewScope(context, accessorDeclarations.getAccessor, () => createReturnFromSignature(accessorDeclarations.getAccessor, symbol, context));
153516
153519
  }
153517
153520
  return void 0;
153518
153521
  }
@@ -153632,7 +153635,7 @@ ${lanes.join("\n")}
153632
153635
  /* AnyKeyword */
153633
153636
  );
153634
153637
  }
153635
- function inferReturnTypeOfSignatureSignature(node, context, reportFallback) {
153638
+ function inferReturnTypeOfSignatureSignature(node, context, symbol, reportFallback) {
153636
153639
  var _a;
153637
153640
  if (reportFallback) {
153638
153641
  context.tracker.reportInferenceFallback(node);
@@ -153643,7 +153646,7 @@ ${lanes.join("\n")}
153643
153646
  /* AnyKeyword */
153644
153647
  );
153645
153648
  }
153646
- return (_a = resolver.serializeReturnTypeForSignature(context, node)) != null ? _a : factory.createKeywordTypeNode(
153649
+ return (_a = resolver.serializeReturnTypeForSignature(context, node, symbol)) != null ? _a : factory.createKeywordTypeNode(
153647
153650
  133
153648
153651
  /* AnyKeyword */
153649
153652
  );
@@ -153959,18 +153962,17 @@ ${lanes.join("\n")}
153959
153962
  );
153960
153963
  }
153961
153964
  function reuseTypeParameters(typeParameters, context) {
153962
- return typeParameters == null ? void 0 : typeParameters.map(
153963
- (tp) => {
153964
- var _a;
153965
- return factory.updateTypeParameterDeclaration(
153966
- tp,
153967
- (_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)),
153968
- reuseNode(context, tp.name),
153969
- serializeExistingTypeNodeWithFallback(tp.constraint, context),
153970
- serializeExistingTypeNodeWithFallback(tp.default, context)
153971
- );
153972
- }
153973
- );
153965
+ return typeParameters == null ? void 0 : typeParameters.map((tp) => {
153966
+ var _a;
153967
+ const { node: tpName } = resolver.trackExistingEntityName(context, tp.name);
153968
+ return factory.updateTypeParameterDeclaration(
153969
+ tp,
153970
+ (_a = tp.modifiers) == null ? void 0 : _a.map((m) => reuseNode(context, m)),
153971
+ tpName,
153972
+ serializeExistingTypeNodeWithFallback(tp.constraint, context),
153973
+ serializeExistingTypeNodeWithFallback(tp.default, context)
153974
+ );
153975
+ });
153974
153976
  }
153975
153977
  function typeFromObjectLiteralMethod(method, name, context, isConstContext) {
153976
153978
  const returnType = createReturnFromSignature(
@@ -154125,7 +154127,7 @@ ${lanes.join("\n")}
154125
154127
  } else if (isValueSignatureDeclaration(fn)) {
154126
154128
  returnType = typeFromSingleReturnExpression(fn, context);
154127
154129
  }
154128
- return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, reportFallback && returnType.reportFallback && !returnTypeNode);
154130
+ return returnType.type !== void 0 ? returnType.type : inferReturnTypeOfSignatureSignature(fn, context, symbol, reportFallback && returnType.reportFallback && !returnTypeNode);
154129
154131
  }
154130
154132
  function typeFromSingleReturnExpression(declaration, context) {
154131
154133
  let candidateExpr;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@angular/language-server",
3
3
  "description": "LSP server for Angular Language Service",
4
- "version": "19.2.4",
4
+ "version": "20.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/angular/vscode-ng-language-service.git"
@@ -9,13 +9,13 @@
9
9
  "author": "Angular",
10
10
  "license": "MIT",
11
11
  "engines": {
12
- "node": "^18.19.1 || ^20.11.1"
12
+ "node": "^20.11.1 || ^22.11.0"
13
13
  },
14
14
  "bin": {
15
15
  "ngserver": "./bin/ngserver"
16
16
  },
17
17
  "dependencies": {
18
- "@angular/language-service": "19.2.7",
18
+ "@angular/language-service": "20.0.0-rc.0",
19
19
  "vscode-html-languageservice": "^4.2.5",
20
20
  "vscode-jsonrpc": "6.0.0",
21
21
  "vscode-languageserver": "7.0.0",