editor: Limit target names in hover links multibuffer titles (#36207)

Lukas Wirth created

Release Notes:

- N/A

Change summary

crates/editor/src/editor.rs | 4 ++++
1 file changed, 4 insertions(+)

Detailed changes

crates/editor/src/editor.rs 🔗

@@ -15879,6 +15879,8 @@ impl Editor {
                                     .text_for_range(location.range.clone())
                                     .collect::<String>()
                             })
+                            .unique()
+                            .take(3)
                             .join(", ");
                         format!("{tab_kind} for {target}")
                     })
@@ -16085,6 +16087,8 @@ impl Editor {
                             .text_for_range(location.range.clone())
                             .collect::<String>()
                     })
+                    .unique()
+                    .take(3)
                     .join(", ");
                 let title = format!("References to {target}");
                 Self::open_locations_in_multibuffer(