-
Notifications
You must be signed in to change notification settings - Fork 420
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
Run with remote Java LS #250
Run with remote Java LS #250
Conversation
Can you add these new instructions to https://github.com/redhat-developer/vscode-java/blob/master/CONTRIBUTING.md please? |
Seems I got a chicken/egg kind of problem. When I launch the vscode extension - remote server, it fails with
Then when launching the server, I get:
|
@fbricon Please try again, there was a bug with deleting the socket file |
CONTRIBUTING.md
Outdated
|
||
While developping the language server and the extension, you don't need to deploy the server every time to try out a change. Instead you can run the language server out of its Eclipse workspace: | ||
|
||
- Open VSCOde on the vscode-java folder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS Code
CONTRIBUTING.md
Outdated
While developping the language server and the extension, you don't need to deploy the server every time to try out a change. Instead you can run the language server out of its Eclipse workspace: | ||
|
||
- Open VSCOde on the vscode-java folder | ||
- In the debug viewlet, tun the launch 'Launch Extension - Remote Server' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/tun/run
CONTRIBUTING.md
Outdated
- in the main tab set the product to `org.eclipse.jdt.ls.core.product` | ||
- in the environment, define a variable `INOUT_PIPE_NAME` with value `javals` | ||
- in the plug-ins tab make sure that 'org.eclipse.jdt.ui' is not part of the plugins. Otherwise the the java.ui will be loaded throigh some extension points and will replace the primary buffer provider | ||
- In the debug cosole of VSCode you will see if the connection was sucessful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console of VS Code
successful
Works fine on macOS, would like confirmation everything is ok on Windows/Linux before merging. |
Since STDIN_PIPE_NAME and STDOUT_PIPE_NAME are being removed server side, matching changes should be done in this PR |
I tested on Windows had has some strange hangs. I added socket support as well, and this seems to run reliably on Windows and Linux. If you can have a try on the Mac that would be great. I reverted the changes to the pipes as I realized that they are used for the regular launch. For connecting a remote server, only socket is supported for now. It's now a single socket and I hope I didn't break any clients (otherwise I can bringe the dual socket back as well). |
let serverOptions = runServer.bind(null, workspacePath, getJavaConfiguration()); | ||
let serverOptions; | ||
let port = process.env['SERVER_PORT']; | ||
if (!port) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it works well, maybe we could switch default mode to using sockets too. That'd allow running on linux 32b (See #201).
So logic would be: if no defined port, then find an open port and initiate socket.
Lets the vscode-java extension run with a Java LS server that is started separately, e.g. out of Eclipse. That speeds up development as the LS server doesn't need to be built every time for trying out changes. When the server is run out of Eclipse, hot code replace lets you make fixes without restarting the server
org.eclipse.jdt.ls.core.product
CLIENT_PORT
to3333