mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-19 21:47:07 +04:00
Resolve a couple TODOs
This commit is contained in:
parent
dbd853a082
commit
f0eb6ed96a
@ -480,10 +480,6 @@ fn goto_window_bottom(cx: &mut Context) {
|
|||||||
goto_window(cx, Align::Bottom)
|
goto_window(cx, Align::Bottom)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: move vs extend could take an extra type Extend/Move that would
|
|
||||||
// Range::new(if Move { pos } if Extend { range.anchor }, pos)
|
|
||||||
// since these all really do the same thing
|
|
||||||
|
|
||||||
fn move_next_word_start(cx: &mut Context) {
|
fn move_next_word_start(cx: &mut Context) {
|
||||||
let count = cx.count();
|
let count = cx.count();
|
||||||
let (view, doc) = current!(cx.editor);
|
let (view, doc) = current!(cx.editor);
|
||||||
@ -2320,7 +2316,7 @@ fn apply_workspace_edit(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn last_picker(cx: &mut Context) {
|
fn last_picker(cx: &mut Context) {
|
||||||
// TODO: last picker does not seemed to work well with buffer_picker
|
// TODO: last picker does not seem to work well with buffer_picker
|
||||||
cx.callback = Some(Box::new(|compositor: &mut Compositor| {
|
cx.callback = Some(Box::new(|compositor: &mut Compositor| {
|
||||||
if let Some(picker) = compositor.last_picker.take() {
|
if let Some(picker) = compositor.last_picker.take() {
|
||||||
compositor.push(picker);
|
compositor.push(picker);
|
||||||
@ -2653,7 +2649,6 @@ fn goto_definition(cx: &mut Context) {
|
|||||||
offset_encoding,
|
offset_encoding,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: handle fails
|
|
||||||
let future = language_server.goto_definition(doc.identifier(), pos, None);
|
let future = language_server.goto_definition(doc.identifier(), pos, None);
|
||||||
|
|
||||||
cx.callback(
|
cx.callback(
|
||||||
@ -2696,7 +2691,6 @@ fn goto_type_definition(cx: &mut Context) {
|
|||||||
offset_encoding,
|
offset_encoding,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: handle fails
|
|
||||||
let future = language_server.goto_type_definition(doc.identifier(), pos, None);
|
let future = language_server.goto_type_definition(doc.identifier(), pos, None);
|
||||||
|
|
||||||
cx.callback(
|
cx.callback(
|
||||||
@ -2739,7 +2733,6 @@ fn goto_implementation(cx: &mut Context) {
|
|||||||
offset_encoding,
|
offset_encoding,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: handle fails
|
|
||||||
let future = language_server.goto_implementation(doc.identifier(), pos, None);
|
let future = language_server.goto_implementation(doc.identifier(), pos, None);
|
||||||
|
|
||||||
cx.callback(
|
cx.callback(
|
||||||
@ -2782,7 +2775,6 @@ fn goto_reference(cx: &mut Context) {
|
|||||||
offset_encoding,
|
offset_encoding,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: handle fails
|
|
||||||
let future = language_server.goto_reference(doc.identifier(), pos, None);
|
let future = language_server.goto_reference(doc.identifier(), pos, None);
|
||||||
|
|
||||||
cx.callback(
|
cx.callback(
|
||||||
@ -2900,7 +2892,6 @@ fn signature_help(cx: &mut Context) {
|
|||||||
language_server.offset_encoding(),
|
language_server.offset_encoding(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: handle fails
|
|
||||||
let future = language_server.text_document_signature_help(doc.identifier(), pos, None);
|
let future = language_server.text_document_signature_help(doc.identifier(), pos, None);
|
||||||
|
|
||||||
cx.callback(
|
cx.callback(
|
||||||
@ -3646,7 +3637,6 @@ fn completion(cx: &mut Context) {
|
|||||||
|
|
||||||
let pos = pos_to_lsp_pos(doc.text(), cursor, offset_encoding);
|
let pos = pos_to_lsp_pos(doc.text(), cursor, offset_encoding);
|
||||||
|
|
||||||
// TODO: handle fails
|
|
||||||
let future = language_server.completion(doc.identifier(), pos, None);
|
let future = language_server.completion(doc.identifier(), pos, None);
|
||||||
|
|
||||||
let trigger_offset = cursor;
|
let trigger_offset = cursor;
|
||||||
@ -3672,8 +3662,8 @@ fn completion(cx: &mut Context) {
|
|||||||
None => Vec::new(),
|
None => Vec::new(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: if no completion, show some message or something
|
|
||||||
if items.is_empty() {
|
if items.is_empty() {
|
||||||
|
editor.set_error("No completion available".to_string());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let size = compositor.size();
|
let size = compositor.size();
|
||||||
@ -3705,7 +3695,6 @@ fn hover(cx: &mut Context) {
|
|||||||
language_server.offset_encoding(),
|
language_server.offset_encoding(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: handle fails
|
|
||||||
let future = language_server.text_document_hover(doc.identifier(), pos, None);
|
let future = language_server.text_document_hover(doc.identifier(), pos, None);
|
||||||
|
|
||||||
cx.callback(
|
cx.callback(
|
||||||
|
@ -475,8 +475,7 @@ fn default() -> Keymaps {
|
|||||||
|
|
||||||
// z family for save/restore/combine from/to sels from register
|
// z family for save/restore/combine from/to sels from register
|
||||||
|
|
||||||
// supposedly "C-i" but did not work
|
"tab" => jump_forward, // tab == <C-i>
|
||||||
"tab" => jump_forward,
|
|
||||||
"C-o" => jump_backward,
|
"C-o" => jump_backward,
|
||||||
// "C-s" => save_selection,
|
// "C-s" => save_selection,
|
||||||
|
|
||||||
|
@ -520,13 +520,12 @@ fn save_impl<F: Future<Output = LspFormatting>>(
|
|||||||
// state without blocking any further edits.
|
// state without blocking any further edits.
|
||||||
|
|
||||||
let mut text = self.text().clone();
|
let mut text = self.text().clone();
|
||||||
let path = self.path.clone().expect("Can't save with no path set!"); // TODO: handle no path
|
let path = self.path.clone().expect("Can't save with no path set!");
|
||||||
let identifier = self.identifier();
|
let identifier = self.identifier();
|
||||||
|
|
||||||
// TODO: mark changes up to now as saved
|
|
||||||
|
|
||||||
let language_server = self.language_server.clone();
|
let language_server = self.language_server.clone();
|
||||||
|
|
||||||
|
// mark changes up to now as saved
|
||||||
self.reset_modified();
|
self.reset_modified();
|
||||||
|
|
||||||
let encoding = self.encoding;
|
let encoding = self.encoding;
|
||||||
|
Loading…
Reference in New Issue
Block a user