completions: do not render empty multi-line documentation (#7279)
I ran into this a lot with Go code: the documentation would be empty so we'd display a big box with nothing in it. I think it's better if we only display the box if we have documentation. Release Notes: - Fixed documentation box in showing up when using auto-complete even if documentation was empty. ## Before  ## After 
This commit is contained in:
parent
ec9f44727e
commit
01ddf840f5
1 changed files with 9 additions and 3 deletions
|
@ -857,9 +857,15 @@ impl CompletionsMenu {
|
|||
Some(Documentation::MultiLinePlainText(text)) => {
|
||||
Some(div().child(SharedString::from(text.clone())))
|
||||
}
|
||||
Some(Documentation::MultiLineMarkdown(parsed)) => Some(div().child(
|
||||
render_parsed_markdown("completions_markdown", parsed, &style, workspace, cx),
|
||||
)),
|
||||
Some(Documentation::MultiLineMarkdown(parsed)) if !parsed.text.is_empty() => {
|
||||
Some(div().child(render_parsed_markdown(
|
||||
"completions_markdown",
|
||||
parsed,
|
||||
&style,
|
||||
workspace,
|
||||
cx,
|
||||
)))
|
||||
}
|
||||
_ => None,
|
||||
};
|
||||
multiline_docs.map(|div| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue