mjlbach / starter.nvim

A small, documented, and featureful neovim starter config
MIT License
79 stars 116 forks source link

Multiple LSP server duplicates on a single file #57

Closed aveaves closed 2 years ago

aveaves commented 2 years ago

Neovim version (nvim -v) NVIM v0.7.0 Build type: Release LuaJIT 2.1.0-beta3 Note: checkhealth all green.

Language server name lua-language-server 2.6.7-1

Operating system/version Operating System: Manjaro Linux
Kernel: Linux 5.15.32-1-MANJARO Architecture: x86-64

Steps to reproduce: No ~/,local/share/nvim and ~/.config/nvim. Fresh NVIM v0.7 installation. Create ~/.config/nvim/init.lua using init.lua from kickstart.nvim Run nvim, ignore errors, close, run nvim again execute :PackerSync Note: Make sure lua-language-server is found in $PATH.

Problem: Multiple lua-language-servers clients are attached to the buffer. At opening the file, only one lua lsp server gets attached, but after a while (< 2 mins), duplicates are spawned. Found no limit to the number of clients spawned; only stops when the computer hangs.

Expected Behavior: Only one lua lsp server is attached to the buffer

Actual Behavior: bug_kickstart bug_kickstart_2

mjlbach commented 2 years ago

Yeah, that's a limitation of lspconfig and single file mode. If you want deduplication make sure you have a project marker (git, luarc), otherwise lspconfig is pretty conservative with sharing language servers.