From 80870572df730fb6a02b301990d02b54277d6f0f Mon Sep 17 00:00:00 2001 From: Kunall Banerjee Date: Wed, 4 Mar 2026 19:52:10 -0500 Subject: [PATCH] Add (somewhat necessary) comment --- crates/paths/src/paths.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/paths/src/paths.rs b/crates/paths/src/paths.rs index 212a68d8ef48f034c78825955be07bef17fb2748..906c779ceb737259b5a44aefc0e35714021f94e0 100644 --- a/crates/paths/src/paths.rs +++ b/crates/paths/src/paths.rs @@ -75,6 +75,10 @@ pub fn set_custom_data_dir(dir: &str) -> &'static PathBuf { let canonicalized = path .canonicalize() .expect("failed to canonicalize custom data directory's path to an absolute path"); + // On Windows, `canonicalize` produces extended-length paths prefixed + // with `\\?\`. Strip that prefix so downstream consumers (e.g. + // Node.js language servers) that receive derived paths as arguments + // don't choke on the verbatim syntax. SanitizedPath::new(&canonicalized).as_path().to_path_buf() }) }