mason lsp pyright seems to be download but dosen't work on vim

970 Views Asked by At

I have a problem on my nvim LSP. according to mason plugin the pyright is downloaded and I on other IDE the lsp works great. when i open python file with neovim it didn't recognized import and basic functions. someone can handle this situation? maybe it's because Lspinfo tell me that it didn't get the python root directory?import don't auto complete pythonpyright is downloaded via masonLSPInfo description

on other languages it works so don't really understand the problem

1

There are 1 best solutions below

0
On

Same as me, at the moment I solved like this (it happens in some languages for me too):

local status_ok, mason = pcall(require, "mason")
if not status_ok then
    return
end

local status_masonlsp_ok, mason_lspconfig = pcall(require, "mason-lspconfig")
if not status_masonlsp_ok then
    return
end

local servers = {
    "sumneko_lua",
    "rust_analyzer",
    "tailwindcss",
    "bashls",
    "pyright",
    -- "csharp_ls",
    "html",
    "omnisharp",
    "gopls",
}

mason.setup(settings)
mason_lspconfig.setup({
    ensure_installed = servers,
    automatic_installation = true,
})

So when I open nvim they are installed automatically.