williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

An error reported when nvim starts, seems to try to install the server which not configured. #858

Open zhang-stephen opened 2 years ago

zhang-stephen commented 2 years ago

Problem description

An error is reported as this screenshot: image

And I noticed there is not only one server_name, it could be one of pylsp, tflint, and the other, which is not configured in my configuration.

Neovim version (>= 0.7)

NVIM v0.7.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by p8zhang@l1sw-env

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/host/workdir/local/share/nvim"

Run :checkhealth for more info

Operating system/version

CentOS 7.9

I've recently downloaded the latest plugin version of both nvim-lsp-installer and nvim-lspconfig

Affected language servers

all

Actual behavior

nvim-lsp-installer seems to try to install the server which not configured.

the configuration of nvim-lsp-installer:

use {
    'williamboman/nvim-lsp-installer',
    config = function()
        require('nvim-lsp-installer').setup({
            log_level = vim.log.levels.DEBUG,
            ui = {
                icons = {
                    server_installed = '✓',
                    server_pending = '➜',
                    server_uninstalled = '✗',
                },
            },
        })
    end,
}

configured servers:

Expected behavior

this error shall be not reported.

LspInstallInfo output

command failed due this error. see the screenshot.

Installation log

This file is empty, because the servers I use are installed already.

Healthcheck

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.7.0
  - WARNING: **Go**: not available
  - OK: **cargo**: `cargo 1.61.0 (a028ae4 2022-04-29)`
  - WARNING: **luarocks**: not available
  - WARNING: **Ruby**: not available
  - WARNING: **RubyGem**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **npm**: `8.3.1`
  - OK: **node**: `v17.4.0`
  - OK: **python3**: `Python 3.6.8`
  - OK: **pip3**: `pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)`
  - OK: **javac**: `Ok`
  - OK: **java**: `java version "1.8.0_92"`
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.14 built on linux-gnu.`
  - OK: **curl**: `curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.53.1 zlib/1.2.7 libidn/1.28 libssh2/1.8.0`
  - OK: **gzip**: `gzip 1.5`
  - OK: **tar**: `tar (GNU tar) 1.32`
  - OK: **bash**: `GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)`
  - OK: **sh**: `Ok`
  - OK: **JAVA_HOME**: `java version "1.8.0_92"`
  - OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Mon 11 Jul 2022 07:09:55 AM UTC.
  - WARNING: The following servers have not been enhanced by nvim-lsp-installer:
    - lemminx
    - jsonls
    *Make sure you set up nvim-lsp-installer before you set up these servers.*

Screenshots

error reported when nvim startup image

Installation Info failed. image

zhang-stephen commented 2 years ago

I noticed that there always is one of pylsp and tflint in the error.

There seems to be a looped dependency...

The error occurs here due to this dependency loop in my opinion.

Could you help confirm and fix it?

williamboman commented 2 years ago

Hello! I don't believe there's a cyclical dependency problem here as this require is not done in the module closure. I believe this is happening because lspconfig is not available in Neovim Lua's package.path - do you perhaps lazy-load lspconfig? (when nvim-lsp-installer is setup lspconfig needs to be available)

zhang-stephen commented 2 years ago

in my configuration, the nvim-lspconfig is loaded later than nvim-lsp-installer... I will verify this soon. thanks.