-
Notifications
You must be signed in to change notification settings - Fork 59
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
Convert to std::future and async/await #101
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit makes judicious use of `compat()` to convert between `std::future::Future` and the legacy `futures` 0.1 `Future` trait such that we can have native Rust async/await support without waiting for the `jsonrpsee` crate to be ready (see #58 for context). Naturally, this should be considered a breaking change for this library since it directly affects the public API for this crate, and it also increases the minimum supported Rust version to 1.39.0. It tentatively introduces a reliance on [`async-trait`] for the `LanguageServer` trait and it also relaxes the `'static` requirements for the `stdin` parameter for `Server`. [`async-trait`]: https://github.com/dtolnay/async-trait This does not yet resolve #13, since that would require either switching to `jsonrpsee`, once it's ready, or building a custom client solution for the `Printer`, converting it to a `Client` or similar.
According to semantic versioning rules, we should be capable of compiling with any crate that is at least minor-version compatible with our requirements. Retaining the patch versions here creates a lot of unnecessary work for Dependabot and requires the maintainer to manually bump the versions through PRs. With this change, this will no longer be necessary for patch version changes, which will be applied to `tower-lsp` automatically where applicable by Cargo.
Since this pull request closes #101 but does not yet convert the library to use |
This was referenced Feb 22, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added
async_trait::async_trait
at the root for convenience.Changed
std::future::Future
and async/await (use newfutures
,tokio
,tower-service
).Unpin
bound tostdout
parameter inServer
.README.md
, use glob imports in examples.Deserialize
derive in example.Cargo.toml
.Fixed
Printer::send_notification()
.Removed
'static
bound forstdin
parameter inServer
.This closes #58, closes #64, closes #90, closes #91, closes #96, and closes #97.