pappasam / jedi-language-server

A Python language server exclusively for Jedi. If Jedi supports it well, this language server should too.
MIT License
611 stars 45 forks source link

"E15: Invalid expression: " when pressing enter for newline in neovim #308

Closed rmsc closed 7 months ago

rmsc commented 7 months ago

Switched recently from pyright to jedi-language-server-0.41.3, and now pressing Enter for newline when in Insert mode doesn't work:

E15: Invalid expression: 

Using o in Normal mode works as expected. In the logs I get several of the following (not sure if relevant):

(...)
[ERROR][2024-03-26 16:12:27] .../vim/lsp/rpc.lua:734    "rpc"   "/usr/bin/jedi-language-server" "stderr"    'WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "9"\n'
[ERROR][2024-03-26 16:12:27] .../vim/lsp/rpc.lua:734    "rpc"   "/usr/bin/jedi-language-server" "stderr"    'WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "10"\n'
[ERROR][2024-03-26 16:12:27] .../vim/lsp/rpc.lua:734    "rpc"   "/usr/bin/jedi-language-server" "stderr"    'WARNING:pygls.protocol.json_rpc:Cancel notification for unknown message id "11"\n'

This is in Archlinux, and package versions are as follows:

extra/python-jedi 0.19.1-1
extra/jedi-language-server 0.41.3-1
extra/python-pygls 1.3.0-1

My lsp configuration is pretty basic at this point, and everything works normally with other servers. The relevant part for jedi-language-server:

nvim_lsp.jedi_language_server.setup({
    on_attach = on_attach,
    capabilities = capabilities,
    flags = {
        debounce_text_changes = 150,
    },
})

PS: I did my best to search for a similar issue, but wasn't exactly sure what wording would be used.

rmsc commented 7 months ago

Sorry, I just realized the same thing is now happening with other language servers, so I must have broken something.

EDIT: an update to nvim-autopairs when installing jedi-language-server was to blame...