mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
fix: Don't emit empty inlay hint parts
This commit is contained in:
parent
77e1969c15
commit
0bb7a8e28b
4 changed files with 24 additions and 38 deletions
|
@ -577,11 +577,14 @@ impl HirWrite for InlayHintLabelBuilder<'_> {
|
|||
|
||||
impl InlayHintLabelBuilder<'_> {
|
||||
fn make_new_part(&mut self) {
|
||||
self.result.parts.push(InlayHintLabelPart {
|
||||
text: take(&mut self.last_part),
|
||||
linked_location: self.location.take(),
|
||||
tooltip: None,
|
||||
});
|
||||
let text = take(&mut self.last_part);
|
||||
if !text.is_empty() {
|
||||
self.result.parts.push(InlayHintLabelPart {
|
||||
text,
|
||||
linked_location: self.location.take(),
|
||||
tooltip: None,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
fn finish(mut self) -> InlayHintLabel {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue