Skip to content

Commit

Permalink
Provide jdt.ls Bootstrapping Documentation
Browse files Browse the repository at this point in the history
Provide information how to contribute to eclipse.jdt.ls while using
eclipse.jdt.ls (not VS-Code and not Eclispe).

Fixes #1953
  • Loading branch information
schrieveslaach authored and rgrunber committed Apr 7, 2022
1 parent d604bfb commit 7f502a3
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ There are only a few guidelines that we need contributors to follow.
Below are the details about how to set up the JDT Language Server in different IDEs. **Notice**: You only need set up it once in any of your preferred IDE.

### A) Setting up the JDT Language Server in VS Code
1) Please install [Eclipse PDE support](https://marketplace.visualstudio.com/items?itemName=yaozheng.vscode-pde) extension in your VS Code first. The PDE extension's home page provides more usage details about _Reload Target Platform_, _Run JUnit Plug-in Test_, _Run Eclipse Application_.
1) Please install [Eclipse PDE support][1] extension in your VS Code first. The PDE extension's home page provides more usage details about _Reload Target Platform_, _Run JUnit Plug-in Test_, _Run Eclipse Application_.

2) Open VS Code on the `eclipse.jdt.ls` folder. The PDE extension will work with Java extension together to automatically load the eclipse.jdt.ls project. Check the status of the language tools on the lower right corner. It should show ready (thumbs up) as the image below.
![status indicator](images/statusMarker.png)
Expand Down Expand Up @@ -49,10 +49,38 @@ this will get rid of the errors.

The errors should now be gone.

### C) Setting up the JDT Language Server in Neovim or Emacs

1) Please, download [Eclipse PDE support][1], open the `.vsix` file with a ZIP program and extract the folder `/extension/server/` into a local directory.

2) Ensure that [the initialize request][2] contains all paths to the extracted files in the [`bundles` parameter](https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request).

If you are using [`nvim-jdtls`](https://github.com/mfussenegger/nvim-jdtls), fill the `bundles` parameter with all JARs in the extracted folder to enable PDE support.

```lua
config['init_options'] = {
bundles = vim.split(vim.fn.glob("/path/to/extracted/folder/*.jar"), "\n")
}
```

You might have a look at [`nvim-jdtls-bundles`](https://gitlab.com/schrieveslaach/nvim-jdtls-bundles) that automates the process for you.

If you are using Emacs with [`lsp-java`](https://github.com/emacs-lsp/lsp-java), have a look at the configuration option `lsp-java-bundles`. For example, following configuration snippet enables PDE support:

```
(use-package lsp-java
:config (setq lsp-java-bundles (directory-files "/path/to/extracted/folder/" t ".jar"))
:hook (java-mode . lsp))
```

#

## Pull Requests

In order to submit contributions for review, please make sure you have signed the [Eclipse Contributor Agreement](https://www.eclipse.org/legal/ecafaq.php) (ECA) with your account.

Also, please ensure that your commit contains a `Signed-off-by` field with your name and account email in the footer. This is a confirmation that you are aware of the terms under which the contribution is being provided. This can be done with the `-s` flag of the `git commit` command.

[1]: https://marketplace.visualstudio.com/items?itemName=yaozheng.vscode-pde
[2]: https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request

0 comments on commit 7f502a3

Please sign in to comment.