Feature Request/Proposal: Customize `jdtls` Jar Location
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start in lsp-java.el at lsp-java--locate-server-jar and inspect how lsp-java-server-install-dir is used to locate the JAR. Compare the proposed customization approaches against both the lsp-mode layout and the alternative bin/share/java/jdtls layout. Done means JAR detection works for a configurable alternative location and LSP can start.
Written by the indexing model from the issue text.
Description
I've recently had cause to install jdtls myself, rather than using lsp-mode's auto-install faculty. Unfortunately, this can get a little messy. The issue at hand is the function lsp-java--locate-server-jar, and the directory layout of jdtls when it's installed by alternative tools. Specifically, lsp-mode's installation creates a structure like this:
# ~.emacs.d/.cache/lsp/eclipse.jdt.ls/
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 bin drwxr-xr-x@ - rdonaldson 19 Sep 16:03 boot-server drwxr-xr-x@ - rdonaldson 19 Sep 16:03 bundles
drwxr-xr-x@ - rdonaldson 19 Sep 16:15 config_linux
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 config_mac
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 config_ss_linux drwxr-xr-x@ - rdonaldson 19 Sep 16:03 config_ss_mac drwxr-xr-x@ - rdonaldson 19 Sep 16:03 config_ss_win
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 config_win
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 features
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 java-decompiler
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 java-test
drwxr-xr-x@ - rdonaldson 19 Sep 16:03 plugins
Tools I'm using are creating layouts like so:
├── bin
│ ├── jdtls
│ └── jdtls.py
└── share
└── java
└── jdtls
├── config_linux
├── features
└── plugins
While this installation is valid, it breaks JAR detection, so LSP won't start -- even though it can find the "server command".
I can see a couple very reasonable solutions here, and I'm happy to implement whichever solution y'all prefer.
- Right now, jar location searches in
lsp-java-server-install-dir; we could add a newdefcustomforlsp-java-server-jar-locationand check there first if non-nil. - We could add a new
defcustomfor the path prefix of the JAR location within the install dir -- something like(defcustom lsp-java-server-jar-subpath "plugins"). - We could make a new
defcustomfor the JAR location function itself, setting the current function as the default implementation.
Thanks so much for the excellent tools, y'all.
- Dominant language
- Emacs Lisp
- Stars
- 696
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from emacs-lsp/lsp-java
-
dap-java discards module paths from resolveClasspath causing JPMS-modular projects fail to launchOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
All issues in emacs-lsp/lsp-java
Similar issues
-
documentation from-review-extraction github-actions priority: low severity:nit
Difficulty 1/5 Under an hour Newbie friendliness 92/100
LearningCircuit/local-deep-research#6946 ·
Maintainers usually reply within 1 day
-
Help-Wanted Needs-Triage Package-Request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
microsoft/winget-pkgs#442309 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
alunduil/zfs-replicate#730 ·
Maintainers usually reply within 1 day
-
infrastructure
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
alunduil/siren-json.hs#232 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
alunduil/alunduil-infrastructure#629 ·
Maintainers usually reply within 1 day