mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 13:13:43 +00:00
feat: trigger parameter hints instead of suggest on pos args (#243)
* dev: disable aggressive positional arguments completion * feat: trigger parameter hints instead of suggest on pos args * dev: update snapshot
This commit is contained in:
parent
64c8be64d3
commit
d8c3a97f24
5 changed files with 17 additions and 16 deletions
|
@ -1029,7 +1029,9 @@ impl<'a, 'w> CompletionContext<'a, 'w> {
|
|||
// command on a suggestion to "manually" retrigger suggest after inserting one
|
||||
//
|
||||
// todo: only vscode and neovim (0.9.1) support this
|
||||
command: Some("editor.action.triggerSuggest"),
|
||||
command: snippet
|
||||
.contains("${")
|
||||
.then_some("editor.action.triggerSuggest"),
|
||||
..Completion::default()
|
||||
});
|
||||
}
|
||||
|
@ -1181,7 +1183,7 @@ impl<'a, 'w> CompletionContext<'a, 'w> {
|
|||
let mut command = None;
|
||||
if parens && matches!(value, Value::Func(_)) {
|
||||
if let Value::Func(func) = value {
|
||||
command = Some("editor.action.triggerSuggest");
|
||||
command = Some("editor.action.triggerParameterHints");
|
||||
if func
|
||||
.params()
|
||||
.is_some_and(|params| params.iter().all(|param| param.name == "self"))
|
||||
|
|
|
@ -313,7 +313,7 @@ impl<'a, 'w> CompletionContext<'a, 'w> {
|
|||
kind: kind.clone(),
|
||||
label_detail: ty_detail,
|
||||
// todo: only vscode and neovim (0.9.1) support this
|
||||
command: Some("editor.action.triggerSuggest"),
|
||||
command: Some("editor.action.triggerParameterHints"),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
@ -641,13 +641,7 @@ pub fn param_completions<'a>(
|
|||
apply: Some(eco_format!("{}: ${{}}", param.name)),
|
||||
detail: Some(plain_docs_sentence(¶m.docs)),
|
||||
label_detail: None,
|
||||
// todo: only vscode and neovim (0.9.1) support this
|
||||
//
|
||||
// VS Code doesn't do that... Auto triggering suggestion only happens on typing
|
||||
// (word starts or trigger characters). However, you can use
|
||||
// editor.action.triggerSuggest as command on a suggestion to
|
||||
// "manually" retrigger suggest after inserting one
|
||||
command: Some("editor.action.triggerSuggest"),
|
||||
command: Some("tinymist.triggerNamedCompletion"),
|
||||
..Completion::default()
|
||||
};
|
||||
match param.infer_type {
|
||||
|
@ -742,8 +736,7 @@ fn type_completion(
|
|||
label: f.clone(),
|
||||
apply: Some(eco_format!("{}: ${{}}", f)),
|
||||
detail: docs.map(Into::into),
|
||||
// todo: only vscode and neovim (0.9.1) support this
|
||||
command: Some("editor.action.triggerSuggest"),
|
||||
command: Some("tinymist.triggerNamedCompletion"),
|
||||
..Completion::default()
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue