Revert "file_finder: Remove common segments of long paths in search results (#25049)" (#25163)

This reverts commit 9ef0501853 due to a
panic.

```
{
  "thread": "main",
  "payload": "9 is not a valid char boundary in path \"crates/…/LiveKitBridge/\"",
  "location_data": {
    "file": "crates/file_finder/src/file_finder.rs",
    "line": 646
  }
}
```

Release Notes:

- N/A
This commit is contained in:
Cole Miller 2025-02-19 10:32:29 -05:00 committed by GitHub
parent f8770fee10
commit c0c48d30db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 157 additions and 207 deletions

View file

@ -384,7 +384,6 @@ async fn test_matching_cancellation(cx: &mut TestAppContext) {
ProjectPanelOrdMatch(matches[1].clone()),
ProjectPanelOrdMatch(matches[3].clone()),
],
window,
cx,
);
@ -399,7 +398,6 @@ async fn test_matching_cancellation(cx: &mut TestAppContext) {
ProjectPanelOrdMatch(matches[2].clone()),
ProjectPanelOrdMatch(matches[3].clone()),
],
window,
cx,
);
@ -494,11 +492,12 @@ async fn test_single_file_worktrees(cx: &mut TestAppContext) {
let matches = collect_search_matches(picker).search_matches_only();
assert_eq!(matches.len(), 1);
let labels = delegate.labels_for_path_match(&matches[0]);
assert_eq!(labels.file_name, "the-file");
assert_eq!(labels.file_name_positions, &[0, 1, 4]);
assert_eq!(labels.path, "");
assert_eq!(labels.path_positions, &[0; 0]);
let (file_name, file_name_positions, full_path, full_path_positions) =
delegate.labels_for_path_match(&matches[0]);
assert_eq!(file_name, "the-file");
assert_eq!(file_name_positions, &[0, 1, 4]);
assert_eq!(full_path, "");
assert_eq!(full_path_positions, &[0; 0]);
});
// Since the worktree root is a file, searching for its name followed by a slash does