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

Update is not working, scrapping coc-lua-data is necessary #65

Closed
oblitum opened this issue Jun 17, 2021 · 1 comment
Closed

Update is not working, scrapping coc-lua-data is necessary #65

oblitum opened this issue Jun 17, 2021 · 1 comment

Comments

@oblitum
Copy link

oblitum commented Jun 17, 2021

The plugin is automatically offering updating the language server, but it's actually not updating it. It's easy to replicate, cd to ~/.config/coc/extensions/coc-lua-data and rm -rf sumneko-lua-ls, download and extract an old release (e.g. 1.21.1) from https://github.com/josa42/coc-lua-binaries/releases into sumneko-lua-ls, change the timestamp in ~/.config/coc/extensions/coc-lua-data/db.json to a random very old value. Start nvim foo.lua, an update offer for 1.21.2 will happen. Execute :CocCommand lua.update. It will show download progress (but never finishing, though it does restart analyses after a while). Close and start nvim foo.lua again, no update offer anymore, but server in ~/.config/coc/extensions/coc-lua-data/sumneko-lua-ls/version.json is still on 1.21.1 (it would be nicer to have a command to show the server version, as output for :CocCommand lua.version only display the version for coc-lua).

Besides this, the update warnings seem to be happening more often than necessary. An update offer is triggered on every change to coc-lua-binaries repository, due to the server in coc-lua-data never being updated, but I suppose that this should have been happening on every coc-lua-binaries new release only (excluding the pre-releases), not on every repo change.

FWIW, coc-rust-analyzer is one plugin that implements server updates quite nicely, and could be used as reference. Instead of asking the user to execute a command, it displays a prompt. It also downloads versions correctly.

Context: LuaLS/lua-language-server#496 (comment)

@oblitum oblitum changed the title Update is not working, scrappng coc-lua-data is necessary Update is not working, scrapping coc-lua-data is necessary Jun 17, 2021
@oblitum
Copy link
Author

oblitum commented Jun 21, 2021

FWIW, coc-rust-analyzer is one plugin that implements server updates quite nicely, and could be used as reference. Instead of asking the user to execute a command, it displays a prompt. It also downloads versions correctly.

I noticed that coc-lua offers "ask" option for checkForUpdates. So please ignore that last suggestion.

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

No branches or pull requests

2 participants