Skip to content
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

Missing type definitions compared to protocol specs #56

Open
sansmoraxz opened this issue Mar 28, 2024 · 4 comments
Open

Missing type definitions compared to protocol specs #56

sansmoraxz opened this issue Mar 28, 2024 · 4 comments

Comments

@sansmoraxz
Copy link
Contributor

Client definitions are missing

A lot of pydantic definitions are missing viz capabilities. Having to pass in explicit dicts are tedious and error prone.

Microsoft maintains a library called lsprotocol.

The python definitions here are complete but are based on attrs.

@sansmoraxz
Copy link
Contributor Author

sansmoraxz commented Mar 28, 2024

We have options:

  • Option 1: We include the library as a dependency.
  • Option 2: We modify their code generator to generate pydantic classes.
  • Option 3: We have compatibility for both attrs and pydantic. The lsprotocol will be an optional dependency.

@sansmoraxz sansmoraxz changed the title Missing types Missing type definitions compared to protocol specs Mar 29, 2024
@sansmoraxz
Copy link
Contributor Author

@yeger00 thoughts?

@yeger00
Copy link
Owner

yeger00 commented May 21, 2024

I don't mind adding the library as a depndency but I don't really like to support attrs.
I didn't fully understand option #2 - how do you think to implement this?

@sansmoraxz
Copy link
Contributor Author

sansmoraxz commented May 21, 2024

About the option 2:

The ground source of what the specs are is actually maintained here:

https://github.com/microsoft/lsprotocol/blob/47c83d89bcfe876cd0cd021a15f408bdea2e5cce/generator/lsp.json

If we have a parser to generate pydantic schemas, the maintenance of this project can be synced with core specs faster.

Have a baseline here (incomplete though):
https://gist.github.com/sansmoraxz/037f057b5551468b3f487a56ed96e4f9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants