Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[python] Make the method fields of requests, responses and notificati…
…ons literals (#355) This makes it possible for cattrs to build a disambiguation function based on this unique field, which allows one to do things like: ``` >>> from lsprotocol import types, converters >>> >>> converter = converters.get_converter() >>> d = {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Server starting"}} >>> converter.structure(d, types.NOTIFICATIONS | types.REQUESTS) WindowLogMessageNotification(params=LogMessageParams(type=<MessageType.Info: 3>, message='Server starting'), method='window/logMessage', jsonrpc='2.0') ```
- Loading branch information