on master help sign in
refactor
34c6094Dmitry Sharshakov
Cargo.lock−1
@@ -390,7 +390,6 @@ dependencies = [
390 "serde_json",
390 "serde_json",
391 "signal-hook",
391 "signal-hook",
392 "signal-hook-tokio",
392 "signal-hook-tokio",
393− "smallvec",
394 "tokio",
393 "tokio",
395 "tokio-stream",
394 "tokio-stream",
396 "toml",
395 "toml",
helix-dap/src/client.rs+1−3
@@ -225,9 +225,7 @@ impl Client {
225 }
225 }
226
226
227 pub fn capabilities(&self) -> &DebuggerCapabilities {
227 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!")
231 }
229 }
232
230
233 pub async fn initialize(&mut self, adapter_id: String) -> Result<()> {
231 pub async fn initialize(&mut self, adapter_id: String) -> Result<()> {
helix-term/Cargo.toml−2
@@ -56,7 +56,5 @@ toml = "0.5"
56serde_json = "1.0"
56serde_json = "1.0"
57serde = { version = "1.0", features = ["derive"] }
57serde = { version = "1.0", features = ["derive"] }
58
58
59−smallvec = "1.4"
60−
61[target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100
59[target.'cfg(not(windows))'.dependencies] # https://github.com/vorner/signal-hook/issues/100
62signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
60signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
helix-term/src/application.rs+7−8
@@ -13,7 +13,6 @@ use crate::{
13};
13};
14
14
15use log::error;
15use log::error;
16−use smallvec::smallvec;
17use std::{
16use std::{
18 io::{stdout, Write},
17 io::{stdout, Write},
19 sync::Arc,
18 sync::Arc,
@@ -305,20 +304,17 @@ impl Application {
305 if let Some(helix_dap::StackFrame {
304 if let Some(helix_dap::StackFrame {
306 source:
305 source:
307 Some(helix_dap::Source {
306 Some(helix_dap::Source {
308− path: Some(src), ..
307+ path: Some(ref src),
308+ ..
309 }),
309 }),
310 line,
310 line,
311 column,
311 column,
312 end_line,
312 end_line,
313 end_column,
313 end_column,
314 ..
314 ..
315− }) = &debugger.stack_pointer
315+ }) = debugger.stack_pointer
316 {
316 {
317 let path = src.clone();
317 let path = src.clone();
318− let line = *line;
319− let column = *column;
320− let end_line = *end_line;
321− let end_column = *end_column;
322 self.editor
318 self.editor
323 .open(path, helix_view::editor::Action::Replace)
319 .open(path, helix_view::editor::Action::Replace)
324 .unwrap();
320 .unwrap();
@@ -333,7 +329,10 @@ impl Application {
333 doc.set_selection(
329 doc.set_selection(
334 view.id,
330 view.id,
335 Selection::new(
331 Selection::new(
332+ helix_core::SmallVec::from_vec(vec![Range::new(
336− smallvec![Range::new(start.min(text_end), end.min(text_end))],
333+ start.min(text_end),
334+ end.min(text_end),
335+ )]),
337 0,
336 0,
338 ),
337 ),
339 );
338 );
helix-term/src/commands.rs+1−5
@@ -4422,11 +4422,7 @@ fn dap_start(cx: &mut Context) {
4422 let request = debugger.initialize(config.name);
4422 let request = debugger.initialize(config.name);
4423 let _ = block_on(request).unwrap();
4423 let _ = block_on(request).unwrap();
4424
4424
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());
4430
4426
4431 let sessions = match sessions {
4427 let sessions = match sessions {
4432 Some(c) => c,
4428 Some(c) => c,