lapce / lapce-plugin-rust

Apache License 2.0
31 stars 9 forks source link

Function to respond to a request from the client editor #10

Open MinusGix opened 2 years ago

MinusGix commented 2 years ago

Currently, one can respond to a request (received in handle_request) by using object_to_stdout, but that is a poor API. Here's my idea of the function definition for responding:

/// `T` is the type of the request you're responding to
fn send_response<T: Request>(id: u64, params: T::Result);

So, knowing the request type (which they can presumably do), it enforces that the resulting type you send back is correct.