Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple versions of Language Servers files after nodejs update/change. #90

Closed
broiniac opened this issue Aug 26, 2022 · 7 comments · Fixed by #104
Closed

Multiple versions of Language Servers files after nodejs update/change. #90

broiniac opened this issue Aug 26, 2022 · 7 comments · Fixed by #104

Comments

@broiniac
Copy link

Describe the bug
There are many versions of Language Servers stored in Package Storage directory. After some time total size can be larger than expected, since each of them has its own copy of dependencies (node_modules).
Based on directories names I guess that each time I update or change system nodejs version LSP installs fresh copy of Language Server.

In my case:

  • LSP-intelephense have 16 versions, ~105MB each.
  • LSP-typescript have 16 versions, ~65MB each.
  • Total size of all language servers is ~3.5GB

There are no cache/index files counted in the above.

To Reproduce
Steps to reproduce the behavior:

  1. Install LSP
  2. Install some Langague Servers
  3. Use Language Servers for a while
  4. Change system node version
  5. Use Language Servers for a while
  6. Check size and subdirectories of Package Storage

Expected behavior
Old versions of Language Servers should be removed on node update or after some time.
Maybe there should be setting for keeping n latest versions? Use-case might be very limited, so I don't think this is needed.
But keeping latest versions only should be an option.

Screenshots
https://i.imgur.com/yT4dFlR.png

Environment (please complete the following information):

  • OS: Arch Linux (up-to-date)
  • Sublime Text version: 4126
  • LSP version: 1.17.0
  • Language servers used: bash, css, html, intelephense, json, typescript, yaml
@broiniac broiniac changed the title Old versions of LSP Multiple versions of Language Servers files after nodejs update/change. Aug 26, 2022
@rchl rchl transferred this issue from sublimelsp/LSP Aug 26, 2022
@rchl
Copy link
Member

rchl commented Aug 26, 2022

As far as node this is an lsp_utils issue so transferring to correct repo.

@rchl
Copy link
Member

rchl commented Aug 26, 2022

Technically it's easy to implement a cleanup but not sure how it should work from the user's perspective.

I imagine that on starting a particular server we could check whether there exist any unexpected directories in package's storage and offer to delete them by showing a dialog. Not sure I want to just automatically clean those out...

@LDAP
Copy link

LDAP commented Dec 6, 2022

This is also an issue if language servers are updated by the plugin maintainer / dependabot.

For example, in my Package Storage there are 18 versions of pyright, 13 of bash, 6 of CSS, 4 of dockerfile, 12 of eslint, 10 of html, 22 of json, 2 of angular, 7 of typescript and 14 of yaml. This adds up to around 2 GB.

@rchl
Copy link
Member

rchl commented Dec 6, 2022

This is also an issue if language servers are updated by the plugin maintainer / dependabot.

That should not be the case. The directory structure is like .../Package Storage/LSP-pyright/16.15.0/language-server so new versions of server just overwrite the old one.

@LDAP
Copy link

LDAP commented Dec 6, 2022

With "update" I mean changing the version number. My Package Storage looks like this:

~/.cac/sublime-text/Package Storage  ls */                                            ✔ 
AutoSetSyntax/:
guesslang-server

LSP-angular/:
18.3.0  18.6.0

LSP-bash/:
17.2.0  17.6.0  17.9.0  18.3.0  18.9.0  19.0.0  19.1.0
17.3.0  17.8.0  18.2.0  18.8.0  18.9.1  19.0.1

LSP-clangd/:
clangd_15.0.1

LSP-css/:
17.4.0  17.5.0  17.6.0  17.8.0  17.9.0  18.3.0

LSP-dockerfile/:
17.3.0  17.9.0  18.2.0  19.1.0

LSP-eslint/:
17.4.0  17.6.0  17.9.0   18.3.0  18.7.0  19.0.1
17.5.0  17.8.0  18.10.0  18.6.0  18.8.0  19.1.0

LSP-file-watcher-chokidar/:
chokidar

LSP-gopls/:
bin  go-build  pkg  VERSION

LSP-html/:
17.3.0  17.4.0  17.5.0  17.6.0  17.8.0  17.9.0  18.7.0  18.8.0  19.0.1  19.1.0

LSP-jdtls/:
data  server

LSP-json/:
17.3.0  17.5.0  17.7.2  17.9.0  18.10.0  18.2.0  18.5.0  18.7.0  18.9.0  19.0.0  19.1.0
17.4.0  17.6.0  17.8.0  18.1.0  18.11.0  18.3.0  18.6.0  18.8.0  18.9.1  19.0.1  19.2.0

LSP-ltex-ls/:
ltex-ls-15.2.0

LSP-lua/:
bin           debugger.lua  locale  lua-lang-download  meta    VERSION
changelog.md  LICENSE       log     main.lua           script

LSP-marksman/:
bin  VERSION

LSP-pyright/:
17.3.0  17.6.0  17.9.0  18.10.0  18.3.0  18.7.0  18.9.0  19.0.0  19.1.0  resources
17.5.0  17.8.0  18.1.0  18.11.0  18.6.0  18.8.0  18.9.1  19.0.1  19.2.0

LSP-TexLab/:
linux-x64~v4.1.0

LSP-typescript/:
17.6.0  17.9.0  18.10.0  18.3.0  18.6.0  19.0.1  19.1.0

LSP-yaml/:
17.3.0  17.5.0  17.8.0  18.10.0  18.3.0  18.8.0  19.0.1
17.4.0  17.6.0  17.9.0  18.2.0   18.7.0  18.9.1  19.1.0

@rchl
Copy link
Member

rchl commented Dec 6, 2022

Yes, but that's the Node version number, not the server version number. So that number doesn't change when new version of LSP-pyright is released (for example). It changes when new version of Node is installed in your system (or if you are using lsp_utils node instance and that Node instance is updated but that doesn't happen often).

@LDAP
Copy link

LDAP commented Dec 6, 2022

I see! Misinterpreted that version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants