835: Add an LS-specific settings use_system_java_home, gradle_wrapper_enabled and gradle_java_home

* fixes serena startup in cases where projects have a gradle wrapper which requires a specific JRE
This commit is contained in:
Thibault Kruse authored and Dominik Jain committed 2026-02-24 14:03:25 +01:00
1 parent 1e89449f40
commit 8c2f303636
2 files changed
+61 -6

No files matched your search

+21
View File
@@ -281,6 +281,27 @@ Notes:
- `GOFLAGS` (from the environment you start Serena in) may also affect the Go build context. Prefer `buildFlags` for tags.
- Build context changes are only picked up when `gopls` starts. After changing `gopls_settings` (or relevant env vars like `GOFLAGS`), restart the Serena process (or server) that hosts the Go language server, or use your client's "Restart language server" action if it causes `gopls` to restart.
#### Java (`eclipse.jdt.ls`)
The following settings are supported for the Java language server:
| Setting | Default | Description |
|---|---|---|
| `maven_user_settings` | `~/.m2/settings.xml` | Path to Maven `settings.xml` |
| `gradle_user_home` | `~/.gradle` | Path to Gradle user home directory |
| `gradle_wrapper_enabled` | `false` | Use the project's Gradle wrapper (`gradlew`) instead of the bundled Gradle distribution. Enable this for projects with custom plugins or repositories. |
| `gradle_java_home` | `null` | Path to the JDK used by Gradle. When unset, Gradle uses the bundled JRE. |
| `use_system_java_home` | `false` | Use the system's `JAVA_HOME` environment variable for JDTLS itself. Enable this if your project requires a specific JDK vendor or version for Gradle's JDK checks. |
Example for a project with custom Gradle plugins and JDK requirements:
```yaml
ls_specific_settings:
java:
gradle_wrapper_enabled: true
use_system_java_home: true
```
#### Kotlin
Serena uses [JetBrains' Kotlin Language Server](https://github.com/Kotlin/kotlin-lsp) for Kotlin support.