Giter VIP home page Giter VIP logo

Comments (10)

jczhang02 avatar jczhang02 commented on July 2, 2024

image
在正确加载包的前提下有这样奇怪的报错,但是理应不会报错

from nvimdots.

ayamir avatar ayamir commented on July 2, 2024

试试这样设置:https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#pyright

from nvimdots.

ayamir avatar ayamir commented on July 2, 2024

https://www.reddit.com/r/neovim/comments/n5gcsx/pyright_luaconfig_not_getting_my_pyenv_environment/

from nvimdots.

jczhang02 avatar jczhang02 commented on July 2, 2024

请问如果设置的话,还是在这个lspconfig.lua文件里设置吗,具体应该是怎么设置?
对不起,问题有些小白,但我确实是刚接触lua,还不是很明白!

from nvimdots.

ayamir avatar ayamir commented on July 2, 2024

我想你应该是需要在项目的根目录下面手动创建一个pyrightconfig.json文件,里面填写好venvpath

{
  "venv": "path",
}

from nvimdots.

jczhang02 avatar jczhang02 commented on July 2, 2024

我是想问下图中的部分应该被加到哪里,以及怎么加,谢谢!
image

from nvimdots.

ayamir avatar ayamir commented on July 2, 2024

lspconfig.lua:

local function setup_servers()
    lsp_install.setup()
    local servers = lsp_install.installed_servers()
    for _, lsp in ipairs(servers) do
        nvim_lsp[lsp].setup {
            capabilities = capabilities,
            on_attach = function()
                require('lsp_signature').on_attach({
                    bind = true,
                    use_lspsaga = false,
                    floating_window = true,
                    fix_pos = true,
                    hint_enable = true,
                    hi_parameter = "Search",
                    handler_opts = {"double"}
                })
            end,
            settings = {
                python = {
                    analysis = {
                        autoSearchPaths = true,
                        useLibraryCodeForTypes = false
                    }
                }
            }
        }
    end
end

from nvimdots.

jczhang02 avatar jczhang02 commented on July 2, 2024

require'lspconfig'.pyright.setup{}
这一部分不需要加入吗?
另外如果我想使用pylsp的话,应该怎么加入呢
谢谢!

from nvimdots.

ayamir avatar ayamir commented on July 2, 2024

pip install python-lsp-server --user
add nvim_lsp.pylsp.setup{} to lspconfig.
image

from nvimdots.

jczhang02 avatar jczhang02 commented on July 2, 2024

谢谢您的回答!

from nvimdots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.