on master help sign in
Resolve a couple TODOs
commitf0eb6ed96a6e61ee6abe3aa14071cfc003d0b37f authorBlaž Hrastnik <blaz@mxxn.io> dateSun 8 Aug 2021, 13:50 (5 years ago) parentdbd853a
3 files changed+5−18
helix-term/src/commands.rs+2−13 helix-term/src/keymap.rs+1−2 helix-view/src/document.rs+2−3
helix-term/src/commands.rs+2−13
@@ -480,10 +480,6 @@ fn goto_window_bottom(cx: &mut Context) {
480480 goto_window(cx, Align::Bottom)
481481}
482482
483−// TODO: move vs extend could take an extra type Extend/Move that would
484−// Range::new(if Move { pos } if Extend { range.anchor }, pos)
485−// since these all really do the same thing
486−
487483fn move_next_word_start(cx: &mut Context) {
488484 let count = cx.count();
489485 let (view, doc) = current!(cx.editor);
@@ -2320,7 +2316,7 @@ fn apply_workspace_edit(
23202316}
23212317
23222318fn last_picker(cx: &mut Context) {
2323− // TODO: last picker does not seemed to work well with buffer_picker
2319+ // TODO: last picker does not seem to work well with buffer_picker
23242320 cx.callback = Some(Box::new(|compositor: &mut Compositor| {
23252321 if let Some(picker) = compositor.last_picker.take() {
23262322 compositor.push(picker);
@@ -2653,7 +2649,6 @@ fn goto_definition(cx: &mut Context) {
26532649 offset_encoding,
26542650 );
26552651
2656− // TODO: handle fails
26572652 let future = language_server.goto_definition(doc.identifier(), pos, None);
26582653
26592654 cx.callback(
@@ -2696,7 +2691,6 @@ fn goto_type_definition(cx: &mut Context) {
26962691 offset_encoding,
26972692 );
26982693
2699− // TODO: handle fails
27002694 let future = language_server.goto_type_definition(doc.identifier(), pos, None);
27012695
27022696 cx.callback(
@@ -2739,7 +2733,6 @@ fn goto_implementation(cx: &mut Context) {
27392733 offset_encoding,
27402734 );
27412735
2742− // TODO: handle fails
27432736 let future = language_server.goto_implementation(doc.identifier(), pos, None);
27442737
27452738 cx.callback(
@@ -2782,7 +2775,6 @@ fn goto_reference(cx: &mut Context) {
27822775 offset_encoding,
27832776 );
27842777
2785− // TODO: handle fails
27862778 let future = language_server.goto_reference(doc.identifier(), pos, None);
27872779
27882780 cx.callback(
@@ -2900,7 +2892,6 @@ fn signature_help(cx: &mut Context) {
29002892 language_server.offset_encoding(),
29012893 );
29022894
2903− // TODO: handle fails
29042895 let future = language_server.text_document_signature_help(doc.identifier(), pos, None);
29052896
29062897 cx.callback(
@@ -3646,7 +3637,6 @@ fn completion(cx: &mut Context) {
36463637
36473638 let pos = pos_to_lsp_pos(doc.text(), cursor, offset_encoding);
36483639
3649− // TODO: handle fails
36503640 let future = language_server.completion(doc.identifier(), pos, None);
36513641
36523642 let trigger_offset = cursor;
@@ -3672,8 +3662,8 @@ fn completion(cx: &mut Context) {
36723662 None => Vec::new(),
36733663 };
36743664
3675− // TODO: if no completion, show some message or something
36763665 if items.is_empty() {
3666+ editor.set_error("No completion available".to_string());
36773667 return;
36783668 }
36793669 let size = compositor.size();
@@ -3705,7 +3695,6 @@ fn hover(cx: &mut Context) {
37053695 language_server.offset_encoding(),
37063696 );
37073697
3708− // TODO: handle fails
37093698 let future = language_server.text_document_hover(doc.identifier(), pos, None);
37103699
37113700 cx.callback(
helix-term/src/keymap.rs+1−2
@@ -475,8 +475,7 @@ impl Default for Keymaps {
475475
476476 // z family for save/restore/combine from/to sels from register
477477
478− // supposedly "C-i" but did not work
479− "tab" => jump_forward,
478+ "tab" => jump_forward, // tab == <C-i>
480479 "C-o" => jump_backward,
481480 // "C-s" => save_selection,
482481
helix-view/src/document.rs+2−3
@@ -520,13 +520,12 @@ impl Document {
520520 // state without blocking any further edits.
521521
522522 let mut text = self.text().clone();
523− let path = self.path.clone().expect("Can't save with no path set!"); // TODO: handle no path
523+ let path = self.path.clone().expect("Can't save with no path set!");
524524 let identifier = self.identifier();
525525
526− // TODO: mark changes up to now as saved
527−
528526 let language_server = self.language_server.clone();
529527
528+ // mark changes up to now as saved
530529 self.reset_modified();
531530
532531 let encoding = self.encoding;