From fcf9e546da8727c515ac05ab3ba4d808d93dfa39 Mon Sep 17 00:00:00 2001 From: Lilith Iris <83819417+Irilith@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:13:53 +0700 Subject: [PATCH] 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 --- crates/project/src/project.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index f4d02f47f3e8daa264267240f0d74aee838a87f8..68f07f1ca9191e14f104b0657cf08d5b35dabd0b 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -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() }