ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
1.97k stars 53 forks source link

Trying to get signature on empty line, breaks jedi-lsp server #298

Open alexveden opened 7 months ago

alexveden commented 7 months ago

I'm experiencing weird behavior of the jedi lsp server after OS upgrade. This message shows up in Neovim when I move cursor at empty line of a python file.

The behaviour is weird because I have another almost identical machine, with the same version of the jedi lsp installed via Mason. So that other machine worked fine, until I upgraded AstronVim to version 3.39 (was 3.37). However, downgading back doesn't help, so I stuck with this issue on both machines.

I've tried different Python versions (3.9, 3.10, 3.11), also nvim versions 0.9.2 / 0.9.4, also different jedi-lsp servers 0.39, 0.40, 0.41.2. In all of these the issue remains the same.

Eventually, I nailed down the issue, it was treggeded by lsp_signature plugin, supposedly it tries to get signature of empty line. I know the error message makes no sense, but the only moving part which disables it is disabling load of lsp_signature plugin.

How to reproduce

  1. Install jedi-language-server via Mason
  2. Create simple python file

import warnings

3. Place cursor on empty line between imports
4. (get full error in :messages output)

-----------------------------
Technical stuff

lsp_signatur handler RPC[Error] code_name = InternalError, message = "ValueError: column parameter (1) is not in a valid range (0-0) for line 14 ('\n')." data = { traceback = { ' File "/home/user/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.11/site-packages/pygls/protocol/json_rpc.py", line 266, in _h andle_request self._execute_request(msg_id, handler, params) ', ' File "/home/user/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.11/site -packages/pygls/protocol/json_rpc.py", line 188, in _execute_request self._send_response(msg_id, handler(params)) ^^^^^^^^^^^^^^^ ', ' File "/home/user/.local/share/nvim/mason/packages/jedi-language-server/venv/lib/python3.11/site-packages/jedi_language_server/server.py", line 277, in signature_help

signatures_jedi = jedi_script.get_signatures(*jedi_lines)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

', " File "/home/user/.local/share/nvim/ mason/packages/jedi-language-server/venv/lib/python3.11/site-packages/jedi/api/helpers.py", line 484, in wrapper raise ValueError('column parameter (%d) is not in a v alid range '

" }



My environment (my alt machine where everything worked):
- Debian 12 (alt Debian 12)
- Neovim 0.9.4 (alt 0.9.2)
- Python 3.10.13 (alt 3.10.10)
- Astronvim 3.39 (alt 3.37)
mlthlschr commented 6 months ago

Hi, I stumbled on the same problem the other day. I fixed it by configuring cursorhold_update = false! Looks like it fixed the problem and did not break anything else.

wustho commented 1 month ago

Hi, I stumbled on the same problem the other day. I fixed it by configuring cursorhold_update = false! Looks like it fixed the problem and did not break anything else.

Hi, @mlthlschr where can I update that setting?