Skip to content

Latest commit

 

History

History
83 lines (64 loc) · 4.24 KB

CONTRIBUTING.md

File metadata and controls

83 lines (64 loc) · 4.24 KB

How to contribute

Contributions are essential for keeping this extension great. We try to keep it as easy as possible to contribute changes and we are open to suggesstions for making it even easier. There are only a few guidelines that we need contributors to follow.

vscode-java vs eclipse.jdt.ls

vscode-java is a Visual Studio Code extension that uses a language server for its Java language smartness. Usually vscode-java features depend on the Eclipse ™ JDT Language Server, (a.k.a. eclipse.jdt.ls) and the contributions should be coordinated between the two repositories.

First Time Setup

  1. Install prerequisites:

  2. Fork and clone the repository

  3. cd vscode-java

  4. Install the dependencies:

    $ npm install
  5. Open the folder in VS Code

Building Eclipse ™ JDT Language Server

This assumes that you are starting on the vscode-java directory

  1. cd ..

  2. Fork and clone the eclipse.jdt.ls repository

  3. Build server

    $ cd ..\vscode-java
    $ npm run build-server

You can run faster server builds during development by calling ./node_modules/.bin/gulp dev_server script instead, this will build server binaries that are required by your host OS only. You can also use npm run watch-server which will build and place them on the extension for Java changes. These commands run Maven in offline mode, so you might need to run build-server at least once, to fetch all the dependencies.

This will build and place the binaries under the server folder. Alternately you can download and use the latest snapshot build from Eclipse ™ JDT Language Server project with the following

```bash
$ cd ..\vscode-java
$ ./node_modules/.bin/gulp download_server
```

Run with a remote JDT language server

While developping the language server and the extension, you don't need to deploy the server every time to try out changes. Instead you can run the language server out of its Eclipse workspace:

  • Open VSCode on the vscode-java folder
  • In the debug viewlet, run the launch Launch Extension - Remote Server
  • The extension will open a socket on port 3333 and will wait for the JDT language server to connect
  • In Eclipse, run the JDT language server as an Eclipse application.
    • Create a debug configuration of type Eclipse Application.
    • in the main tab of the debug configuration set the product to org.eclipse.jdt.ls.core.product.
    • in the Environment tab, define a variable CLIENT_PORT with value 3333.
    • if your workspace contains 'org.eclipse.jdt.ui', use the Plug-Ins tab in the debug configuration to exclude the plug-in. The presence of 'org.eclipse.jdt.ui' will cause the language server to hang.
  • In the debug console of VSCode you can see if the connection was sucessful.
  • When the server is running breakpoints can be reached and hot code replace can be used to make fixes without restarting the server.
  • You can modify launch.json to use a different port:
    • Modify SERVER_PORT to specify the port the JST LS server should connect to.

Sideloading

You can create a binary that you can sideload to your VS Code installation.

  1. Fork and clone this repository

  2. cd vscode-java

  3. Install the dependencies:

    $ npm install
  4. Optionally, follow the instruction to build the server.

  5. See documentation on extension installation on ways to sideload or share.

Reporting issues

If you encounter a problem and know it is caused by eclipse.jdt.ls, then please open a bug report over there. In doubt, you can report issues in the vscode-java issue tracker.

Try to collect as much informations as you can to describe the issue and help us reproduce the problem. Head over to the troubleshooting page to see how to collect useful logging informations.