on master help sign in
refactor
commit34c6094604cfeca0c1338a20cf9e85bcd8d9b68b authorDmitry Sharshakov <d3dx12.xx@gmail.com> dateTue 24 Aug 2021, 11:32 (5 years ago) parent2158366
5 files changed+9−19
Cargo.lock−1 helix-dap/src/client.rs+1−3 helix-term/Cargo.toml−2 helix-term/src/application.rs+7−8 helix-term/src/commands.rs+1−5
Cargo.lock−1
@@ -390,7 +390,6 @@ dependencies = [
390390 "serde_json",
391391 "signal-hook",
392392 "signal-hook-tokio",
393− "smallvec",
394393 "tokio",
395394 "tokio-stream",
396395 "toml",
helix-dap/src/client.rs+1−3
@@ -225,9 +225,7 @@ impl Client {
225225 }
226226
227227 pub fn capabilities(&self) -> &DebuggerCapabilities {
228− self.caps
229− .as_ref()
230− .expect("debugger not yet initialized!")
228+ self.caps.as_ref().expect("debugger not yet initialized!")
231229 }
232230
233231 pub async fn initialize(&mut self, adapter_id: String) -> Result<()> {
helix-term/Cargo.toml−2
@@ -56,7 +56,5 @@ toml = "0.5"
5656serde_json = "1.0"
5757serde = { version = "1.0", features = ["derive"] }
5858
59−smallvec = "1.4"
60−
6159[target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100
6260signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
helix-term/src/application.rs+7−8
@@ -13,7 +13,6 @@ use crate::{
1313};
1414
1515use log::error;
16−use smallvec::smallvec;
1716use std::{
1817 io::{stdout, Write},
1918 sync::Arc,
@@ -305,20 +304,17 @@ impl Application {
305304 if let Some(helix_dap::StackFrame {
306305 source:
307306 Some(helix_dap::Source {
308− path: Some(src), ..
307+ path: Some(ref src),
308+ ..
309309 }),
310310 line,
311311 column,
312312 end_line,
313313 end_column,
314314 ..
315− }) = &debugger.stack_pointer
315+ }) = debugger.stack_pointer
316316 {
317317 let path = src.clone();
318− let line = *line;
319− let column = *column;
320− let end_line = *end_line;
321− let end_column = *end_column;
322318 self.editor
323319 .open(path, helix_view::editor::Action::Replace)
324320 .unwrap();
@@ -333,7 +329,10 @@ impl Application {
333329 doc.set_selection(
334330 view.id,
335331 Selection::new(
336− smallvec![Range::new(start.min(text_end), end.min(text_end))],
332+ helix_core::SmallVec::from_vec(vec![Range::new(
333+ start.min(text_end),
334+ end.min(text_end),
335+ )]),
337336 0,
338337 ),
339338 );
helix-term/src/commands.rs+1−5
@@ -4422,11 +4422,7 @@ fn dap_start(cx: &mut Context) {
44224422 let request = debugger.initialize(config.name);
44234423 let _ = block_on(request).unwrap();
44244424
4425− let sessions = cx
4426− .editor
4427− .syn_loader
4428− .language_config_for_file_name(&path)
4429− .and_then(|x| x.debug_configs.clone());
4425+ let sessions = doc.language_config().and_then(|x| x.debug_configs.clone());
44304426
44314427 let sessions = match sessions {
44324428 Some(c) => c,