Improve automatic JDT LS installation
Closed this issue · 0 comments
Problem
Default value of
eglot-java-eclipse-jdt-ls-download-url
is a snapshot download. If you are unlucky to install it a time when the latest snapshot is buggy, good luck understanding what's wrong when you are not familiar with eglot.
Potential solution
Switching from release snapshots to release milestones could mitigate this issue.
Sadly, it seems that there's no official Eclipse website API endpoint to retrieve available jdtls
releases. (i.e., in comparison to let's say fetching GitHub releases for a given project).
Approach
One option is to leverage the Homebrew jdtls formula REST endpoint to retrieve the latest "known" stable version.
The property paths of interest are .urls.stable.url
and .versions.stable
, per JSON response exceprt below.
Toggle JSON response exceprt
{
"name": "jdtls",
...
"versions": {
"stable": "1.30.0",
"head": null,
"bottle": true
},
"urls": {
"stable": {
"url": "https://www.eclipse.org/downloads/download.php?file=/jdtls/milestones/1.30.0/jdt-language-server-1.30.0-202311301503.tar.gz",
"tag": null,
"revision": null,
"using": null,
"checksum": "579809f27df5f4e53566217f7273fa25cd45a22d3870c0aafd4f84cdd4c97acd"
}
},
...
}
Other considerations
We probably need to record the installed jdtls
version ( in some form of metadata file??).
Caveats
- The
jdtls
version recorded in the Homebrew formula might not be the latest available release milestone. - A relase milestone is usually more stable than a release snaphsot, but the milestone could be buggy as well...