-
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 #58
Labels
enhancement
New feature or request
Comments
This was referenced Dec 6, 2019
This was referenced Dec 14, 2019
This was referenced Feb 5, 2020
This was referenced Feb 21, 2020
ebkalderon
added a commit
that referenced
this issue
Feb 22, 2020
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. 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` or building a custom client solution for the `Printer`, converting it to a `Client` or similar.
ebkalderon
added a commit
that referenced
this issue
Feb 22, 2020
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` or building a custom client solution for the `Printer`, converting it to a `Client` or similar.
ebkalderon
added a commit
that referenced
this issue
Feb 22, 2020
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.
@ebkalderon You can go ahead and merge it if you're ready, I was waiting for feedback on #100, so I haven't started yet. |
Okay, sounds good! Do you personally find the new trait API with |
ebkalderon
added a commit
that referenced
this issue
Feb 22, 2020
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With async/await stabilizing in Rust 1.39.0, this library should be ported to use the new syntax and switch to
std::future::Future
. This should involve upgradingtower-service
to version 0.3.0alpha.2 and switching away fromjsonrpc_core
to the brand-newjsonrpsee
crate.Unfortunately,
jsonrpsee
does not provide a stdio transport at the time of writing. Since this is a hard requirement for virtually all LSP servers, we will have to wait until support is implemented.The text was updated successfully, but these errors were encountered: