Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

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

Open
1 task done
zhang-stephen opened this issue Jul 11, 2022 · 3 comments

Comments

@zhang-stephen
Copy link

zhang-stephen commented Jul 11, 2022

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

  • Yes

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:

  • ccls, installed by package manager
  • sumneko_lua
  • pyright
  • taplo
  • cmake

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
Copy link
Author

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

There seems to be a looped dependency...

  • the nvim-lsp-installer.servers is required by nvim-lsp-installer.middleware,
  • the nvim-lsp-installer.middleware is required by nvim-lsp-installer.servers.pylsp and nvim-lsp-installer.servers.tflint.

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

Could you help confirm and fix it?

@williamboman
Copy link
Owner

williamboman commented Jul 12, 2022

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants