我正在尝试从vscode切换到neovim。我已经为coc.nvim配置了pyright,但现在neovim为language-server提供了本机支持。因此,我尝试配置python-language-server。我已经用pyls安装了pip install python-language-server。我查看了lsp-quickstart的文档。它说,我只需要添加neovim/nvim-lspconfig到我的插件,然后添加lua require('lspconfig').pyls.setup{}到我的init.vim。在刷新之后,我得到了错误:
E5108: Error executing lua [string ":lua"]:1: attempt to index field 'pyls' (a nil value)我试着搜索它,但没有找到任何相关的答案。如果你配置好了,请帮我一把。
发布于 2021-10-02 09:40:16
嘿,看上去有一种新的小矮人叉。我有同样的问题,下面的工作为我!
见这里:
https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#pylsp
在这里:
https://github.com/python-lsp/python-lsp-server
尝试:
pip install 'python-lsp-server[all]'然后在init.vim中更改:
lua require('lspconfig').pyls.setup{}至
lua require('lspconfig').pylsp.setup{}注: pyls更改为pylsp
https://stackoverflow.com/questions/69405029
复制相似问题