mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 21:31:32 +00:00
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:
parent
adab7b8871
commit
93e9bef8a5
1 changed files with 4 additions and 6 deletions
|
|
@ -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>>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue