neovim / nvim-lspconfig

Quickstart configs for Nvim LSP
Apache License 2.0
10.46k stars 2.06k forks source link

LspInstallInfo always return empty eventhough I've installed some LSP #452

Closed sheldonldev closed 3 years ago

sheldonldev commented 3 years ago

health#defx#check

defx.nvim

health#lspconfig#check

Checking language server protocol configuration

health#completion_nvim#check

general

completion source

snippet source

health#deoplete#check

deoplete.nvim

health#nvim#check

Configuration

Performance

Remote Plugins

terminal

health#provider#check

Clipboard (optional)

Python 2 provider (optional)

Python 3 provider (optional)

Python virtualenv

Ruby provider (optional)

Node.js provider (optional)

Perl provider (optional)

How to reproduce the problem from neovim startup

run :LspInstall cssls or yarn global add cssls call :LspInstallInfo It shows: { cssls = { bin_dir = "/Users/sheldonl/.cache/nvim/lspconfig/cssls/node_modules/.bin", binaries = { ["css-languageserver"] = "/Users/sheldonl/.cache/nvim/lspconfig/cssls/node_modules/.bin/css-languageserver" }, install_dir = "/Users/sheldonl/.cache/nvim/lspconfig/cssls", is_installed = true } }

Actual behaviour

But, when I leave and restart nvim, run :LspInstallInfo, it returns {}, And, no lint, no completion is available

Expected behaviour

When I leave and restart nvim, run :LspInstallInfo, it should returns { cssls = { bin_dir = "/Users/sheldonl/.cache/nvim/lspconfig/cssls/node_modules/.bin", binaries = { ["css-languageserver"] = "/Users/sheldonl/.cache/nvim/lspconfig/cssls/node_modules/.bin/css-languageserver" }, install_dir = "/Users/sheldonl/.cache/nvim/lspconfig/cssls", is_installed = true } } either. And , lint and completion should available

jerrywang1981 commented 3 years ago

it looked like cssls was not installed. if installed, when checkhealth it would be shown in health#lspconfig#check section did you verify it in ~/.cache/nvim/lspconfig/cssls ?

sheldonldev commented 3 years ago

yes, I'm sure

 ~/.cache/nvim/lspconfig/cssls  ls -l total 8 drwxr-xr-x 13 sheldonl staff 416 Dec 11 16:37 node_modules -rw-r--r-- 1 sheldonl staff 219 Dec 11 16:37 package.json

sheldonldev commented 3 years ago

and run :LspInstallInfo {}

jerrywang1981 commented 3 years ago

https://github.com/neovim/nvim-lspconfig#cssls

did you set it up?

require'lspconfig'.cssls.setup{}
Julpikar commented 3 years ago

I don't know if this problem is the same as yours. I upgraded nodejs version 14 to 15 on windows and get {} message. I rolling back to nodejs 14 and its working fine.

sheldonldev commented 3 years ago

yes, I think I'v set everything like the documentation.

Well, maybe it's the node version, because I use version 15 right now. I will try to roll back later. Thank you @benawas

mjlbach commented 3 years ago

@sheldonldev Did you try rolling back node? Is this still an issue?

sheldonldev commented 3 years ago

@mjlbach not yet, I'll try it this Sunday or Monday

sheldonldev commented 3 years ago

This time I uninstall my node 15.4, it seems no problem.

run checkhealth:

health#lspconfig#check
========================================================================
## Checking language server protocol configuration
  - INFO: tsserver: configuration checked.
  - INFO: cssls: configuration checked.

health#completion_nvim#check
========================================================================
## general
  - OK: neovim version is supported

## completion source
  - OK: all completion source are valid

## snippet source
  - INFO: You haven't setup any snippet source.
## Node.js provider (optional)
  - WARNING: `node` and `npm` (or `yarn`) must be in $PATH.
    - ADVICE:
      - Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.

run LspInstallInfo:

{
  cssls = {
    bin_dir = "/Users/sheldonl/.cache/nvim/lspconfig/cssls/node_modules/.bin",
    binaries = {
      ["css-languageserver"] = "/Users/sheldonl/.cache/nvim/lspconfig/cssls/node_modules/.bin/css-languageserver"
    },
    install_dir = "/Users/sheldonl/.cache/nvim/lspconfig/cssls",
    is_installed = true
  },
  tsserver = {
    bin_dir = "/Users/sheldonl/.cache/nvim/lspconfig/tsserver/node_modules/.bin",
    binaries = {
      ["typescript-language-server"] = "/Users/sheldonl/.cache/nvim/lspconfig/tsserver/node_modules/.bin/typescript-language-server"
    },
    install_dir = "/Users/sheldonl/.cache/nvim/lspconfig/tsserver",
    is_installed = true
  }
}
mjlbach commented 3 years ago

It seems like a lot of language servers are affected negatively by node 15. Is your issue resolved by reverting back then, and can we close?

sheldonldev commented 3 years ago

I'm now using node 14 with nvm. It seems OK now. Sure we can close it. Thank you.

mjlbach commented 3 years ago

Thank you! If you can isolate the issue to something in particular one of the configuration scripts is doing, file another issue. Otherwise if this is an upstream issue it should be reported to the respective language server.

sheldonldev commented 3 years ago

Alright. Thank you!