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 Request and Notification types/methods #47

Open
paracycle opened this issue Aug 29, 2022 · 0 comments
Open

Generate Request and Notification types/methods #47

paracycle opened this issue Aug 29, 2022 · 0 comments

Comments

@paracycle
Copy link
Contributor

Since the meta model that encodes the spec has a full specification for requests and notifications, we can start generating classes and/or methods for those as well. Currently, the SDK is not able to automatically process request JSON into the correct interface type that is appropriate for the request that is being handled. If we start generating request/notification artifacts, we can automate that for the users of the library as well.

For example, the spec codifies that:

{
  "notifications": [
    // ...
    {
      "method": "textDocument/didOpen",
      "params": {
        "kind": "reference",
        "name": "DidOpenTextDocumentParams"
      },
      "registrationOptions": {
        "kind": "reference",
        "name": "TextDocumentRegistrationOptions"
      },
      "documentation": "The document open notification is sent from the client to the server to signal\nnewly opened text documents. The document's truth is now managed by the client\nand the server must not try to read the document's truth using the document's\nuri. Open in this sense means it is managed by the client. It doesn't necessarily\nmean that its content is presented in an editor. An open notification must not\nbe sent more than once without a corresponding close notification send before.\nThis means open and close notification must be balanced and the max open count\nis one."
    },
    // ...
  ]
}

which should enable the user of the library to handle textDocument/didOpen with a argument of reference that is an instance of DidOpenTextDocumentParams.

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