@@ -122,24 +122,24 @@ pub(super) fn notification(notif: server::Notification) -> Task {
122122 } )
123123}
124124
125- fn _local_request_task < R : traits:: SyncRequestHandler > ( req : server:: Request ) -> super :: Result < Task >
125+ fn _local_request_task < R : traits:: SyncRequestHandler > ( req : server:: Request ) -> Result < Task >
126126where
127- <<R as RequestHandler >:: RequestType as lsp_types :: request :: Request >:: Params : UnwindSafe ,
127+ <<R as RequestHandler >:: RequestType as Request >:: Params : UnwindSafe ,
128128{
129129 let ( id, params) = cast_request :: < R > ( req) ?;
130- Ok ( Task :: local ( |session, client : & Client | {
130+ Ok ( Task :: local ( move |session, client : & Client | {
131131 let _span = tracing:: debug_span!( "request" , %id, method = R :: METHOD ) . entered ( ) ;
132132 let result = R :: run ( session, client, params) ;
133- respond :: < R > ( id, result, client) ;
133+ respond :: < R > ( & id, result, client) ;
134134 } ) )
135135}
136136
137137fn background_request_task < R : traits:: BackgroundDocumentRequestHandler > (
138138 req : server:: Request ,
139139 schedule : BackgroundSchedule ,
140- ) -> super :: Result < Task >
140+ ) -> Result < Task >
141141where
142- <<R as RequestHandler >:: RequestType as lsp_types :: request :: Request >:: Params : UnwindSafe ,
142+ <<R as RequestHandler >:: RequestType as Request >:: Params : UnwindSafe ,
143143{
144144 let retry = R :: RETRY_ON_CANCELLATION . then ( || req. clone ( ) ) ;
145145 let ( id, params) = cast_request :: < R > ( req) ?;
@@ -192,7 +192,7 @@ where
192192 } ) ;
193193
194194 if let Some ( response) = request_result_to_response :: < R > ( & id, client, result, retry) {
195- respond :: < R > ( id, response, client) ;
195+ respond :: < R > ( & id, response, client) ;
196196 }
197197 } )
198198 } ) )
@@ -213,7 +213,7 @@ where
213213 match result {
214214 Ok ( response) => Some ( response) ,
215215 Err ( error) => {
216- // Request was canceled due to some modifications to the salsa database.
216+ // Check if the request was canceled due to some modifications to the salsa database.
217217 if error. payload . downcast_ref :: < salsa:: Cancelled > ( ) . is_some ( ) {
218218 // If the query supports retry, re-queue the request.
219219 // The query is still likely to succeed if the user modified any other document.
@@ -247,7 +247,7 @@ where
247247
248248fn local_notification_task < N : traits:: SyncNotificationHandler > (
249249 notif : server:: Notification ,
250- ) -> super :: Result < Task > {
250+ ) -> Result < Task > {
251251 let ( id, params) = cast_notification :: < N > ( notif) ?;
252252 Ok ( Task :: local ( move |session, client| {
253253 let _span = tracing:: debug_span!( "notification" , method = N :: METHOD ) . entered ( ) ;
@@ -262,11 +262,10 @@ fn local_notification_task<N: traits::SyncNotificationHandler>(
262262fn background_notification_thread < N > (
263263 req : server:: Notification ,
264264 schedule : BackgroundSchedule ,
265- ) -> super :: Result < Task >
265+ ) -> Result < Task >
266266where
267267 N : traits:: BackgroundDocumentNotificationHandler ,
268- <<N as NotificationHandler >:: NotificationType as lsp_types:: notification:: Notification >:: Params :
269- UnwindSafe ,
268+ <<N as NotificationHandler >:: NotificationType as Notification >:: Params : UnwindSafe ,
270269{
271270 let ( id, params) = cast_notification :: < N > ( req) ?;
272271 Ok ( Task :: background ( schedule, move |session : & Session | {
@@ -309,13 +308,13 @@ where
309308/// implementation.
310309fn cast_request < Req > (
311310 request : server:: Request ,
312- ) -> super :: Result < (
313- server :: RequestId ,
314- <<Req as RequestHandler >:: RequestType as lsp_types :: request :: Request >:: Params ,
311+ ) -> Result < (
312+ RequestId ,
313+ <<Req as RequestHandler >:: RequestType as Request >:: Params ,
315314) >
316315where
317- Req : traits :: RequestHandler ,
318- <<Req as RequestHandler >:: RequestType as lsp_types :: request :: Request >:: Params : UnwindSafe ,
316+ Req : RequestHandler ,
317+ <<Req as RequestHandler >:: RequestType as Request >:: Params : UnwindSafe ,
319318{
320319 request
321320 . extract ( Req :: METHOD )
@@ -333,26 +332,24 @@ where
333332
334333/// Sends back a response to the server using a [`Responder`].
335334fn respond < Req > (
336- id : server:: RequestId ,
337- result : crate :: server:: Result <
338- <<Req as traits:: RequestHandler >:: RequestType as lsp_types:: request:: Request >:: Result ,
339- > ,
335+ id : & RequestId ,
336+ result : Result < <<Req as RequestHandler >:: RequestType as Request >:: Result > ,
340337 client : & Client ,
341338) where
342- Req : traits :: RequestHandler ,
339+ Req : RequestHandler ,
343340{
344341 if let Err ( err) = & result {
345342 tracing:: error!( "An error occurred with request ID {id}: {err}" ) ;
346343 client. show_error_message ( "ty encountered a problem. Check the logs for more details." ) ;
347344 }
348- if let Err ( err) = client. respond ( id, result) {
345+ if let Err ( err) = client. respond ( & id, result) {
349346 tracing:: error!( "Failed to send response: {err}" ) ;
350347 }
351348}
352349
353350/// Sends back an error response to the server using a [`Client`] without showing a warning
354351/// to the user.
355- fn respond_silent_error ( id : server :: RequestId , client : & Client , error : lsp_server:: ResponseError ) {
352+ fn respond_silent_error ( id : RequestId , client : & Client , error : lsp_server:: ResponseError ) {
356353 if let Err ( err) = client. respond_err ( id, error) {
357354 tracing:: error!( "Failed to send response: {err}" ) ;
358355 }
@@ -362,12 +359,12 @@ fn respond_silent_error(id: server::RequestId, client: &Client, error: lsp_serve
362359/// a parameter type for a specific request handler.
363360fn cast_notification < N > (
364361 notification : server:: Notification ,
365- ) -> super :: Result <
366- (
367- & ' static str ,
368- << N as traits :: NotificationHandler > :: NotificationType as lsp_types :: notification :: Notification > :: Params ,
369- ) > where
370- N : traits :: NotificationHandler ,
362+ ) -> Result < (
363+ & ' static str ,
364+ << N as NotificationHandler > :: NotificationType as Notification > :: Params ,
365+ ) >
366+ where
367+ N : NotificationHandler ,
371368{
372369 Ok ( (
373370 N :: METHOD ,
0 commit comments