pappasam / jedi-language-server

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

Error due to CompletionOptions #268

Closed AckslD closed 1 year ago

AckslD commented 1 year ago

When running eg jedi-language-server --version I get:

Traceback (most recent call last):
  File "/usr/bin/jedi-language-server", line 5, in <module>
    from jedi_language_server.cli import cli
  File "/usr/lib/python3.10/site-packages/jedi_language_server/cli.py", line 8, in <module>
    from .server import SERVER
  File "/usr/lib/python3.10/site-packages/jedi_language_server/server.py", line 189, in <module>
    def completion(
  File "/usr/lib/python3.10/site-packages/pygls/feature_manager.py", line 174, in decorator
    raise TypeError(
TypeError: Options of method "textDocument/completion" should be instance of type <class 'lsprotocol.types.CompletionOptions'>

Which is weird since the decorator of that function does seem to indeed use lsprotocol.types.CompletionOptions.

My versions are:

Zaedus commented 1 year ago

I am running into the same issue.

DelusionalOptimist commented 1 year ago

Was facing this on Arch after upgrading python-pygls to v1.0.1-2 Downgrading pygls to v1.0.1-1 worked.

If you're not using arch packages, I think downgrading pygls to a version before typeguard was updated might make the language server work.

I guess jedi-language-server needs to be updated to use newer typeguard as well.

dimbleby commented 1 year ago

jedi-language-server has no direct dependency on typeguard, nothing should need to be changed on this project

the latest published pygls (1.0.1) has an explicit dependency requiring a version of typeguard before version 3:

curl -s https://pypi.org/pypi/pygls/json | jq '.info.requires_dist'
[
  "lsprotocol",
  "typeguard (<3,>=2.10.0)",
  ...

so if any of you are getting typeguard 3.0 or higher with jedi-language-server then you should take that up with whatever tool it is you are using to install it.

AckslD commented 1 year ago

I don't think this has anything to do with typeguard, I have <3.0. However downgrading pygls from 1.0.1-2 to 1.0.1-1 does work.

dimbleby commented 1 year ago

this sounds like arch nonsense, there is no such thing as pygls 1.0.1-1 and 1.0.1-2 - https://pypi.org/project/pygls/#history

complain to the arch people if they have made a mess of packaging pygls, there is nothing that this repository can do about that

AckslD commented 1 year ago

Fair enough, fyi for anyone else with the same issue, seems to be fixed with 1.0.1-3 again