Skip to content

Commit

Permalink
Rename LspServiceBuilder::method -> custom_method
Browse files Browse the repository at this point in the history
  • Loading branch information
ebkalderon committed Mar 11, 2022
1 parent ab628e2 commit 98a6b1f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,13 @@ impl<S: LanguageServer> LspServiceBuilder<S> {
/// }
///
/// let (service, socket) = LspService::build(|_| Mock)
/// .method("custom/request", Mock::request)
/// .method("custom/requestParams", Mock::request_params)
/// .method("custom/notification", Mock::notification)
/// .method("custom/notificationParams", Mock::notification_params)
/// .custom_method("custom/request", Mock::request)
/// .custom_method("custom/requestParams", Mock::request_params)
/// .custom_method("custom/notification", Mock::notification)
/// .custom_method("custom/notificationParams", Mock::notification_params)
/// .finish();
/// ```
pub fn method<P, R, F>(mut self, name: &'static str, callback: F) -> Self
pub fn custom_method<P, R, F>(mut self, name: &'static str, callback: F) -> Self
where
P: FromParams,
R: IntoResponse,
Expand Down Expand Up @@ -360,7 +360,7 @@ mod tests {
#[tokio::test(flavor = "current_thread")]
async fn serves_custom_requests() {
let (mut service, _) = LspService::build(|_| Mock)
.method("custom", Mock::custom_request)
.custom_method("custom", Mock::custom_request)
.finish();

let initialize = initialize_request(1);
Expand Down

0 comments on commit 98a6b1f

Please sign in to comment.