Add caching of parsed completion documentation markdown to reduce flicker when selecting (#31546)

Related to #31460 and #28635.

Release Notes:

- Fixed redraw delay of documentation from language server completions
and added caching to reduce flicker when using arrow keys to change
selection.
This commit is contained in:
Michael Sloan 2025-05-27 17:12:38 -06:00 committed by GitHub
parent 31d908fc74
commit 506beafe10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 300 additions and 95 deletions

View file

@ -67,14 +67,8 @@ struct MarkdownExample {
impl MarkdownExample {
pub fn new(text: SharedString, language_registry: Arc<LanguageRegistry>, cx: &mut App) -> Self {
let markdown = cx.new(|cx| {
Markdown::new(
text,
Some(language_registry),
Some("TypeScript".to_string()),
cx,
)
});
let markdown = cx
.new(|cx| Markdown::new(text, Some(language_registry), Some("TypeScript".into()), cx));
Self { markdown }
}
}