Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot display the language server help page #1899

Closed
1 of 2 tasks
gautaz opened this issue Jun 24, 2023 · 1 comment · Fixed by #1910
Closed
1 of 2 tasks

Cannot display the language server help page #1899

gautaz opened this issue Jun 24, 2023 · 1 comment · Fixed by #1910
Labels

Comments

@gautaz
Copy link

gautaz commented Jun 24, 2023

🐞 bug report

Is this a regression?

Tested with versions 16.0.0 and 13.3.4.

Description

The server README.md states:

Usage
See node index.js --help

For now, I have been unable to display this documentation page.

Bug Type

It is quite difficult to start using the language server without even being able to access its documentation.

  • Angular Language Service VSCode extension
  • Angular Language Service server

Reproduction

I have followed these steps:

mkdir test-ngserver && cd test-ngserver
npm init -y
npm install @angular/language-server
cd node_modules/@angular/language-server/
node index.js --help

which leads to the following stack trace:

/home/gautaz/test-ngserver/node_modules/@angular/language-server/index.js:235
      throw new Error(`Failed to resolve '${packageName}' with minimum version '${minVersion}' from ` + JSON.stringify(probeLocations, null, 2));
      ^

Error: Failed to resolve 'typescript/lib/tsserverlibrary' with minimum version '4.8' from []
    at resolveWithMinVersion (/home/gautaz/test-ngserver/node_modules/@angular/language-server/index.js:235:13)
    at resolveTsServer (/home/gautaz/test-ngserver/node_modules/@angular/language-server/index.js:249:14)
    at requireOverride (/home/gautaz/test-ngserver/node_modules/@angular/language-server/index.js:305:57)
    at ../../../../../../../../execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/server/src/logger.js (/home/gautaz/test-ngserver/node_modules/@angular/language-server/index.js:449:27)
    at __require (/home/gautaz/test-ngserver/node_modules/@angular/language-server/index.js:323:50)
    at Object.<anonymous> (/home/gautaz/test-ngserver/node_modules/@angular/language-server/index.js:177713:16)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)

Node.js v18.14.2

Expected behavior

After installing the language server, the help page should be available without needing any additional dependency.

If a particular language server installation process is to be followed, this process should be accessible from the language server README.md page.

Logs

See Reproduction.

Screenshots

N/A

🌍 Your Environment

Angular Version:


This feels strange, if the language server relies on external dependencies
to display its help page (like other angular packages), shouldn't the language
server README.md state what these dependencies are and how they are accessed
by the language server?

Extension Version:


I am not using the vscode extension, I am only trying to start the
language server (tested with versions 16.0.0 and 13.3.4)

VSCode Version:


I am using Neovim, I am only trying to use the language server,
no vscode in the picture.

Operating System:


❯ uname -a
Linux dante 6.1.32 #1-NixOS SMP PREEMPT_DYNAMIC Mon Jun  5 07:26:22 UTC 2023 x86_64 GNU/Linux

Extension options:


N/A, I am not using the vscode extension.

Anything else relevant?

Nothing I can think of but I would be happy to provide any additional information.

@gautaz gautaz added the bug label Jun 24, 2023
atscott added a commit to atscott/vscode-ng-language-service that referenced this issue Aug 10, 2023
… any require statements

The `requireOverride` resolves TSServer from the command line arguments.
The `createLogger` import will end up executing this code. As a result,
we need to parse and show the help message before the logger import or
the --help option will fail due to a failure to resolve the TS
dependency.

fixes angular#1899
atscott added a commit that referenced this issue Aug 11, 2023
… any require statements (#1910)

The `requireOverride` resolves TSServer from the command line arguments.
The `createLogger` import will end up executing this code. As a result,
we need to parse and show the help message before the logger import or
the --help option will fail due to a failure to resolve the TS
dependency.

fixes #1899
atscott added a commit that referenced this issue Aug 11, 2023
… any require statements (#1910)

The `requireOverride` resolves TSServer from the command line arguments.
The `createLogger` import will end up executing this code. As a result,
we need to parse and show the help message before the logger import or
the --help option will fail due to a failure to resolve the TS
dependency.

fixes #1899

(cherry picked from commit 6d3267d)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
1 participant