Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Issue with lspinstall.install_server() #133

Open
classPythonAddike opened this issue Aug 1, 2021 · 9 comments
Open

Issue with lspinstall.install_server() #133

classPythonAddike opened this issue Aug 1, 2021 · 9 comments

Comments

@classPythonAddike
Copy link

classPythonAddike commented Aug 1, 2021

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

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

@kabouzeid
Copy link
Owner

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

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

n3wborn commented Aug 11, 2021

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

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

@n3wborn
Copy link

n3wborn commented Aug 11, 2021

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

n3wborn commented Aug 11, 2021

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

@kabouzeid
Copy link
Owner

Were you also building from source before?

@n3wborn
Copy link

n3wborn commented Aug 12, 2021

Were you also building from source before?

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

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

No branches or pull requests

3 participants