@angular/language-server 17.0.1 → 17.0.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.
Files changed (2) hide show
  1. package/index.js +22 -13
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -28,6 +28,7 @@ var require_cmdline_utils = __commonJS({
28
28
  return argv.includes(argName);
29
29
  }
30
30
  function parseCommandLine(argv) {
31
+ var _a;
31
32
  return {
32
33
  help: hasArgument(argv, "--help"),
33
34
  logFile: findArgument(argv, "--logFile"),
@@ -35,6 +36,7 @@ var require_cmdline_utils = __commonJS({
35
36
  logToConsole: hasArgument(argv, "--logToConsole"),
36
37
  ngProbeLocations: parseStringArray(argv, "--ngProbeLocations"),
37
38
  tsProbeLocations: parseStringArray(argv, "--tsProbeLocations"),
39
+ tsdk: (_a = findArgument(argv, "--tsdk")) !== null && _a !== void 0 ? _a : null,
38
40
  includeAutomaticOptionalChainCompletions: hasArgument(argv, "--includeAutomaticOptionalChainCompletions"),
39
41
  includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText"),
40
42
  forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates"),
@@ -236,9 +238,9 @@ var require_version_provider = __commonJS({
236
238
  }
237
239
  throw new Error(`Failed to resolve '${packageName}' with minimum version '${minVersion}' from ` + JSON.stringify(probeLocations, null, 2));
238
240
  }
239
- function resolveTsServer(probeLocations) {
240
- if (probeLocations.length > 0) {
241
- const resolvedFromTsdk = resolveTsServerFromTsdk(probeLocations[0], probeLocations.slice(1));
241
+ function resolveTsServer(probeLocations, tsdk) {
242
+ if (tsdk !== null) {
243
+ const resolvedFromTsdk = resolveTsServerFromTsdk(tsdk, probeLocations);
242
244
  const minVersion = new resolver_1.Version(MIN_TS_VERSION);
243
245
  if (resolvedFromTsdk !== void 0) {
244
246
  if (resolvedFromTsdk.version.greaterThanOrEqual(minVersion)) {
@@ -303,8 +305,8 @@ function requireOverride(moduleName) {
303
305
  throw new Error(`Import '${TSSERVER}' instead of 'typescript'`);
304
306
  }
305
307
  if (moduleName === TSSERVER) {
306
- const { tsProbeLocations } = (0, cmdline_utils_1.parseCommandLine)(process.argv);
307
- moduleName = (0, version_provider_1.resolveTsServer)(tsProbeLocations).resolvedPath;
308
+ const { tsProbeLocations, tsdk } = (0, cmdline_utils_1.parseCommandLine)(process.argv);
309
+ moduleName = (0, version_provider_1.resolveTsServer)(tsProbeLocations, tsdk).resolvedPath;
308
310
  }
309
311
  return originalRequire(moduleName);
310
312
  }
@@ -401,6 +403,7 @@ var require_cmdline_utils = __commonJS({
401
403
  return argv.includes(argName);
402
404
  }
403
405
  function parseCommandLine(argv) {
406
+ var _a;
404
407
  return {
405
408
  help: hasArgument(argv, "--help"),
406
409
  logFile: findArgument(argv, "--logFile"),
@@ -408,6 +411,7 @@ var require_cmdline_utils = __commonJS({
408
411
  logToConsole: hasArgument(argv, "--logToConsole"),
409
412
  ngProbeLocations: parseStringArray(argv, "--ngProbeLocations"),
410
413
  tsProbeLocations: parseStringArray(argv, "--tsProbeLocations"),
414
+ tsdk: (_a = findArgument(argv, "--tsdk")) !== null && _a !== void 0 ? _a : null,
411
415
  includeAutomaticOptionalChainCompletions: hasArgument(argv, "--includeAutomaticOptionalChainCompletions"),
412
416
  includeCompletionsWithSnippetText: hasArgument(argv, "--includeCompletionsWithSnippetText"),
413
417
  forceStrictTemplates: hasArgument(argv, "--forceStrictTemplates"),
@@ -759,9 +763,9 @@ var require_server_host = __commonJS({
759
763
  }
760
764
  });
761
765
 
762
- // ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@17.0.1/node_modules/@angular/language-service/api_bundle.js
766
+ // ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@17.0.2/node_modules/@angular/language-service/api_bundle.js
763
767
  var require_api_bundle = __commonJS({
764
- "../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@17.0.1/node_modules/@angular/language-service/api_bundle.js"(exports2, module2) {
768
+ "../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@angular+language-service@17.0.2/node_modules/@angular/language-service/api_bundle.js"(exports2, module2) {
765
769
  var __defProp2 = Object.defineProperty;
766
770
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
767
771
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
@@ -192200,7 +192204,8 @@ var require_session = __commonJS({
192200
192204
  if (!project.languageServiceEnabled) {
192201
192205
  return;
192202
192206
  }
192203
- project.disableLanguageService(`Disabling language service for ${project.getProjectName()} because ${reason}.`);
192207
+ this.info(`Disabling language service for ${project.getProjectName()} because ${reason}.`);
192208
+ project.disableLanguageService();
192204
192209
  }
192205
192210
  /**
192206
192211
  * Invoke the compiler for the first time so that external templates get
@@ -192244,6 +192249,7 @@ var require_session = __commonJS({
192244
192249
  * @param event
192245
192250
  */
192246
192251
  handleProjectServiceEvent(event) {
192252
+ var _a;
192247
192253
  switch (event.eventName) {
192248
192254
  case ts.server.ProjectLoadingStartEvent:
192249
192255
  this.isProjectLoading = true;
@@ -192259,6 +192265,8 @@ var require_session = __commonJS({
192259
192265
  const angularCore = this.findAngularCore(project);
192260
192266
  if (angularCore) {
192261
192267
  this.enableLanguageServiceForProject(project);
192268
+ } else if ((_a = project.getProjectReferences()) === null || _a === void 0 ? void 0 : _a.length) {
192269
+ this.info(`@angular/core could not be found for project ${project.getProjectName()} but it has references that might. The Angular language service will remain enabled for this project.`);
192262
192270
  } else {
192263
192271
  this.disableLanguageServiceForProject(project, `project is not an Angular project ('@angular/core' could not be found)`);
192264
192272
  }
@@ -193076,9 +193084,9 @@ var require_version_provider = __commonJS({
193076
193084
  }
193077
193085
  throw new Error(`Failed to resolve '${packageName}' with minimum version '${minVersion}' from ` + JSON.stringify(probeLocations, null, 2));
193078
193086
  }
193079
- function resolveTsServer(probeLocations) {
193080
- if (probeLocations.length > 0) {
193081
- const resolvedFromTsdk = resolveTsServerFromTsdk(probeLocations[0], probeLocations.slice(1));
193087
+ function resolveTsServer(probeLocations, tsdk) {
193088
+ if (tsdk !== null) {
193089
+ const resolvedFromTsdk = resolveTsServerFromTsdk(tsdk, probeLocations);
193082
193090
  const minVersion = new resolver_1.Version(MIN_TS_VERSION);
193083
193091
  if (resolvedFromTsdk !== void 0) {
193084
193092
  if (resolvedFromTsdk.version.greaterThanOrEqual(minVersion)) {
@@ -193133,6 +193141,7 @@ var require_version_provider = __commonJS({
193133
193141
 
193134
193142
  // ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/server/src/server.js
193135
193143
  Object.defineProperty(exports, "__esModule", { value: true });
193144
+ var tsserverlibrary_1 = require("typescript/lib/tsserverlibrary");
193136
193145
  var cmdline_utils_1 = require_cmdline_utils();
193137
193146
  var options = (0, cmdline_utils_1.parseCommandLine)(process.argv);
193138
193147
  if (options.help) {
@@ -193148,7 +193157,7 @@ function main() {
193148
193157
  logFile: options.logFile,
193149
193158
  logVerbosity: options.logVerbosity
193150
193159
  });
193151
- const ts = (0, version_provider_1.resolveTsServer)(options.tsProbeLocations);
193160
+ const ts = (0, version_provider_1.resolveTsServer)(options.tsProbeLocations, options.tsdk);
193152
193161
  const ng = (0, version_provider_1.resolveNgLangSvc)(options.ngProbeLocations);
193153
193162
  const isG3 = ts.resolvedPath.includes("/google3/");
193154
193163
  const host = new server_host_1.ServerHost(isG3);
@@ -193165,7 +193174,7 @@ function main() {
193165
193174
  disableBlockSyntax: options.disableBlockSyntax
193166
193175
  });
193167
193176
  session.info(`Angular language server process ID: ${process.pid}`);
193168
- session.info(`Using ${ts.name} v${ts.version} from ${ts.resolvedPath}`);
193177
+ session.info(`Imported typescript/lib/tsserverlibrary is version ${tsserverlibrary_1.version}.`);
193169
193178
  session.info(`Using ${ng.name} v${ng.version} from ${ng.resolvedPath}`);
193170
193179
  if (logger.loggingEnabled()) {
193171
193180
  session.info(`Log file: ${logger.getLogFileName()}`);
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": "17.0.1",
4
+ "version": "17.0.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/angular/vscode-ng-language-service.git"
@@ -15,7 +15,7 @@
15
15
  "ngserver": "./bin/ngserver"
16
16
  },
17
17
  "dependencies": {
18
- "@angular/language-service": "17.0.1",
18
+ "@angular/language-service": "17.0.2",
19
19
  "vscode-html-languageservice": "^4.2.5",
20
20
  "vscode-jsonrpc": "6.0.0",
21
21
  "vscode-languageserver": "7.0.0",