lsp_signature.nvim icon indicating copy to clipboard operation
lsp_signature.nvim copied to clipboard

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

Open alexveden opened this issue 1 year ago • 2 comments

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
  1. Place cursor on empty line between imports
  2. (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)

alexveden avatar Dec 05 '23 15:12 alexveden

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.

mlthlschr avatar Jan 04 '24 19:01 mlthlschr

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?

wustho avatar May 31 '24 02:05 wustho