LunarVim / starter.lvim

🚀 A great starting point for your LunarVim journey!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[python-ide]pyright fails to attach

meicale opened this issue · comments

commented

pyright and other lsp server such as lua can not attach to buffer. Just the black and flack8 can work though null-ls.

Yes... With the file at https://raw.githubusercontent.com/LunarVim/starter.lvim/python-ide/config.lua however if you comment out the formatters and linters block, that is, if you comment out:

-- -- setup formatting
-- local formatters = require "lvim.lsp.null-ls.formatters"
-- formatters.setup { { name = "black" }, }
-- lvim.format_on_save.enabled = true
-- lvim.format_on_save.pattern = { "*.py" }

-- -- setup linting
-- local linters = require "lvim.lsp.null-ls.linters"
-- linters.setup { { command = "flake8", filetypes = { "python" } } }

Then it works, but I have to blast away the entire installation in order to see it working, otherwise pyright will not be working no matter what you do.

Reproduction steps:

  1. Dump the config.lua contents in `~/.config/lvim/config.lua
  2. Remove your LuaVim installation with bash ~/.local/share/lunarvim/lvim/utils/installer/uninstall.sh
  3. Optional: to make sure I delete everything I also delete rm -rf ~/.local/share/lvim or even rm -rf ~/.local.
  4. Then install lunar vim again LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh)
  5. Start Lunar Vim lvim
  6. Open a Python file :e ~/path/to/python/file.py

Then pyright shows after it automatically installs the python langaguage as this line instructs: lvim.builtin.treesitter.ensure_installed = { "python" }.

@ChristianChiarulli it's super strange, do you have any idea?

Doing a :LvimCacheReset, closing lvim and then starting lvim and opening a python file has fixed it... And now pyright is used alongside blacks and flake8...