Take the drudgery out of keeping up with LSP changes with lsprotocol? #257
Replies: 6 comments 20 replies
-
That looks awesome! To me it's obvious that Pygls should go in this direction. But I'm still new to the project so don't have the best view on it. Hopefully we can get some other perspectives. BTW, I notice the project's links to Github aren't working, eg https://github.com/microsoft/lsprotocol |
Beta Was this translation helpful? Give feedback.
-
It definitely makes sense to adopt something like this, the only thing I’d potentially miss from the current pydantic types is the alias feature allowing fields to be referenced using snake case ( Certainly not an issue if it can’t be added, just thought I’d ask :) |
Beta Was this translation helpful? Give feedback.
-
We chose the camel case to align with the LSP documentation. Another reason was that translation between camel case and snake case can impact performance. If you need to add a way to covert it is possible, there are a few options. But we recommend keeping it as is for performance reasons. If you do choose to adopt |
Beta Was this translation helpful? Give feedback.
-
We initially built this library for pythonistas to quickly learn LSP and build a language server, so we prioritized a pythonic api, part of which is snake case. However, it seems like there are now many language server developers who use PyGLS to rapidly build. For them, snake case makes the most sense. I would like to support both. So my response would be -0.5 "if you did the PR to update the names we would merge it after re-implementing snake case ourselves." I feel a bit more confident in that decision given the landslide in @brettcannon's twitter poll: |
Beta Was this translation helpful? Give feedback.
-
I'm very much a snake_case person, as was my father, and his before him. Generations of snake_case merchants! That being said, I see it as very low priority. I wouldn't want anybody going out there way to support it. If it came to it I'd vote for supporting camelCase first and exploring snake_case as and when time allowed. |
Beta Was this translation helpful? Give feedback.
-
New version of |
Beta Was this translation helpful? Give feedback.
-
Now that LSP has a machine-readable definition, we have released lsprotocol as a generated library of the types and messages used by LSP. It uses cattrs for everything, so it's fully typed (and would address #221 ).
It's an alpha because we wanted to get this out as soon as possible to talk with you all about what would you need from the library to adopt it? We essentially want to shoulder the boring, common, sans-I/O bits that any LSP library written in Python would need so pygls and other similar libraries can focus on the more interesting stuff. To start we have just done the types and messages, but we are open to discuss taking on more common functionality that folks think makes sense.
What would you all like to see from lsprotocol to make it useful to pygls?
Beta Was this translation helpful? Give feedback.
All reactions