-
Notifications
You must be signed in to change notification settings - Fork 8
Add static typed funcs and a callback handler story #4
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4 +/- ##
========================================
Coverage ? 0.85%
========================================
Files ? 3
Lines ? 117
Branches ? 0
========================================
Hits ? 1
Misses ? 116
Partials ? 0
Continue to review full report at Codecov.
|
src/typed.jl
Outdated
|
|
||
| struct RequestType{TPARAM,TR} <: AbstractMessageType | ||
| method::String | ||
| dict2param::Function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the RequestType holds the methods for converting to and from the Dict that represents the JSON format? Would this then require a significant refactoring of the LSP (i.e. all the Dict->DataType converters built by @dict_readable share the name of DataType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my initial idea, but I removed that. The current design is such that every RequestType just links the method name with a type for the parameters and a type for the return value.
For the conversion from Dict to type it just passes the dict to the constructor of the type, and for the conversion from type to JSON it just relies on whatever mechanism there is in JSON (I think). I think that means it should all work with the existing design for conversions, right? That was the goal, in any case ;)
|
@ZacLN I think this is ready to be merged? |
This is very much WIP.Ready for review. See julia-vscode/LanguageServer.jl#701 for an example of how to use this.There are two goals: 1) add a more static API on top of what is there already (i.e. incorporate the ideas from https://github.com/julia-vscode/LanguageServer.jl/blob/master/src/jsonrpc.jl into here) and 2) add a layer that can dispatch messages to callback handler functions.