Fix rendering issue with vtsls (#15087)
Before: <img width="697" alt="Screenshot_2024-07-20_at_20 47 41" src="https://github.com/user-attachments/assets/bc6db18e-77b9-400b-a917-2545269b7d1b"> After: <img width="707" alt="Screenshot_2024-07-23_at_22 09 27" src="https://github.com/user-attachments/assets/a0f6ebe5-fba0-4cc1-8d8b-b1982e2adf95"> Release Notes: - Fixed multiline details provided by vtsls breaking rendering in autocompletions
This commit is contained in:
parent
64b15d3a0e
commit
06d3dc010c
1 changed files with 4 additions and 2 deletions
|
@ -153,14 +153,16 @@ impl LspAdapter for VtslsLspAdapter {
|
||||||
_ => None,
|
_ => None,
|
||||||
}?;
|
}?;
|
||||||
|
|
||||||
|
let one_line = |s: &str| s.replace(" ", "").replace('\n', " ");
|
||||||
|
|
||||||
let text = if let Some(description) = item
|
let text = if let Some(description) = item
|
||||||
.label_details
|
.label_details
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|label_details| label_details.description.as_ref())
|
.and_then(|label_details| label_details.description.as_ref())
|
||||||
{
|
{
|
||||||
format!("{} {}", item.label, description)
|
format!("{} {}", item.label, one_line(description))
|
||||||
} else if let Some(detail) = &item.detail {
|
} else if let Some(detail) = &item.detail {
|
||||||
format!("{} {}", item.label, detail)
|
format!("{} {}", item.label, one_line(detail))
|
||||||
} else {
|
} else {
|
||||||
item.label.clone()
|
item.label.clone()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue