This repository was archived by the owner on Sep 21, 2019. It is now read-only.
Make StringResponse handler's roles more obvious #332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an incremental refactoring in response to #330 and the discussion that spawned it: #328 (comment)
This does not attempt to solve some broader design issues discussed in #330, it’s just a small localized change to separate the logic for the very different types of requests that
StringResponsecan be returned for, so it's more obvious that this handler has these different roles. This is in part to help factor out the direct usage of the editor to finish #328. I've made these private functions for now, they're not really handler functions for discrete ENSIME server response message types like the rest of the formalProtocolHandlerinterface. They will might eventually fit logically somewhere else.As I've mentioned elsewhere, I don't really understand the purpose of the
:EnDocUricommand, it used to print the documentation URL in Vim's message area—which I don't see as useful—but even that is broken on current master (the command actually causes an exception). My guess is that the intent was that it could be useful as a function instead of command, allowing users to do something custom with the URL as a function result. As-is I don't yet see how to cleanly change it to work that way, it would have to be made synchronous. So with this change, I have un-documented the command but left some implementation in place with a TODO (and it no longer causes an exception, just basically a no-op). I could just go all the way and completely remove the command and that handling code right now, WDYT?