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

Generate types via new metaModel.json #421

Closed
michaelpj opened this issue Apr 16, 2022 · 4 comments
Closed

Generate types via new metaModel.json #421

michaelpj opened this issue Apr 16, 2022 · 4 comments

Comments

@michaelpj
Copy link
Collaborator

microsoft/language-server-protocol#67

There's a machine-readable specification of the protocol coming. It's specified in a non-standard way, so we'd have to do some work to process it, but it's probably still better than doing it by hand!

@michaelpj
Copy link
Collaborator Author

Extremely WIP branch here: https://github.com/michaelpj/lsp/tree/mpj/metamodel

I had to do the types for the metamodel manually since it seems like there isn't a maintained JSON schema library in Haskell, sadly.

Codegen is going to be annoying. In particular we're going to have to deal with all the anonymous intersections and unions that the spec throws around. Often we rationalized those into e.g. sensible sum types, but I'm not sure if we can do that here...

@michaelpj
Copy link
Collaborator Author

I'm making significant progress on this. I'm currently trying to deal with all the Methods, which is a bit annoying since they've added a bunch more, and we have a lot of huge pattern matches for dealing with them. I may end up punting on this for the first version.

@michaelpj
Copy link
Collaborator Author

PR: #458

@michaelpj
Copy link
Collaborator Author

PR merged

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

1 participant