pappasam / jedi-language-server

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

Fix compatibility issue with lsprotocol by pinning version in pyproject.toml #311

Closed arthur-k-kochi closed 7 months ago

arthur-k-kochi commented 7 months ago

As discussed in issue #302, the latest version of lsprotocol (2024.0.0a1) has deprecated the TraceValues from lsprotocol.types, which caused failures when initiating the jedi-language-server. This issue led to an inability to start the server as detailed in the error logs.

To resolve this, I have proposed a change in the pyproject.toml to pin the lsprotocol version to <=2023.0.1. Additionally, I have updated the poetry.lock file to reflect this change.

Please note that this is my first pull request outside of my personal projects. I welcome any feedback or corrections if there are better ways to handle this issue. Thank you for considering this contribution!

arthur-k-kochi commented 7 months ago

Fix: #302

arthur-k-kochi commented 7 months ago

I only changed the version specification of lsprotocol, but the automatic updates to poetry.lock may have introduced some malfunctions in the package. Are there any project-specific methods or tools recommended to verify that the updated package functions correctly?

pappasam commented 7 months ago

Yep, check out the README's section on local development / how to run the tests locally: https://github.com/pappasam/jedi-language-server?tab=readme-ov-file#local-development.

Regarding the update: I think the issue might be that, by relying on >=2022.0.0a9 in pyproject.toml, poetry might be implicitly allowing pre-prereleases. Since lsprotocol now has non-pre-releases, we should probably update pyproject.toml to not allow pre-releases (maybe by just specifying >=2023.0.1).

I'd update your PR to include that line, run poetry update, then run the tests locally and see if things work (might need to update linting / type checking errors that crop up from the latest dev tools).

I suspect the root issue here is that the dependencies for this project aren't resolving correctly. jedi-language-server doesn't directly rely on TraceValues; it's relied on in one of our dependencies (pygls)

pappasam commented 7 months ago

Resolved by: https://github.com/pappasam/jedi-language-server/pull/312