Comments (9)
Given the current situation, we can have two differents commands:
:LspUpdate
: check the commit/release version from compatible versioning manager (git, npm..), update if needed:LspForceUpdate
: just reinstall everything (server without compatible version manager only ?)
Server compatible with :LspUpdate
should be mark in the readme
Seems dope enough for me :)
from nvim-lspinstall.
You can already do something like this, but it has a few UI problems.
function _G.lsp_reinstall_all()
local lspinstall = require'lspinstall'
for _, server in ipairs(lspinstall.installed_servers()) do
lspinstall.install_server(server)
end
end
vim.cmd 'command! -nargs=0 LspReinstallAll call v:lua.lsp_reinstall_all()'
from nvim-lspinstall.
I agree that this would be nice. Currently this is not possible because we don't have a simple way to check if a language server is already up to date. Any ideas how this could be done?
An easy way would be to provide a command :LspReinstallAll
(or :LspUpdateAll
, or :LspUpdate
) to just reinstall all installed language servers?
from nvim-lspinstall.
I for now built me a simple bash script to update npm-based language servers:
#!/usr/bin/env bash
set -euo pipefail
if [ -e /usr/local/opt/findutils/libexec/gnubin/find ]; then
export PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH"
fi
NODE_LSPS="$(find . -maxdepth 2 -type d -name 'node_modules' -printf '%h\n' | sort -u)"
for i in $NODE_LSPS; do
(
cd $i
echo "Upgrading $(basename $(pwd))…"
if [ -e yarn.lock ]; then
OUTDATED_PACKAGES="$(yarn outdated -s)"
if [ ! -z "$OUTDATED_PACKAGES" ]; then
yarn upgrade --latest
fi
else
OUTDATED_PACKAGES="$(npm outdated)"
if [ ! -z "$OUTDATED_PACKAGES" ]; then
npx --package=npm-check-updates -- ncu -u
npm install
fi
fi
)
done
I dislike it very much to use npm-check-updates, but npm doesn't really have anything like yarn upgrade --latest
as far as I know. Since at least yaml already uses yarn it may make sense to use yarn for everything to make updating easier.
Currently the only language servers that are not npm-based that I use are html and such that are ripped out of Visual Studio Code. Checking for updates there isn't as easy, but I think it may be possible to load this via the GitHub releases of VS Code instead of the official download URL which would allow version checks (as long as the install scripts dumps the version at install somewhere). Although a new VS Code version doesn't necessarily mean that the LSP was updated, but as long as the VS Code team doesn't publish those via npm I don't see a better way to handle this.
from nvim-lspinstall.
I'm guessing you'd need a separate operation for getting the commit or release version of a specific server. I don't think this would be hard with servers downloaded from github or npm, but I'm not sure about other sources. Reinstalling all of the servers could be a minor inconvenience for a when there's a large number of installed servers, but your script worked well enough for something I may run once a week or so.
from nvim-lspinstall.
so this is why coc uses yarn to manage all of these dependencies.
makes sense now :p
can you elaborate on what the UI problem for this is and why is it difficult to implement a simple re-install for all of them?
from nvim-lspinstall.
Also every coc extensions has a maintainer who releases updates. lspinstall directly installs the servers.
from nvim-lspinstall.
UI problem is that when you have eg 10 servers installed, reinstalling will open 10 terminal buffers at once which becomes confusing.
from nvim-lspinstall.
from nvim-lspinstall.
Related Issues (20)
- No html/CSS diagnostics HOT 1
- code_action does not work for Java without nvim-jdtls HOT 3
- haskell does not work (`cmd_cwd` changes and hls can't find hie.yaml)
- JSON language server will not run under Node 12.x because... HOT 1
- Add prisma lsp HOT 2
- Support for yarn HOT 1
- Supporting yarn HOT 12
- install lua failed on arch linux HOT 1
- Can't install Python LSP using LspInstall, in WSL2 HOT 2
- LspInstall - cannot find npm command HOT 2
- Custom install path HOT 2
- Error message when saving C header files. HOT 3
- Add LspInstall for lemminx (XML,XSD,SVG) HOT 3
- Install a list of language servers at startup HOT 3
- Options for java
- "cmd not defined" after installing Java HOT 1
- nvim-lspinstall config for html makes svelte files show duplicate entries for completion
- Angularls doesn't works at all
- MacOS - CSS - Client quit with exit code 1 and signal 0
- Does ESLint Language Server will be added to LSPInstall?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-lspinstall.