Run slash commands both on enter and on argument completion that requires it (#16283)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov
2024-08-15 19:36:30 +03:00
committed by GitHub
parent 5a30e29848
commit c45adce2e3
9 changed files with 61 additions and 34 deletions
+4 -5
View File
@@ -450,9 +450,10 @@ pub struct Completion {
/// The raw completion provided by the language server.
pub lsp_completion: lsp::CompletionItem,
/// An optional callback to invoke when this completion is confirmed.
pub confirm: Option<Arc<dyn Send + Sync + Fn(CompletionIntent, &mut WindowContext)>>,
/// If true, the editor will show a new completion menu after this completion is confirmed.
pub show_new_completions_on_confirm: bool,
/// Returns, whether new completions should be retriggered after the current one.
/// If `true` is returned, the editor will show a new completion menu after this completion is confirmed.
/// if no confirmation is provided or `false` is returned, the completion will be committed.
pub confirm: Option<Arc<dyn Send + Sync + Fn(CompletionIntent, &mut WindowContext) -> bool>>,
}
impl std::fmt::Debug for Completion {
@@ -9128,7 +9129,6 @@ impl Project {
filter_range: Default::default(),
},
confirm: None,
show_new_completions_on_confirm: false,
},
false,
cx,
@@ -10765,7 +10765,6 @@ async fn populate_labels_for_completions(
documentation,
lsp_completion,
confirm: None,
show_new_completions_on_confirm: false,
})
}
}