Closed winkee01 closed 2 years ago
Without below config, lsp can detect my pyright correctly.
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
local lspconfig = require('lspconfig')
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
local servers = { 'clangd', 'rust_analyzer', 'pyright', 'tsserver' }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
-- on_attach = my_custom_on_attach,
capabilities = capabilities,
}
end
Can someone explain why?
ok, I get it, on_attach
is not enabled 😂. Sorry.
can you tell me how to resolve this problem, thanks? I met the same problem
@sukai-cheng Can you provide a copy of your init.lua
? I experienced the same issue after updating nvim-lspconfig
and nvim-lsp-installer
. Might be a version mismatch? Not entirely sure ATM.
I have the same issue when using nvim-lsp-installer and pyright. I'd mistakenly installed the wrong Python LSP from nvim-lsp-installer I think.
Worst case scenario,
sudo npm install -g pyright
should work
Can i configure multiple python servers in one lspconfig.lua file?. I just configure my nvim setup and i put 4 python servers and when opening a python file all failed except: jedi_language_server. Did i do something wrong?
I have the same issue when using nvim-lsp-installer and pyright. I'd mistakenly installed the wrong Python LSP from nvim-lsp-installer I think.
Worst case scenario,
sudo npm install -g pyright
should work
Works for me, TKS!
For me, npm wasn't installed...
So I just did sudo apt-get install npm
and it works now...
sudo npm install -g pyright
This worked too Thanks
Neovim version (nvim -v)
NVIM v0.7.0-dev+719-gbdfea9d9a
Language server name/version
pyright
Operating system/version
macOS Monterey 12.1
Steps to reproduce using "nvim -u minimal_init.lua"
I installed
nvim-lspconfig
,nvim-lsp-installer
andcmp-nvim-lsp
plugins, also I installed pyright via:LspInstall pyright
,config file for nvim-lspconfig
nvim-lsp-installer
the only difference that made the mentioned error is that I added below config for
nvim-cmp
To reproduce with minimal setup.
Expected behavior
No error should display.
Actuall, If I delete the casuing-error config, pyright can be detected correct and function correctly.
Actual behavior
When I open a python file like this:
nvim test.py
, I get this error:Log file
No response