-
Notifications
You must be signed in to change notification settings - Fork 206
Protocol definition #66
Comments
I fear that having specific types like that links them very much to a specific command. So then plugin authors will either abuse these types, or put everything into the most generic response type they can find.
But really in that example, having an object brings nothing over the string
What would be so bad having the
For example? |
@JPMoresmau: very good question. I think that the index key should answer the question: what is supposed to happen to the value? There supposedly is a function in editor that knows what to do with type information, another one that knows what to do with messages, but there is none that knows what to do with a generic string. |
My mental hook on this is "widget". The initial tag tells the editor what kind of processing to do on the rest, in terms of presentation on the UI. We should be able to come up with a small set of meaningful widgets/semantic verbs, which can then be implemented in any IDE supporting HIE |
Is it our job to mandate what should an editor do with what we return? An editor can display a string as a tooltip or since it knows it's the return of the type command, parse it as a type signature and display it in a tree structure, adding documentation on each type encountered in the signature, etc. An editor may request the type of an expression to display to the user, or to do something invisible (update a metadata lookup table). |
It is not mandating what to do so much as indicating what the thing is in terms that make sense in the context of providing a UI |
OK fine. And plugin writers will then be able to add their own types, and editors will have to support these? |
The process of extending the "blessed" types is unclear to me. I think it is something that should happen via a considered process, as it potentially has a wide impact. |
Why? I've developed a tool that could be useful for editors, so I write a hie plugin. I return a complex structure, encoded as a type in Haskell and represented as a JSON object, etc on the wire. Editors either don't support my plugin and will not use its commands, or will support it and will have to know how to handle my return structure. Who else needs to bless my return type? |
I think to start with we should let it run as you say, we just need to be careful that we do not end up with a multitude of types that are not quite the same, so the burden on IDE integrators becomes high. It should be self-regulating in the sense that if a plugin writer wants a feature to be widely used quickly they should reuse one of the exiting types known by the IDEs at that point |
So I think we need a simple {"ok":"string"} result. More complex structures can be typed. That seems to me to be a good compromise. |
The full example is:
Then I see many commands that return only success/failure to share the |
Our protocol has become reasonably stable, so I would prefer to open more concrete issues for any issues we still have or find in the future instead of this general one. Everyone fine with that? |
Closing, please reopen more specific issues if you find things we need to fix or change. |
Requirements:
There seems to be a consensus that we would like to use some hints for types in the json itself, we can base a simple idea roughly on inverse of Type-indexed rows.
Lets define a set of possible responses as an open sum with following examples:
this translates to Haskell data declarations:
Rationale:
response.type_info.type
The text was updated successfully, but these errors were encountered: