Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-ide]pyright fails to attach #58

Open
meicale opened this issue Dec 18, 2022 · 2 comments
Open

[python-ide]pyright fails to attach #58

meicale opened this issue Dec 18, 2022 · 2 comments

Comments

@meicale
Copy link

meicale commented Dec 18, 2022

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

@eulersson
Copy link

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?

@eulersson
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants