Nvim-lspconfig: LspInstall not working Windows

Created on 21 Sep 2020  路  3Comments  路  Source: neovim/nvim-lspconfig

  • nvim --version: NVIM v0.5.0-705-g9f704c88a
  • nvim-lsp version(commit hash):
    How can I see that? nvim-lspconfig has the commit 60133c47e0fd82556d7ca092546ebfa8d047466e
  • :checkhealth result:
    configuration ok, performance ok, remote plugins ok, clipboard ok, python2 and 3 ok, virtualenv ok, node.js ok, perl and ruby provider missing
  • What language server(If the problem is related to a specific language server): All of them (vimls as an example)
  • Operating system/version: Windows 10 Pro (Version 2004)
  • Terminal name/version: PowerShell core (7.1.0-preview.7)
  • $TERM: xterm-256color

How to reproduce the problem from neovim startup

:LspInstall vimls

Actual behaviour

Message: "Installation requires "sh", "npm", "mkdir"

Expected behaviour

Installation of the language server

bug

Most helpful comment

I think the idea is to completely drop the installers. See https://github.com/neovim/nvim-lspconfig/issues/334.

All 3 comments

I guess the first think to do is look here: https://github.com/neovim/nvim-lspconfig/blob/60133c47e0fd82556d7ca092546ebfa8d047466e/lua/nvim_lsp/util.lua#L378

It seems like the only system implemented are the ones that have sh, npm and mkdir. I think that this
https://github.com/neovim/nvim-lspconfig/blob/60133c47e0fd82556d7ca092546ebfa8d047466e/lua/nvim_lsp/util.lua#L390
can be easily changed to something that uses Windows Powershell:

local cmd = io.popen("powershell -command -", "w")

local install_script = ([[
    mkdir -p "{{install_dir}}"
    cd "{{install_dir}}"
    && npm init -y
    npm install {{packages}} --no-package-lock --no-save --production
    {{post_install_script}}
    ]]):gsub("{{(%S+)}}", install_params)

cmd:write(install_script)
cmd:close()

I had the same problem, but I went for the manual installation. If some maintainer approves I can try to implement this.

I think the idea is to completely drop the installers. See https://github.com/neovim/nvim-lspconfig/issues/334.

I was just reading that issue jaja

Was this page helpful?
0 / 5 - 0 ratings

Related issues

agriffis picture agriffis  路  5Comments

Kyle-Thompson picture Kyle-Thompson  路  7Comments

dlukes picture dlukes  路  4Comments

ahmedelgabri picture ahmedelgabri  路  4Comments

mcepl picture mcepl  路  8Comments