coc-java
coc-java copied to clipboard
can't download jdt.ls in proxy environment
The following is a proxy setting in coc-settings.json.
http.proxy:"userid:password@host:port"
When I first open the .java file, it start to download jdt.ls, but I get the following message and it fails.
[coc.nvim]: UnhandledRejection: Unhandled error. (GotError [RequestError]: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND userid
The userid is the one specified in coc-settings.json.
following is my :CocInfo output.
## versions
vim version: version 8021266
node version: v12.18.2
coc.nvim version: 0.0.78-56999634f4
coc.nvim directory: /home/$username/.vim/plugged/coc.nvim
term: dumb
platform: linux
I had a similar issue (https://github.com/neoclide/coc.nvim/issues/2628).
The problem seems to be that the settings made in coc-settings.json in a correct way (for example the proxy with http:// as prefix) are not handled correctly by coc-java. I think over time the proxy settings have been changed in coc.nvim (for example http:// as prefix) but the code in coc-java assumes the old format.
In my case a correctly set proxy (which worked for installing coc extensions) did not work for downloading the jdtls. After looking at the code I tried using an "incorrect" format for the proxy definition in http.proxy (without http://) and then the download of the jdtls was successfull.
In your case I do not know what you can do, since (with my limited understanding) the code for downloading the jdtls can handle only host and port, but not authentication, see https://github.com/neoclide/coc-java/blob/ffd408df8231564a1ddcd88b5b947787f7687c0e/src/downloader.ts
Should be fixed on recent version of coc-java, try upgrade coc.nvim to latest release and coc-java to version 1.14.0.
No download needed from coc-java 1.14.0