0

if I immediately open the file via nvim, then everything works, but if I first open, for example, the config, and after the python file, then pyright does not work

vim.cmd [[packadd packer.nvim]]
return require('packer').startup(function()
    use 'wbthomason/packer.nvim'
    use 'neovim/nvim-lspconfig'
    use 'williamboman/nvim-lsp-installer'
    use {
        'williamboman/mason.nvim',
        ensure_installed = {
            'pyright',
        },
    }
    use {'neoclide/coc.nvim', branch = 'release'}
    -- another plugins
end)

I still don't really understand what exactly is wrong here. in coc.nvim itself or in lspconfig

Pravoslav
  • 1
  • 1

1 Answers1

0

The pyright plugin isn't properly configured with the Mason package installer I assume you might have already tried MasonInstall pyright but still no luck!

Now, follow these steps

  • Uninstall any autopairs plugin
  • Uninstall friendly-snippets if you have it installed already
  • Uninstall "pyright" from Mason using MasonUninstall pyright and remove it from "ensure_installed" table
  • Now that everything is clean, use CocInstall coc-pyright coc-pairs
  • Now you should have "pyright" running correctly

Incase, you want to use end to end properly configured neovim setup with modern looking IDE, you can clone my config here

MiKee
  • 36
  • 3