Open zenoli opened 1 year ago
After 2 tiring days of trying to install, I temporarily fixed it with this method:
Open ~/.local/share/nvim/mason/registries/github/mason-org/mason-registry/registry.json
Find jdtls
and change source.id
, jdtls.tar.gz
:MasonInstall jdtls
{
"name": "jdtls",
"description": "Java language server.",
"homepage": "https://github.com/eclipse/eclipse.jdt.ls",
"licenses": [
"EPL-2.0"
],
"languages": [
"Java"
],
"categories": [
"LSP"
],
"source": {
"id": "pkg:generic/eclipse/eclipse.jdt.ls@v1.27.1",
"download": [
{
"target": [
"darwin_x64",
"darwin_arm64"
],
"files": {
"jdtls.tar.gz": "https://download.eclipse.org/jdtls/milestones/{{ version | strip_prefix \"v\" }}/jdt-language-server-{{ version | strip_prefix \"v\" }}-202309140221.tar.gz",
"lombok.jar": "https://projectlombok.org/downloads/lombok.jar"
},
"config": "config_mac/"
},
{
"target": "linux",
"files": {
"jdtls.tar.gz": "https://download.eclipse.org/jdtls/milestones/{{ version | strip_prefix \"v\" }}/jdt-language-server-{{ version | strip_prefix \"v\" }}-202309140221.tar.gz",
"lombok.jar": "https://projectlombok.org/downloads/lombok.jar"
},
"config": "config_linux/"
},
{
"target": "win",
"files": {
"jdtls.tar.gz": "https://download.eclipse.org/jdtls/milestones/{{ version | strip_prefix \"v\" }}/jdt-language-server-{{ version | strip_prefix \"v\" }}-202309140221.tar.gz",
"lombok.jar": "https://projectlombok.org/downloads/lombok.jar"
},
"config": "config_win/"
}
]
},
That's exactly what I did as well :-) Not the best user experience though^^
There is latest.txt
for every version that contains the file name of the tarball if that helps.
https://download.eclipse.org/jdtls/milestones/1.23.0/latest.txt
launcher is also hard coded so it's about time this is causing issues.
jdtls/plugins/org.eclipse.equinox.launcher.jar: plugins/org.eclipse.equinox.launcher_1.6.500.v20230717-2134.jar
Open
~/.local/share/nvim/mason/registries/github/mason-org/mason-registry/registy.json
There is a typo. Fixed path: ~/.local/share/nvim/mason/registries/github/mason-org/mason-registry/registry.json
.
There is
latest.txt
for every version that contains the file name of the tarball
Yeah, I also wonder why it is not utilized.
When trying to apply these changes, Mason is overwriting the changes to registry.json
. Why is this; is anyone else having this issue?
I think right now the only good solution is to have a custom registry with the packages you want. Even adding local path requires some yaml parser. Even when I tried last week, it did not work. I started doing jdtls package versioning by mason packages just like in NixOS.
Ex:- https://github.com/nvim-java/mason-registry/blob/main/packages/jdtls-1.33.0/package.yaml
If you are willing to add the necessary package version, I'm willing to accept the PR.
Repeating my suggestion from https://github.com/mason-org/mason-registry/issues/3017#issuecomment-2089994950 here:
Following the purl specs I wonder if we could add the required timestamp a qualifier
to the package id
:
id: pkg:generic/eclipse/eclipse.jdt.ls@v1.34.0?timestamp=202404031240
This should make it easy to reference it in the source.file.download
section.
Alternatively we could append it to the version
separated with a dash:
id: pkg:generic/eclipse/eclipse.jdt.ls@v1.34.0-202404031240
Then split it with an expression to create the final download URL.
When trying to apply these changes, Mason is overwriting the changes to
registry.json
. Why is this; is anyone else having this issue?
I had a same issue with you.
I've searched open issues for similar requests
I've recently downloaded the latest plugin version of mason.nvim
Problem description
Installing older versions of jdtls fails because there is a hardcoded timestamp in the url of the mason-schema-registry
I initially posted an issue on the mason-tool-installer repository but I think it makes more sense to post the issue here. https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim/issues/35
As one can see here there would exist a
latest.txt
file containing the full filename with the timestamp. Maybe it would be possible to look up the filename by first fetchinghttps://download.eclipse.org/jdtls/milestones/1.27.1/latest.txt
. That way the url is only depending on the version number and not on the timestamps.The issue was already mentioned in a discussion so I thought I'm not alone with this problem.
Expected behavior
Specifying older versions of jdtls in
:MasonInstall
successfully installs them.Affected packages
jdtls
Mason output
Installation log
Neovim version (>= 0.7)
NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3
Operating system/version
Linux zenbook 5.15.0-84-generic #93-Ubuntu SMP Tue Sep 5 17:16:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Healthcheck
Screenshots