mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
feat: make star import tooltip more human readable (#682)
This commit is contained in:
parent
c17e0c787e
commit
190b7dfd45
1 changed files with 2 additions and 12 deletions
|
@ -196,19 +196,9 @@ fn star_tooltip(
|
|||
|
||||
let mut names = scope.iter().map(|(name, _)| name).collect::<Vec<_>>();
|
||||
names.sort();
|
||||
let mut items = String::new();
|
||||
items.push_str("let (");
|
||||
for name in &names {
|
||||
items.push_str(name);
|
||||
items.push_str(", ");
|
||||
}
|
||||
items.push_str(") = ..");
|
||||
|
||||
results.push(MarkedString::LanguageString(LanguageString {
|
||||
language: "typc".to_owned(),
|
||||
value: items,
|
||||
}));
|
||||
let items = typst::foundations::repr::separated_list(&names, "and");
|
||||
|
||||
results.push(MarkedString::String(format!("This star imports {items}")));
|
||||
Some(LspHoverContents::Array(results))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue