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

Language Server Requires npx #19

Open
Niels-Erik opened this issue Oct 28, 2024 · 10 comments
Open

Language Server Requires npx #19

Niels-Erik opened this issue Oct 28, 2024 · 10 comments

Comments

@Niels-Erik
Copy link

It seemed like the language server wasn't working while working in vs code outside of a dev container.
However I found that it needs npx to run:

Activating Jolie Language Server
starting "cmd.exe /C npx --package=@jolie/languageserver@^1.0.0 joliels 9743"
'npx' is not recognized as an internal or external command,
operable program or batch file.

I would've assumed it gave an error that the server didn't start, and that npx was required.

@kicito
Copy link
Contributor

kicito commented Oct 28, 2024

Thank you for reporting, the new version(2.0) should include a more meaningful log/message on the editor.

@Niels-Erik
Copy link
Author

I installed npm/npx and got other errors, though I think it's because the language server does not work on windows.
I get the following output:

Activating Jolie Language Server
starting "cmd.exe /C npx --package=@jolie/languageserver@^1.0.0 joliels 9743"
Jolie says: Utils Service started at local://Utils, connected to local://Client

okt. 29, 2024 3:57:44 PM text-document.ol
SEVERE: C:\Users\niels\AppData\Local\npm-cache\_npx\e5d520739897bed5\node_modules\@jolie\languageserver\internal\text-document.ol:74: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: inspector.Inspector

okt. 29, 2024 3:57:44 PM workspace.ol
SEVERE: C:\Users\niels\AppData\Local\npm-cache\_npx\e5d520739897bed5\node_modules\@jolie\languageserver\internal\workspace.ol:40: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: inspector.Inspector

okt. 29, 2024 3:57:44 PM inspection-utils.ol
SEVERE: C:\Users\niels\AppData\Local\npm-cache\_npx\e5d520739897bed5\node_modules\@jolie\languageserver\internal\inspection-utils.ol:39: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: inspector.Inspector

okt. 29, 2024 3:57:44 PM completionHelper.ol
SEVERE: C:\Users\niels\AppData\Local\npm-cache\_npx\e5d520739897bed5\node_modules\@jolie\languageserver\internal\completionHelper.ol:63: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: inspector.PathsInJolie

Jolie says: Jolie Language Server started

Jolie says: Initialize message received

Jolie says: Initialization done 

I would again have expected the server to give an error.

@kicito
Copy link
Contributor

kicito commented Oct 30, 2024

I'm sorry for what you experienced, the error you encountered seems to be a bug from Jolie itself, not the extension. Looking at the log, can you ensure that lib/jolie-inspector-0.1.0.jar exists in C:\Users\niels\AppData\Local\npm-cache\_npx\e5d520739897bed5\node_modules\@jolie\languageserver? and what is your jolie version?

@Niels-Erik
Copy link
Author

I've tested it on the release (1.12.1) and a version created from the master branch on jolie/jolie@6c4a2c8.
The folder, lib, does not exist at the given path.

@kicito
Copy link
Contributor

kicito commented Oct 31, 2024

I see. I assumed that your local language server library is outdated. In the recent versions (1.0.4), that directory should be available in the library. Could you try to remove the npx cache and restart the extension?

@Niels-Erik
Copy link
Author

Yes I restarted the extension, however it it stuck in another way:
output of Jolie LSP Clint:
vscode-jolie lsp client: Start Jolie Language Server.
output of Jolie LSP server:

Start LS Process with command cmd.exe /C npx --package=@jolie/languageserver@^2.0.0 joliels 9743
npm warn exec The following package was not found and will be installed: @jolie/[email protected]

I deleted my npx cache and it seems that it is not downloading the new language server, or just downloads an empty folder.
however running cmd.exe /C npx --package=@jolie/languageserver@^2.0.1 joliels 9743 in my terminal makes a folder that contains the language server.

@Niels-Erik
Copy link
Author

Changing the extension code to use 2.0.1 it gives the following error now:

Start LS Process with command cmd.exe /C npx --package=@jolie/languageserver@^2.0.1 joliels 9743
okt. 31, 2024 4:04:44 PM launcher.ol
SEVERE: C:\Users\Niels Erik Jepsen\AppData\Local\npm-cache\_npx\1ebc473884da2048\node_modules\.bin\..\@jolie\languageserver\launcher.ol:31: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: joliex.lang.RuntimeService

okt. 31, 2024 4:04:44 PM launcher.ol
SEVERE: C:\Users\Niels Erik Jepsen\AppData\Local\npm-cache\_npx\1ebc473884da2048\node_modules\.bin\..\@jolie\languageserver\launcher.ol:32: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: joliex.io.FileService

Error: service initialisation failed

@Niels-Erik
Copy link
Author

I checked on my laptop again with the change from my former comment, where it mostly work.

@kicito
Copy link
Contributor

kicito commented Nov 1, 2024

Today I tried the extension on Windows and fixed some issues on the vscode-jolie version 2.0.2. But it won't fix your recent error (quoted), as it indicates that your Jolie installation or the path environment is corrupt (unable to find standard libs Java classes). The extension requires Jolie version from master branch. After updating the extension and installing Jolie from git, please check your JOLIE_HOME / PATH, they should point to the directories in dist path e.g. JOLIE_HOME={JOLIE_REPO}/dist/jolie.

Changing the extension code to use 2.0.1 it gives the following error now:

Start LS Process with command cmd.exe /C npx --package=@jolie/languageserver@^2.0.1 joliels 9743
okt. 31, 2024 4:04:44 PM launcher.ol
SEVERE: C:\Users\Niels Erik Jepsen\AppData\Local\npm-cache\_npx\1ebc473884da2048\node_modules\.bin\..\@jolie\languageserver\launcher.ol:31: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: joliex.lang.RuntimeService

okt. 31, 2024 4:04:44 PM launcher.ol
SEVERE: C:\Users\Niels Erik Jepsen\AppData\Local\npm-cache\_npx\1ebc473884da2048\node_modules\.bin\..\@jolie\languageserver\launcher.ol:32: jolie.runtime.embedding.EmbeddedServiceCreationException: java.lang.ClassNotFoundException: joliex.io.FileService

Error: service initialisation failed

@Niels-Erik
Copy link
Author

I works now thank you.
However there is some caveats that I'll write up in some other issues.

I'll close this issue when the requirement specifies the need for npx/npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants