|
|
@ -411,7 +411,7 @@ impl Component for Completion {
|
|
|
|
"```{}\n{}\n```\n{}",
|
|
|
|
"```{}\n{}\n```\n{}",
|
|
|
|
language,
|
|
|
|
language,
|
|
|
|
option.detail.as_deref().unwrap_or_default(),
|
|
|
|
option.detail.as_deref().unwrap_or_default(),
|
|
|
|
contents.clone()
|
|
|
|
contents
|
|
|
|
),
|
|
|
|
),
|
|
|
|
cx.editor.syn_loader.clone(),
|
|
|
|
cx.editor.syn_loader.clone(),
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -421,15 +421,14 @@ impl Component for Completion {
|
|
|
|
value: contents,
|
|
|
|
value: contents,
|
|
|
|
})) => {
|
|
|
|
})) => {
|
|
|
|
// TODO: set language based on doc scope
|
|
|
|
// TODO: set language based on doc scope
|
|
|
|
Markdown::new(
|
|
|
|
if let Some(detail) = &option.detail.as_deref() {
|
|
|
|
format!(
|
|
|
|
Markdown::new(
|
|
|
|
"```{}\n{}\n```\n{}",
|
|
|
|
format!("```{}\n{}\n```\n{}", language, detail, contents),
|
|
|
|
language,
|
|
|
|
cx.editor.syn_loader.clone(),
|
|
|
|
option.detail.as_deref().unwrap_or_default(),
|
|
|
|
)
|
|
|
|
contents.clone()
|
|
|
|
} else {
|
|
|
|
),
|
|
|
|
Markdown::new(contents.to_string(), cx.editor.syn_loader.clone())
|
|
|
|
cx.editor.syn_loader.clone(),
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
None if option.detail.is_some() => {
|
|
|
|
None if option.detail.is_some() => {
|
|
|
|
// TODO: copied from above
|
|
|
|
// TODO: copied from above
|
|
|
|