windows: Fix inconsistent separators in buffer headers and breadcrumbs (#38898)

Make `resolve_full_path` use the appropriate separators, and return a
`String`.

As part of fixing the fallout from that type change, this also fixes a
bunch of places in the agent code that were using `std::path::Path`
operations on paths that could be non-local, by changing them to operate
instead on strings and use the project's `PathStyle`.

This clears the way a bit for making `full_path` also return a string
instead of a `PathBuf`, but I've left that for a follow-up.

Release Notes:

- N/A
This commit is contained in:
Cole Miller
2025-09-25 22:24:32 +00:00
committed by GitHub
parent 6470443271
commit d83d7d35cb
16 changed files with 239 additions and 170 deletions
@@ -137,7 +137,9 @@ pub fn selections_creases(
None
};
let language_name = language_name.as_deref().unwrap_or("");
let filename = snapshot.file_at(range.start).map(|file| file.full_path(cx));
let filename = snapshot
.file_at(range.start)
.map(|file| file.full_path(cx).to_string_lossy().to_string());
let text = if language_name == "markdown" {
selected_text
.lines()
@@ -187,9 +189,9 @@ pub fn selections_creases(
let start_line = range.start.row + 1;
let end_line = range.end.row + 1;
if start_line == end_line {
format!("{}, Line {}", path.display(), start_line)
format!("{path}, Line {start_line}")
} else {
format!("{}, Lines {} to {}", path.display(), start_line, end_line)
format!("{path}, Lines {start_line} to {end_line}")
}
} else {
"Quoted selection".to_string()