williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

html,jsonls and cssls all download the same thing multiple times #367

Open ghost opened 2 years ago

ghost commented 2 years ago

Describe the bug i just took a look at installed language servers directory and noticed vscode-eslint, jsonls, cssls and html are basically the same thing i'm guessing it's using hrsh7th/vscode-langservers-extracted? so when you install each of these language servers it just downloads the same thing which is 85 MB so it can easily take 400 MB of space by installing just these four

Expected behavior nvim-lsp-installer should only download hrsh7th/vscode-langservers-extracted once and reuse it for different language servers

Screenshots s

System info (please complete the following information):

Checkhealth output (:checkhealth nvim-lsp-installer):


nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - WARNING: **Go**: not available
  - WARNING: **Ruby**: not available
  - WARNING: **RubyGem**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - WARNING: **java**: not available
  - OK: **bash**: `GNU bash, version 5.1.12(1)-release (x86_64-pc-linux-gnu)`
  - OK: **tar**: `tar (GNU tar) 1.34`
  - OK: **gzip**: `gzip 1.11`
  - OK: **curl**: `curl 7.80.0 (x86_64-pc-linux-gnu) libcurl/7.80.0 OpenSSL/1.1.1l zlib/1.2.11 brotli/1.0.9 zstd/1.5.0 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.10.0 nghttp2/1.46.0`
  - OK: **wget**: `GNU Wget 1.21.2 built on linux-gnu.`
  - WARNING: **pip3**: not available
  - OK: **python3**: `Python 3.9.9`
  - OK: **node**: `v17.2.0`
  - OK: **sh**: `Ok`
  - OK: **npm**: `8.1.4`
williamboman commented 2 years ago

Hello! This used to be a thing actually for this reason, although the implementation was a bit clunky. It was removed a while ago because the implementation had a net negative impact. I didn't realise that the npm package shipped so many bytes nowadays, seems like there's a bunch of wasm binaries and whatnot. I wouldn't be opposed to some mechanism that'd allow for deduping dependencies across installed LSP servers, but I can't really imagine an alternative that isn't non-trivial.

I'll have to revisit if there's still a good reason to use vscode-langservers-extracted (I know the eslint server is not distributed elsewhere, and I remember reading about some additional features added in the vscode-langservers-extracted package). I'll also try to see if hrsh7th would be open to distributing the LSPs separately (while keeping vscode-langservers-extracted as a collection package). In the meantime I'd also be open to monkey patching things by manually removing installation artifacts that are redundant for a particular server.

David-Else commented 2 years ago

I'll have to revisit if there's still a good reason to use vscode-langservers-extracted

vscode-langservers-extracted is an amazing package, before it came out only ancient redundant versions of these servers were available, and no eslint, it is very important to support this package fully :)

It would be cool to not have these duplicated, but I appreciate you would have to add a new paradigm to support that.