@@ -11,7 +11,7 @@ use helix_core::{
11 coords_at_pos,
11 coords_at_pos,
12 graphemes::{ensure_grapheme_boundary_next, next_grapheme_boundary, prev_grapheme_boundary},
12 graphemes::{ensure_grapheme_boundary_next, next_grapheme_boundary, prev_grapheme_boundary},
13 movement::Direction,
13 movement::Direction,
14− syntax::{self, HighlightEvent},
14+ syntax::{self, DebugConfigCompletion, HighlightEvent},
15 unicode::segmentation::UnicodeSegmentation,
15 unicode::segmentation::UnicodeSegmentation,
16 unicode::width::UnicodeWidthStr,
16 unicode::width::UnicodeWidthStr,
17 LineEnding, Position, Range, Selection,
17 LineEnding, Position, Range, Selection,
@@ -710,28 +710,38 @@ impl EditorView {
712 fn debug_parameter_prompt(
712 fn debug_parameter_prompt(
713− completions: Vec<String>,
713+ completions: Vec<DebugConfigCompletion>,
714 config_name: String,
714 config_name: String,
715 mut params: Vec<String>,
715 mut params: Vec<String>,
716 ) -> Prompt {
716 ) -> Prompt {
717 let i = params.len();
717 let i = params.len();
718− let field_type = completions.get(i).map(|x| x.as_str());
718+ let completion = completions.get(i).unwrap();
719+ let field_type = if let DebugConfigCompletion::Advanced(cfg) = completion {
720+ cfg.completion.clone().unwrap_or_else(|| "".to_owned())
724+ let name = match completion {
725+ DebugConfigCompletion::Advanced(cfg) => {
726+ cfg.name.clone().unwrap_or_else(|| field_type.to_owned())
728+ DebugConfigCompletion::Named(name) => name.clone(),
730+ let default_val = match completion {
731+ DebugConfigCompletion::Advanced(cfg) => {
732+ cfg.default.clone().unwrap_or_else(|| "".to_owned())
720 let noop = |_input: &str| Vec::new();
737 let noop = |_input: &str| Vec::new();
721− let completer = match field_type {
738+ let completer = match &field_type[..] {
722− Some(field_type) => {
723− if field_type.starts_with("filename") {
724− super::completers::filename
739+ "filename" => super::completers::filename,
725− } else if field_type.starts_with("directory") {
726− super::completers::directory
740+ "directory" => super::completers::directory,
731− None => noop,
741+ _ => noop,
733 Prompt::new(
743 Prompt::new(
734− format!("{}: ", field_type.unwrap_or("arg")),
744+ format!("{}: ", name),
736 completer,
746 completer,
737 move |cx: &mut crate::compositor::Context, input: &str, event: PromptEvent| {
747 move |cx: &mut crate::compositor::Context, input: &str, event: PromptEvent| {
@@ -739,7 +749,11 @@ impl EditorView {
742− params.push(input.to_owned());
752+ let mut value = input.to_owned();
753+ if value.is_empty() {
754+ value = default_val.clone();
744 if params.len() < completions.len() {
758 if params.len() < completions.len() {
745 let completions = completions.clone();
759 let completions = completions.clone();