nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.
MIT License
15.66k stars 828 forks source link

Using lsp_dynamic_workspace_symbols with both `pyright` and `jedi-language-server` installed gives plenary errors on every keystroke: "Oneshot channel can only send once" #3242

Closed j-krl closed 1 month ago

j-krl commented 2 months ago

Description

I'm not totally sure if this is an LSP or Telescope issue, but when I run both pyright and jedi-language-server simultaneously, searching for symbols with lsp_dynamic_workspace_symbols is bugged. Running pyright on its own works fine, so it seems that the issue comes from running multiple Python LSPs at the same time. The symbols for only the top level directory show, and there is an error that shows on every keypress in the prompt (attached below).

Very similar to this comment in #964, in but I believe it's a separate issue than where it was commented.

I'm pretty new to nvim, so I don't know if there's some fundamental problem with having multiple LSPs installed for the same language. However I don't have this issue for typescript where I'm using multiple LSPs.

Neovim version

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1720049189

Operating system and version

macOS 14.5

Telescope version / branch / rev

telescope 0.1.8

checkhealth telescope

telescope: require("telescope.health").check()
  Checking for required plugins
  - OK plenary installed.
  - OK nvim-treesitter installed.

  Checking external dependencies
  - OK rg: found ripgrep 14.1.0
  - OK fd: found fd 10.1.0

Steps to reproduce

  1. Install both pyright and jedi-language-server (I use Mason and lsp-zero with lazy.nvim as package manager)
  2. Open a file in a Python project and open the LSP Dynamic Symbols picker with lsp_dynamic_workspace_symbols

Expected behavior

Should be able to fuzzy search for symbols in the workspace(s) based on installed LSPs

Actual behavior

stack traceback: [C]: in function 'assert' ...are/nvim/lazy/plenary.nvim/lua/plenary/async/control.lua:122: in function 'handler' .../neovim/0.10.1/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function '' vim/_editor.lua: in function <vim/_editor.lua:0>


<img width="1076" alt="Screenshot 2024-08-08 at 12 32 06 PM" src="https://github.com/user-attachments/assets/9ea65033-4c98-41c6-beb4-96ee05774a52">

### Minimal config

```Lua
No irregular configs besides installing the LSPs/Telescope. Can provide more info if necessary.
j-krl commented 2 months ago

UPDATE: The max number of symbols showing is a jedi config option that I fixed with the below setup for jedi. It's set to only show 20 symbols by default. The real issue here is the plenary error messages.

init_options = {
  workspace = {
    symbols = {
      maxSymbols = 0,
    },
  },
}

It also looks like this is specific to use jedi at the same time as another LSP. Using with pyright and pylsp at the same time doesn't yield the same errors.

jamestrew commented 1 month ago

Thanks for creating a separate issue, helps with the visibility and tracking.

It looks like it's because both pyright and jedi support the workspaceSymbolProvider server capability needed for fetching workspace symbols. pylsp does not support, thus the lack of conflict between pyright and pylsp.

Using multiple language server for the same language that offer same/similar features isn't usually a common thing to do I think but this error you're getting can definitely be considered a bug.

I'll try to find a fix.

j-krl commented 1 month ago

Using multiple language server for the same language that offer same/similar features isn't usually a common thing to do I think but this error you're getting can definitely be considered a bug.

Yeah the only reason is because the autocomplete with Jedi and Pylsp is so much better than Pyright. I switched to Pylsp for now but still probably worth looking at the underlying bug.

Sounds great! Thanks