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

Use Option<String> as service response type #116

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

ebkalderon
Copy link
Owner

Changed

  • Change LspService to return Option<String> responses.
  • Change Server to accept T: Service<Incoming, Response = Option<String>>.

The current implementation of tower_service::Service for LspService uses String as the response type. Incoming LSP notifications produce a zero-length string response, which isn't fully semantically correct. Rather, incoming client-to-server requests should produce a Some(String) response and all other incoming messages (client-to-server notifications or responses) should produce a None response.

The current implementation of `tower_service::Service` for `LspService`
uses `String` as the response type. Incoming LSP notifications produce a
zero-length string response, which isn't fully semantically correct.
Rather, incoming client-to-server requests should produce a
`Some(String)` response and all other incoming messages
(client-to-server notifications or responses) should produce a `None`
response.
@ebkalderon ebkalderon self-assigned this Feb 28, 2020
@ebkalderon ebkalderon merged commit 30b6efb into master Feb 28, 2020
@ebkalderon ebkalderon deleted the use-option-string-response branch February 28, 2020 08:00
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

Successfully merging this pull request may close these issues.

1 participant