project: Fix content not displaying when selecting a folder in Windows (#18946)

- Closes #16998

This PR resolves issues with the /file and /diagnostics commands in the
assistant panel, which previously failed to display the contents of a
directory when searching for a folder instead of using the arrow button.

- Changed the format in `project.rs` (located at
`crates/project/src/project.rs`) to use `std::path::MAIN_SEPARATOR` for
cross-platform compatibility, which resolves errors encountered on
Windows that originally used the format `format!("{}/", ...)`.


Release Notes:

- N/A
This commit is contained in:
Lilith Iris 2024-10-14 16:13:53 +07:00 committed by GitHub
parent 7dc069100d
commit fcf9e546da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3969,7 +3969,7 @@ impl<'a> fuzzy::PathMatchCandidateSet<'a> for PathMatchCandidateSet {
if self.snapshot.root_entry().map_or(false, |e| e.is_file()) {
self.snapshot.root_name().into()
} else if self.include_root_name {
format!("{}/", self.snapshot.root_name()).into()
format!("{}{}", self.snapshot.root_name(), std::path::MAIN_SEPARATOR).into()
} else {
Arc::default()
}