-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.0.0 BREAKING CHANGES release thread #273
Conversation
My main observation from pappasam/jedi-language-server#230 is that it's a real shame that lsprotocol doesn't expose types, that will make authoring language servers that little bit more error prone than it need be. Otherwise it all seems to have gone pretty smoothly, nice job. |
@dimbleby if you see anything missing, please file bug on |
@karthiknadig you probably want to get involved in the bug at pappasam/jedi-language-server#230 (comment) |
@dimbleby Wow that's awesome that you've already managed to integrate this. Can you explain more about lsprotocol not exposing types? I mean I see that it does use Python types, eg: |
I mean type annotations, I would love for lsprotocol to (i) be clean under you'll likely have seen that it's not quite so awesome as all that, pappasam/jedi-language-server#230 (comment) looks like an lsprotocol bug |
Ok, so it's more a matter of having better typing support, rather than introducing types in the first place? It seems like |
some way still to go, if mypy support is intended:
Actually that's a relatively small number for a project that perhaps hasn't yet even tried - possibly it wouldn't be tremendously hard to get to zero errors. |
Created microsoft/lsprotocol#96 to track |
Not sure how we want to handle issues with this branch? Do we want to create dedicated issues but tag them with something like I've noticed that the server process just completely crashes if it encounters a message it cannot parse/does not like. |
Good question @alcarney, it probably depends on the issue. I think that one may need its own issue, because it's more likely to be a bug in Pygls itself right? |
Just a little update to summarise from the other threads involved.
|
@tombh yes, the error handling in |
I've made a new issue for the more general problem of unhandled errors: #277 |
ffe4bae
to
5816916
Compare
I've just rebased the recent changes we've merged into master in the last few days, most notably improved error handling #282. That addresses an underlying issue that @alcarney noticed with this new code, namely that the server wasn't catching unhandled deserialisation errors, which I think understandably could come up more now that we've changed all the underlying types. But I think @alcarney, Also, where are we at with the Mypy types? I don't think that's necessarily a blocking issue? The main thing is that https://pypi.org/project/lsprotocol/2022.0.0a6 fixed the errors in pappasam/jedi-language-server#230 (comment) right? |
The error in question was being tracked in microsoft/lsprotocol#102, and should be fixed in the next version of |
Ah great! I'll look out for that then |
5816916
to
c329c8f
Compare
📰 New versions news 📰
So it looks like we're getting there with this branch, or indeed are there already. I think the only main thing left to do is write a brief v0.12.x to v1 migration guide. |
Hmm... I wonder why all the builds have hung...
I can put something together as I have a go at porting esbonio - unless anyone else has started working on one?
Exciting! Though do we know how many servers have attempted a migration? |
c329c8f
to
7c06b31
Compare
No, nobody else (well it would only be me anyway) has started on a migration guide. I think you'd be best placed to write it, so if you're up for that then great, but I'm totally happy to do it too. The only report from the wild about implementing this migration so far that we've had is pappasam/jedi-language-server#230 Yeah, would be nice to get some more feedback for sure. So, the CI errors. There are 3 interesting things happening.
|
As far as I can tell, there are no tests that depend on any of the values contained within `ClientCapabilities`. This commit adds some tests around the construction of the `TextDocumentSyncOptions` field for the server's capabilities. It also fixes a bug that was introduced in the previous commit
44b861b
to
6fbda1c
Compare
@charliermarsh Yes, that is indeed helpful to see! Thank you ❤️ Everybody: I've updated Pygls' README and docs to state that v1 alpha is now the recommended version to start new Pygls-based LSP servers. Having released a fix on our main branch for a LSP type issue that is already fixed in this branch, I'm feeling like we're ready to release this branch. Today, the fact that this branch is not released caused a tiny bit more real extra work rather than the theoretical extra work that might come from releasing this branch. Which is to say, there's a reasonable assumption that this branch will not cause any extra work when released, and an actual fact that not releasing it has already created a tiny bit more work. Fixing the LSP type issue today felt very much like supporting an old version of Pygls. Which is something we can still totally do even once this v1 branch is released. What do you think @alcarney? |
I agree, I can't think of a technical reason to hold this branch back anymore. The only other thing that's probably worth doing before a release, is to make sure the docs, README etc are consistent with all the changes here. |
This removes the `attrs.field` definitions from the `JsonRPCResponseMessage`, `JsonRPCRequestMessage` and `JsonRPCNotification` types. This prevents any dictionaries passed to the `result` or `params` fields from being corrupted during serialization. To preserve the "converting dictionaries to objects" behavior, this commit extends the converter we get from `lsprotocol` to include structure hooks that calls `dict_to_object` on the required fields during parsing. Finally, the module level converter has been removed in favour of a converter attached to the `JsonRPCProtocol` object in preparation for allowing servers to provide their own custom converters.
6fbda1c
to
288f33b
Compare
Great. I've just pushed those doc changes and bumped the version to |
Looks good. One final thought, should we wait for a non-alpha release of |
FYI Karthik won't be available to make a final release until the latter half of this month, but we would be happy to if the library is working as you all need it to be. |
@alcarney Good point. Ideally yes, it'd be good to release with a non-alpha @brettcannon From my perspective I think |
Well, LGTM then 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't believe it's actually happening! 😅
Woohoo! 🎉 Merged and published. Thank you everybody ❤️🙇 I actually streamed the moment live on Twitch 😎 https://clips.twitch.tv/DeadExquisiteButterPJSugar-DLXXPnknw87VSdPs Here's the Pypi package: https://pypi.org/project/pygls/1.0.0 And the migration docs have been published too: https://pygls.readthedocs.io/en/latest/pages/migrating-to-v1.html (I notice I didn't get the list syntax right for the links to other already migrated projects, I'll make a little PR for that). |
Congratulations on the release! |
Congrats on the release! And thanks to everyone for providing feedback on lsprotocol so we could improve it for everyone's benefit! |
With huge thanks and kudos to Esbonio's @alcarney and Microsoft's @karthiknadig we now have a pre release version of Pygls that migrates away from Pydantic and to lsprotocol.
You can try it by explicitly setting your dependency to
pygls=1.0.0a2
. The migration guide is at: docs/pages/migrating-to-v1.rstlsprotocol
is mostly just a module that officially and comprehensively defines the data structures and types that make up the LSP specification. Therefore, what it offers are upstream (from Microsoft, the creators of LSP) guarantees on adherence to the formal behaviour and expectations of the specification.TODO:
WritePublish guide on how to make the required changes.This may also be a good opportunity to introduce other breaking changes, such as in #274
Notes:
Edit: added line about taking advantage of a breaking change release