Add (somewhat necessary) comment

Kunall Banerjee created

Change summary

crates/paths/src/paths.rs | 4 ++++
1 file changed, 4 insertions(+)

Detailed changes

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()
     })
 }