aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorGokul Soumya2023-06-18 17:27:11 +0000
committerMichael Davis2023-06-18 17:28:26 +0000
commitf18acadbd0d7b15bc314fc3ede99f4546b72d76d (patch)
tree1413d7f13ac317a41e6e520d2af31cfa7e2a9631 /helix-term/src/commands
parent545acfda8884c890b78e586c86e4f7c5f9a15477 (diff)
Completely remove old Picker and rename FilePicker to Picker
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/dap.rs6
-rw-r--r--helix-term/src/commands/lsp.rs14
2 files changed, 10 insertions, 10 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index 2684e946..70a5ec21 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -2,7 +2,7 @@ use super::{Context, Editor};
use crate::{
compositor::{self, Compositor},
job::{Callback, Jobs},
- ui::{self, overlay::overlaid, FilePicker, Picker, Popup, Prompt, PromptEvent, Text},
+ ui::{self, overlay::overlaid, Picker, Popup, Prompt, PromptEvent, Text},
};
use dap::{StackFrame, Thread, ThreadStates};
use helix_core::syntax::{DebugArgumentValue, DebugConfigCompletion, DebugTemplate};
@@ -73,7 +73,7 @@ fn thread_picker(
let debugger = debugger!(editor);
let thread_states = debugger.thread_states.clone();
- let picker = FilePicker::new(threads, thread_states, move |cx, thread, _action| {
+ let picker = Picker::new(threads, thread_states, move |cx, thread, _action| {
callback_fn(cx.editor, thread)
})
.with_preview(move |editor, thread| {
@@ -726,7 +726,7 @@ pub fn dap_switch_stack_frame(cx: &mut Context) {
let frames = debugger.stack_frames[&thread_id].clone();
- let picker = FilePicker::new(frames, (), move |cx, frame, _action| {
+ let picker = Picker::new(frames, (), move |cx, frame, _action| {
let debugger = debugger!(cx.editor);
// TODO: this should be simpler to find
let pos = debugger.stack_frames[&thread_id]
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index 7cc2eaf8..55153648 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -31,8 +31,8 @@ use crate::{
compositor::{self, Compositor},
job::Callback,
ui::{
- self, lsp::SignatureHelp, overlay::overlaid, DynamicPicker, FileLocation, FilePicker,
- Popup, PromptEvent,
+ self, lsp::SignatureHelp, overlay::overlaid, DynamicPicker, FileLocation, Picker, Popup,
+ PromptEvent,
},
};
@@ -236,11 +236,11 @@ fn jump_to_location(
align_view(doc, view, Align::Center);
}
-type SymbolPicker = FilePicker<SymbolInformationItem>;
+type SymbolPicker = Picker<SymbolInformationItem>;
fn sym_picker(symbols: Vec<SymbolInformationItem>, current_path: Option<lsp::Url>) -> SymbolPicker {
// TODO: drop current_path comparison and instead use workspace: bool flag?
- FilePicker::new(symbols, current_path.clone(), move |cx, item, action| {
+ Picker::new(symbols, current_path.clone(), move |cx, item, action| {
let (view, doc) = current!(cx.editor);
push_jump(view, doc);
@@ -288,7 +288,7 @@ fn diag_picker(
diagnostics: BTreeMap<lsp::Url, Vec<(lsp::Diagnostic, usize)>>,
current_path: Option<lsp::Url>,
format: DiagnosticsFormat,
-) -> FilePicker<PickerDiagnostic> {
+) -> Picker<PickerDiagnostic> {
// TODO: drop current_path comparison and instead use workspace: bool flag?
// flatten the map to a vec of (url, diag) pairs
@@ -314,7 +314,7 @@ fn diag_picker(
error: cx.editor.theme.get("error"),
};
- FilePicker::new(
+ Picker::new(
flat_diag,
(styles, format),
move |cx,
@@ -1043,7 +1043,7 @@ fn goto_impl(
editor.set_error("No definition found.");
}
_locations => {
- let picker = FilePicker::new(locations, cwdir, move |cx, location, action| {
+ let picker = Picker::new(locations, cwdir, move |cx, location, action| {
jump_to_location(cx.editor, location, offset_encoding, action)
})
.with_preview(move |_editor, location| Some(location_to_file_location(location)));