on master help sign in
dap: All of these calls don't need &mut
bcf70d8Blaž Hrastnik
helix-dap/src/client.rs+14−14
@@ -284,7 +284,7 @@ impl Client {
284 Ok(())
284 Ok(())
285 }
285 }
286
286
287− pub async fn disconnect(&mut self) -> Result<()> {
287+ pub async fn disconnect(&self) -> Result<()> {
288 self.request::<requests::Disconnect>(()).await
288 self.request::<requests::Disconnect>(()).await
289 }
289 }
290
290
@@ -297,7 +297,7 @@ impl Client {
297 }
297 }
298
298
299 pub async fn set_breakpoints(
299 pub async fn set_breakpoints(
300− &mut self,
300+ &self,
301 file: PathBuf,
301 file: PathBuf,
302 breakpoints: Vec<SourceBreakpoint>,
302 breakpoints: Vec<SourceBreakpoint>,
303 ) -> Result<Option<Vec<Breakpoint>>> {
303 ) -> Result<Option<Vec<Breakpoint>>> {
@@ -321,11 +321,11 @@ impl Client {
321 Ok(response.breakpoints)
321 Ok(response.breakpoints)
322 }
322 }
323
323
324− pub async fn configuration_done(&mut self) -> Result<()> {
324+ pub async fn configuration_done(&self) -> Result<()> {
325 self.request::<requests::ConfigurationDone>(()).await
325 self.request::<requests::ConfigurationDone>(()).await
326 }
326 }
327
327
328− pub async fn continue_thread(&mut self, thread_id: ThreadId) -> Result<Option<bool>> {
328+ pub async fn continue_thread(&self, thread_id: ThreadId) -> Result<Option<bool>> {
329 let args = requests::ContinueArguments { thread_id };
329 let args = requests::ContinueArguments { thread_id };
330
330
331 let response = self.request::<requests::Continue>(args).await?;
331 let response = self.request::<requests::Continue>(args).await?;
@@ -333,7 +333,7 @@ impl Client {
333 }
333 }
334
334
335 pub async fn stack_trace(
335 pub async fn stack_trace(
336− &mut self,
336+ &self,
337 thread_id: ThreadId,
337 thread_id: ThreadId,
338 ) -> Result<(Vec<StackFrame>, Option<usize>)> {
338 ) -> Result<(Vec<StackFrame>, Option<usize>)> {
339 let args = requests::StackTraceArguments {
339 let args = requests::StackTraceArguments {
@@ -347,19 +347,19 @@ impl Client {
347 Ok((response.stack_frames, response.total_frames))
347 Ok((response.stack_frames, response.total_frames))
348 }
348 }
349
349
350− pub async fn threads(&mut self) -> Result<Vec<Thread>> {
350+ pub async fn threads(&self) -> Result<Vec<Thread>> {
351 let response = self.request::<requests::Threads>(()).await?;
351 let response = self.request::<requests::Threads>(()).await?;
352 Ok(response.threads)
352 Ok(response.threads)
353 }
353 }
354
354
355− pub async fn scopes(&mut self, frame_id: usize) -> Result<Vec<Scope>> {
355+ pub async fn scopes(&self, frame_id: usize) -> Result<Vec<Scope>> {
356 let args = requests::ScopesArguments { frame_id };
356 let args = requests::ScopesArguments { frame_id };
357
357
358 let response = self.request::<requests::Scopes>(args).await?;
358 let response = self.request::<requests::Scopes>(args).await?;
359 Ok(response.scopes)
359 Ok(response.scopes)
360 }
360 }
361
361
362− pub async fn variables(&mut self, variables_reference: usize) -> Result<Vec<Variable>> {
362+ pub async fn variables(&self, variables_reference: usize) -> Result<Vec<Variable>> {
363 let args = requests::VariablesArguments {
363 let args = requests::VariablesArguments {
364 variables_reference,
364 variables_reference,
365 filter: None,
365 filter: None,
@@ -372,7 +372,7 @@ impl Client {
372 Ok(response.variables)
372 Ok(response.variables)
373 }
373 }
374
374
375− pub async fn step_in(&mut self, thread_id: ThreadId) -> Result<()> {
375+ pub async fn step_in(&self, thread_id: ThreadId) -> Result<()> {
376 let args = requests::StepInArguments {
376 let args = requests::StepInArguments {
377 thread_id,
377 thread_id,
378 target_id: None,
378 target_id: None,
@@ -382,7 +382,7 @@ impl Client {
382 self.request::<requests::StepIn>(args).await
382 self.request::<requests::StepIn>(args).await
383 }
383 }
384
384
385− pub async fn step_out(&mut self, thread_id: ThreadId) -> Result<()> {
385+ pub async fn step_out(&self, thread_id: ThreadId) -> Result<()> {
386 let args = requests::StepOutArguments {
386 let args = requests::StepOutArguments {
387 thread_id,
387 thread_id,
388 granularity: None,
388 granularity: None,
@@ -391,7 +391,7 @@ impl Client {
391 self.request::<requests::StepOut>(args).await
391 self.request::<requests::StepOut>(args).await
392 }
392 }
393
393
394− pub async fn next(&mut self, thread_id: ThreadId) -> Result<()> {
394+ pub async fn next(&self, thread_id: ThreadId) -> Result<()> {
395 let args = requests::NextArguments {
395 let args = requests::NextArguments {
396 thread_id,
396 thread_id,
397 granularity: None,
397 granularity: None,
@@ -400,14 +400,14 @@ impl Client {
400 self.request::<requests::Next>(args).await
400 self.request::<requests::Next>(args).await
401 }
401 }
402
402
403− pub async fn pause(&mut self, thread_id: ThreadId) -> Result<()> {
403+ pub async fn pause(&self, thread_id: ThreadId) -> Result<()> {
404 let args = requests::PauseArguments { thread_id };
404 let args = requests::PauseArguments { thread_id };
405
405
406 self.request::<requests::Pause>(args).await
406 self.request::<requests::Pause>(args).await
407 }
407 }
408
408
409 pub async fn eval(
409 pub async fn eval(
410− &mut self,
410+ &self,
411 expression: String,
411 expression: String,
412 frame_id: Option<usize>,
412 frame_id: Option<usize>,
413 ) -> Result<requests::EvaluateResponse> {
413 ) -> Result<requests::EvaluateResponse> {
@@ -422,7 +422,7 @@ impl Client {
422 }
422 }
423
423
424 pub async fn set_exception_breakpoints(
424 pub async fn set_exception_breakpoints(
425− &mut self,
425+ &self,
426 filters: Vec<String>,
426 filters: Vec<String>,
427 ) -> Result<Option<Vec<Breakpoint>>> {
427 ) -> Result<Option<Vec<Breakpoint>>> {
428 let args = requests::SetExceptionBreakpointsArguments { filters };
428 let args = requests::SetExceptionBreakpointsArguments { filters };