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

docs: More Java extension documentation #19390

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions docs/src/languages/java.md
Copy link
Contributor

@valentinegb valentinegb Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong line! Initialize Request section of the Eclipse.jdt.ls Wiki is what we want, JDTLS Language Server Settings & Capabilities is what we don’t want.
(Edit: this comment was meant to be on specifically a5d5edb, sorry.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL. Put up a PR and I'll merge it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, you'll have to give me a few minutes though since I just got home, sorry.

Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ Both use:

## Pre-requisites

You will need to install both a Java runtime (OpenJDK) and Eclipse JDT Language Server (`eclipse.jdt.ls`).

### Install OpenJDK

You will need to install a Java runtime (OpenJDK).

- MacOS: `brew install openjdk`
- Ubuntu: `sudo add-apt-repository ppa:openjdk-23 && sudo apt-get install openjdk-23`
- Windows: `choco install openjdk`
- Arch Linux: `sudo pacman -S jre-openjdk-headless`

Or manually download and install [OpenJDK 23](https://jdk.java.net/23/).

### Install JDTLS
### (Optional) Install JDTLS

If you are using Java with Eclipse JDTLS, you can skip this section as it will automatically download a binary for you.

If you are using Zed Java you need to install your own copy of Eclipse JDT Language Server (`eclipse.jdt.ls`).

- MacOS: `brew install jdtls`
- Arch: [`jdtls` from AUR](https://aur.archlinux.org/packages/jdtls)
Expand All @@ -40,7 +44,7 @@ We recommend you install one or the other and not both.

## Settings / Initialization Options

See [JDTLS Language Server Settings & Capabilities](https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Language-Server-Settings-&-Capabilities) for a complete list of options.
See [JDTLS Language Server Settings & Capabilities](https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Language-Server-Settings-&-Capabilities) for a complete list of settings.

Add the following to your Zed Settings by launching {#action zed::OpenSettings}({#kb zed::OpenSettings}).

Expand All @@ -52,7 +56,6 @@ Add the following to your Zed Settings by launching {#action zed::OpenSettings}(
"jdtls": {
"settings": {},
"initialization_options": {}
}
}
}
}
Expand All @@ -76,7 +79,7 @@ Add the following to your Zed Settings by launching {#action zed::OpenSettings}(
- [Zed Java Readme](https://github.com/zed-extensions/java)
- [Java with Eclipse JDTLS Readme](https://github.com/ABckh/zed-java-eclipse-jdtls)

### Support
## Support

If you have issues with either of these plugins, please open issues on their respective repositories:

Expand All @@ -101,7 +104,7 @@ You can optionally configure the class path that JDTLS uses with:
}
```

#### Zed Java Initialization Options
### Zed Java Initialization Options

There are also many more options you can pass directly to the language server, for example:

Expand Down Expand Up @@ -184,7 +187,7 @@ There are also many more options you can pass directly to the language server, f
}
```

## Java with Eclipse JTDLS Configuration {#zed-java-eclipse-configuration}
### Java with Eclipse JTDLS Configuration {#zed-java-eclipse-configuration}

Configuration options match those provided in the [redhat-developer/vscode-java extension](https://github.com/redhat-developer/vscode-java#supported-vs-code-settings).

Expand Down