kabouzeid / nvim-lspinstall

Provides the missing :LspInstall for nvim-lspconfig
MIT License
526 stars 67 forks source link

Issue with lspinstall.install_server() #133

Open classPythonAddike opened 2 years ago

classPythonAddike commented 2 years ago

I tried to make it simpler to install servers by adding this bit of code to my config -

local lspinstall = require("lspinstall")

local lsp_servers = { "go", "python", "vue", "svelte", "lua", "vim", "cpp" }
local installed_servers = lspinstall.installed_servers()

function Make_set(list)
    local set = {}

    for _, l in ipairs(list)
    do
        set[l] = true
    end

    return set
end

installed_servers = Make_set(installed_servers)

for _, server in ipairs(lsp_servers)
do
    if not installed_servers[server] then
        print("Installing LSP Server for " .. server)
        lspinstall.install_server(server)
    end
end

However, when I open Neovim, but results in a strange error (Even though it installs the lsp server) - image

And all the terminal output is messed up after that. I can't find any issues in my code. Is there a bug I am missing?

classPythonAddike commented 2 years ago

My full config is over here btw - classPythonAddike/NVim-Configuration (If it helps with debugging) :smile:

kabouzeid commented 2 years ago

Hmm not sure why this is happening. Could you try to wrap this whole code into a function and then manually call it after starting neovim? Does this still happen in this case?

classPythonAddike commented 2 years ago

I tried that, and on running :lua InstallServers() I got some interesting results -

local lsp_servers = { "go", "python", "vue", "svelte", "lua", "vim" }
local installed_servers = lspinstall.installed_servers()

function Make_set(list)
    local set = {}

    for _, l in ipairs(list)
    do
        set[l] = true
    end

    return set
end

function InstallServers()
    installed_servers = Make_set(installed_servers)

    for _, server in ipairs(lsp_servers)
    do
        if not installed_servers[server] then
            print("Installing LSP Server for " .. server)
            lspinstall.install_server(server)
        end
    end
end

When cpp is in the array of lsp_servers the installation fails. But when I remove cpp from the list, all the servers which aren't installed (vim, lua) are installed properly. I tried installing the C++ language server manually to see if there was a bug in the installation, and :LspInstall cpp works perfectly fine. So I'm not sure why it fails only when cpp is in the list.

n3wborn commented 2 years ago

Same here. I've just reinstall nvim recently and I can't install without facing this issue about ui_compositor.c :556 ui_comp_raw_line attrs[i] >= 0 . I see compositor and think about last neovim floating window commits. Could this be related to this ? I see that window opened at LspInstall have a different look compared to the last time I used it

kabouzeid commented 2 years ago

I'm not sure, I can't reproduce this, neither with 0.5.0 nor with latest 0.6.0 :/

n3wborn commented 2 years ago

I also tested using stable (I always use nightly) but same problem :/ I'll try bissecting commits to see where the bug disappear. I'm used to install servers using LspInstall so everything was ok at some time, maybe I'll find something interesting.

n3wborn commented 2 years ago

Not sure why, but I re-installed nvim from source and everything seems back to normal (NVIM v0.6.0-dev+132-g7d2233fad)

kabouzeid commented 2 years ago

Were you also building from source before?

n3wborn commented 2 years ago

Were you also building from source before?

Nope, I was using nightly AppImage, first time I build it