Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gopls delay in starting #74

Closed
adgai19 opened this issue May 18, 2022 · 6 comments
Closed

gopls delay in starting #74

adgai19 opened this issue May 18, 2022 · 6 comments

Comments

@adgai19
Copy link

adgai19 commented May 18, 2022

gopls server takes about 40 sec to connect to lsp client. The 40 seconds are from the time the gopls container starting to the first message on the logs. I haven't observed any this issue with any other clients and this issue is not present when i run the gopls binary locally. Once the server starts, it behaves normally.

My current build info

NVIM v0.8.0-dev+b9b5577d6
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=malloc -Wsuggest-attribute=cold -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/adgai/github/neovim/build/config -I/home/adgai/github/neovim/src -I/home/adgai/github/neovim/.deps/usr/include -I/usr/include -I/home/adgai/github/neovim/build/src/nvim/auto -I/home/adgai/github/neovim/build/include
Compiled by root@adgai-LEGION-Y540-15IRH

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

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

Run :checkhealth for more info

Minimal vimrc

vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvim/site]])
local package_root = "/tmp/nvim/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
	require("packer").startup({
		{
			"wbthomason/packer.nvim",
			"neovim/nvim-lspconfig",
			"lspcontainers/lspcontainers.nvim",
		},
		config = {
			package_root = package_root,
			compile_path = install_path .. "/plugin/packer_compiled.lua",
			display = { non_interactive = true },
		},
	})
end
_G.load_config = function()
	require("lspconfig").gopls.setup({
		cmd = require("lspcontainers").command("gopls"),
	})
end
if vim.fn.isdirectory(install_path) == 0 then
	print("Installing Telescope and dependencies.")
	vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
require("packer").sync()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]])

lsp logs

@ftassi
Copy link

ftassi commented May 19, 2022

@adgai19 would you care to test my dockerfile ? I tried to fix this issue. check lspcontainers/dockerfiles#71 out
I just implemented it and have not tested extensively yet

@adgai19
Copy link
Author

adgai19 commented May 19, 2022

@adgai19 would you care to test my dockerfile ? I tried to fix this issue. check lspcontainers/dockerfiles#71 out I just implemented it and have not tested extensively yet

This image did fix the startup issue for me.

@erikreinert
Copy link
Contributor

I recently made some changes to the gopls server - would you mind checking and seeing if this is still an issue? Thank you!

@adgai19
Copy link
Author

adgai19 commented Oct 24, 2022

unfortunately I moved to nixos a few weeks back. So I don't exactly have the same testing environment

@erikreinert
Copy link
Contributor

Hahaha no worries - we are actually supporting Nix as a backend in V2 so that totally works. I am also a NixOS user so I understand the troubleshooting challenge. This repository DOES have a flake.nix now you are welcome to debug with if you'd like https://github.com/lspcontainers/lspcontainers.nvim/blob/main/flake.nix

This is also the current PR for Nix integration with lspcontainers: #91

I'll close this for now as I am getting reports of quicker start times. Thank you!

@erikreinert
Copy link
Contributor

To be included in #92

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

No branches or pull requests

3 participants