Improve error message for AcceptEditPredictions
- add docs link (#24772)
The docs have not been updated yet, this is anticipating their presence soon.  Release Notes: - N/A
This commit is contained in:
parent
7ba1492f0a
commit
a13c2baa7f
1 changed files with 13 additions and 8 deletions
|
@ -5857,18 +5857,23 @@ impl KeyBindingValidator for AcceptEditPredictionsBindingValidator {
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
let negated_requires_modifier_key_context = MarkdownString::inline_code(&format!(
|
||||||
|
"!{}",
|
||||||
|
EDIT_PREDICTION_REQUIRES_MODIFIER_KEY_CONTEXT
|
||||||
|
));
|
||||||
Err(MarkdownString(format!(
|
Err(MarkdownString(format!(
|
||||||
"{} can only be bound to a single keystroke with modifiers, so \
|
"{} can only be bound to a single keystroke with modifiers, so \
|
||||||
that holding down these modifiers can be used to preview \
|
that pressing these modifiers can be used for prediction \
|
||||||
completions inline when the completions menu is open.\n\n\
|
preview.\n\n\
|
||||||
This restriction does not apply when the context requires {}, \
|
This restriction does not apply when the context requires {}, \
|
||||||
since these bindings will not be used when the completions menu \
|
since these bindings are not used for prediction preview. For \
|
||||||
is open.",
|
example, in the default keymap `tab` requires {}, and `alt-tab` \
|
||||||
|
is used otherwise.\n\n\
|
||||||
|
See [the documentation]({}) for more details.",
|
||||||
MarkdownString::inline_code(AcceptEditPrediction.name()),
|
MarkdownString::inline_code(AcceptEditPrediction.name()),
|
||||||
MarkdownString::inline_code(&format!(
|
negated_requires_modifier_key_context.clone(),
|
||||||
"!{}",
|
negated_requires_modifier_key_context,
|
||||||
EDIT_PREDICTION_REQUIRES_MODIFIER_KEY_CONTEXT
|
"https://zed.dev/docs/completions#edit-predictions",
|
||||||
)),
|
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue