editor: Make parse_blocks synchronous since it has no await points (#54756)

Release Notes:

- N/A

Signed-off-by: Xiaobo Liu <cppcoffee@gmail.com>
This commit is contained in:
Xiaobo Liu authored and GitHub committed 2026-04-24 10:40:20 +00:00
1 parent b9a60d802d
commit a2598f7fd8
1 file changed
+4 -6
+4 -6
View File
@@ -205,8 +205,7 @@ pub fn hover_at_inlay(
let language_registry = project.read_with(cx, |p, _| p.languages().clone());
let blocks = vec![inlay_hover.tooltip];
let parsed_content =
parse_blocks(&blocks, Some(&language_registry), None, cx).await;
let parsed_content = parse_blocks(&blocks, Some(&language_registry), None, cx);
let scroll_handle = ScrollHandle::new();
@@ -494,8 +493,7 @@ fn show_hover(
text: format!("Unicode character U+{:02X}", invisible as u32),
kind: HoverBlockKind::PlainText,
}];
let parsed_content =
parse_blocks(&blocks, language_registry.as_ref(), None, cx).await;
let parsed_content = parse_blocks(&blocks, language_registry.as_ref(), None, cx);
let scroll_handle = ScrollHandle::new();
let subscription = this
.update(cx, |_, cx| {
@@ -536,7 +534,7 @@ fn show_hover(
let blocks = hover_result.contents;
let language = hover_result.language;
let parsed_content =
parse_blocks(&blocks, language_registry.as_ref(), language, cx).await;
parse_blocks(&blocks, language_registry.as_ref(), language, cx);
let scroll_handle = ScrollHandle::new();
hover_highlights.push(range.clone());
let subscription = this
@@ -623,7 +621,7 @@ fn same_diagnostic_hover(editor: &Editor, snapshot: &EditorSnapshot, anchor: Anc
.unwrap_or(false)
}
async fn parse_blocks(
fn parse_blocks(
blocks: &[HoverBlock],
language_registry: Option<&Arc<LanguageRegistry>>,
language: Option<Arc<Language>>,