Visual Studio Code, rebuilt in Rust
Rust
feat(windows): convert drive-letter and UNC paths to file URIs
rokartur7bfc822f6bcc
diff --git a/native/crates/app/src/editor.rs b/native/crates/app/src/editor.rsindex 8b1ce1df46a..8348c71a58b 100644--- a/native/crates/app/src/editor.rs+++ b/native/crates/app/src/editor.rs@@ -222,6 +222,10 @@ pub fn on_disk(scheme: &str) -> bool {/// The `UriComponents` of a model's scheme and path, as the extension host revives them.pub fn uri_value(scheme: &str, path: &Path) -> serde_json::Value {+ // Elsewhere a `//host` start stays in the path (a_non_file_uri_keeps_its_authority).+ if scheme == "file" && cfg!(windows) {+ return crate::uri::Uri::file(&path.to_string_lossy()).to_json();+ }let (path, fragment) = split_fragment(scheme, path);let (path, query) = split_query(scheme, path);let path = path.to_string_lossy();@@ -312,6 +316,9 @@ pub(crate) fn split_lines(text: &str) -> (Vec<String>, Option<&'static str>) {/// `guessIndentation` (indentationGuesser.ts), over UTF-16 code units as upstream counts them./// `URI.toString()`: `file:///a%20b` for a file, `scheme:/path` for a URI without authority.pub fn uri_string(scheme: &str, path: &Path) -> String {+ if scheme == "file" && cfg!(windows) {+ return crate::uri::Uri::file(&path.to_string_lossy()).to_string(false);+ }let mut uri = match scheme {"file" => String::from("file://"),scheme => format!("{scheme}:"),diff --git a/native/crates/app/src/editor_history.rs b/native/crates/app/src/editor_history.rsindex bf2b5583822..0a8852285fb 100644--- a/native/crates/app/src/editor_history.rs+++ b/native/crates/app/src/editor_history.rs@@ -6,6 +6,8 @@ use std::path::{Path, PathBuf};use serde_json::{Value, json};+use crate::uri::Uri;+const MAX_HISTORY_ITEMS: usize = 200;pub const HISTORY_STORAGE_KEY: &str = "history.entries";@@ -55,21 +57,15 @@ impl EditorHistory {}}-/// `URI.file(path).toString()`: path characters other than unreserved ones and `/` percent-encoded.+/// `URI.file(path).toString()`.pub fn file_uri_string(path: &Path) -> String {- let mut uri = String::from("file://");- for byte in path.to_string_lossy().bytes() {- match byte {- b'a'..=b'z' | b'A'..=b'Z' | b'0'..=b'9' | b'-' | b'.' | b'_' | b'~' | b'/' => uri.push(byte as char),- _ => uri.push_str(&format!("%{byte:02X}")),- }- }- uri+ Uri::file(&path.to_string_lossy()).to_string(false)}-/// The path of a `file:` URI string; `None` for other schemes.+/// The `fsPath` of a `file:` URI string; `None` for other schemes.pub fn file_path(uri: &str) -> Option<PathBuf> {- Some(PathBuf::from(percent_decode(uri.strip_prefix("file://")?)?))+ let uri = Uri::parse(uri).ok().filter(|uri| uri.scheme == "file")?;+ Some(PathBuf::from(uri.fs_path()))}/// `decodeURIComponent`; `None` when the decoded bytes are not UTF-8.diff --git a/native/crates/app/src/language_features.rs b/native/crates/app/src/language_features.rsindex 46fadaa12a8..f517077c654 100644--- a/native/crates/app/src/language_features.rs+++ b/native/crates/app/src/language_features.rs@@ -159,13 +159,10 @@ fn matches_pattern(pattern: &Value, path: &str) -> bool {files::glob::match_pattern(pattern["pattern"].as_str().unwrap_or_default(), relative, options)}-/// `URI.fsPath` on macOS: the path, with `//authority` first for a UNC-style URI.+/// `URI.fsPath`.fn fs_path(uri: &Value) -> String {- let path = uri["path"].as_str().unwrap_or_default();- match uri["authority"].as_str().filter(|authority| !authority.is_empty() && uri["scheme"] == "file") {- Some(authority) => format!("//{authority}{path}"),- None => path.to_owned(),- }+ let part = |key: &str| uri[key].as_str().unwrap_or_default();+ crate::uri::fs_path(part("scheme"), part("authority"), part("path"))}fn is_exclusive(selector: &Value) -> bool {diff --git a/native/crates/app/src/uri.rs b/native/crates/app/src/uri.rsindex d1c6c5e00bf..9889d07d0a5 100644--- a/native/crates/app/src/uri.rs+++ b/native/crates/app/src/uri.rs@@ -23,6 +23,16 @@ static SCHEME: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"^\w[\w\d+.-]*$").static ENCODED_AS_HEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(%[0-9A-Za-z][0-9A-Za-z])+").expect("valid"));impl Uri {+ /// `URI.file`: on Windows backslashes become slashes; a `//host/share` start is the authority (UNC).+ pub fn file(path: &str) -> Uri {+ file_uri(path, cfg!(windows))+ }++ /// `fsPath`.+ pub fn fs_path(&self) -> String {+ fs_path(&self.scheme, &self.authority, &self.path)+ }+/// The `Uri` constructor (not strict): an empty scheme becomes `file`, then `_referenceResolution` and `_validateUri`.pub fn new(scheme: &str, authority: &str, path: &str, query: &str, fragment: &str) -> Result<Uri, String> {let scheme = if scheme.is_empty() { "file" } else { scheme };@@ -133,6 +143,36 @@ impl Uri {}}+fn file_uri(path: &str, windows: bool) -> Uri {+ let path = if windows { path.replace('\\', "/") } else { path.to_owned() };+ let (authority, path) = match path.strip_prefix("//") {+ Some(rest) => match rest.find('/') {+ Some(slash) => (&rest[..slash], &rest[slash..]),+ None => (rest, "/"),+ },+ None => ("", path.as_str()),+ };+ Uri::new("file", authority, path, "", "").expect("URI.file: the authority is split off, so the path starts with one slash")+}++/// `uriToFsPath` without `keepDriveLetterCasing`, as the `fsPath` getter: a `file` URI's authority is a UNC host, a+/// `/c:` start a drive letter; backslashes on Windows.+pub fn fs_path(scheme: &str, authority: &str, path: &str) -> String {+ fs_path_on(scheme, authority, path, cfg!(windows))+}++pub(crate) fn fs_path_on(scheme: &str, authority: &str, path: &str, windows: bool) -> String {+ let bytes = path.as_bytes();+ let value = if !authority.is_empty() && path.len() > 1 && scheme == "file" {+ format!("//{authority}{path}")+ } else if bytes.len() >= 3 && bytes[0] == b'/' && bytes[1].is_ascii_alphabetic() && bytes[2] == b':' {+ format!("{}{}", bytes[1].to_ascii_lowercase() as char, &path[2..])+ } else {+ path.to_owned()+ };+ if windows { value.replace('/', "\\") } else { value }+}+/// `encodeURIComponentFast`: everything but the unreserved characters (and `/` in a path, `[]:` in an authority)/// as `%XX` of its UTF-8 bytes, which is what both its table and `encodeURIComponent` give.fn encode_component(component: &str, is_path: bool, is_authority: bool) -> String {diff --git a/native/crates/app/src/uri/tests.rs b/native/crates/app/src/uri/tests.rsindex a22668e6f0c..19cc35f700d 100644--- a/native/crates/app/src/uri/tests.rs+++ b/native/crates/app/src/uri/tests.rs@@ -114,3 +114,31 @@ fn malformed_escapes_stay_as_written() {assert_eq!(percent_decode("%41%zz%C3%BC"), "%41%zzü");assert_eq!(percent_decode("%C3%BC%41"), "üA");}++/// `URI.file` and `fsPath`, on Windows and elsewhere (the `isWindows` branches of uri.test.ts).+#[test]+fn file_uris_and_fs_paths_per_platform() {+ for windows in [true, false] {+ let fs = |uri: &Uri| fs_path_on(&uri.scheme, &uri.authority, &uri.path, windows);+ let drive = file_uri("c:\\win/path", windows);+ let unc = file_uri("\\\\localhost\\c$\\GitDevelopment\\express", windows);+ if windows {+ assert_eq!((drive.path.as_str(), drive.to_string(false), fs(&drive)), ("/c:/win/path", "file:///c%3A/win/path".to_owned(), "c:\\win\\path".to_owned()));+ assert_eq!((unc.authority.as_str(), unc.to_string(false), fs(&unc)), ("localhost", "file://localhost/c%24/GitDevelopment/express".to_owned(), "\\\\localhost\\c$\\GitDevelopment\\express".to_owned()));+ assert_eq!(file_uri("\\\\sh\u{e4}res\\path\\c#\\plugin.json", true).to_string(false), "file://sh%C3%A4res/path/c%23/plugin.json");+ let shares = file_uri("\\\\shares\\", true);+ assert_eq!((shares.authority.as_str(), shares.path.as_str()), ("shares", "/"));+ assert_eq!(fs(&parse("file:///C:/test/me")), "c:\\test\\me");+ assert_eq!(fs(&parse("file://monacotools1/certificates/SSL/")), "\\\\monacotools1\\certificates\\SSL\\");+ assert_eq!(fs(&parse("file:///_:/path")), "\\_:\\path");+ assert_eq!(fs(&file_uri("/", true)), "\\");+ } else {+ assert_eq!(drive.to_string(false), "file:///c%3A%5Cwin/path");+ assert_eq!((unc.authority.as_str(), unc.path.as_str()), ("", "/\\\\localhost\\c$\\GitDevelopment\\express"));+ assert_eq!(fs(&parse("file:///c:/test/me")), "c:/test/me");+ assert_eq!(fs(&parse("file://shares/files/c%23/p.cs")), "//shares/files/c#/p.cs");+ assert_eq!(fs(&parse("file:///_:/path")), "/_:/path");+ assert_eq!(fs(&file_uri("/Users/a b", false)), "/Users/a b");+ }+ }+}diff --git a/native/crates/app/src/webview.rs b/native/crates/app/src/webview.rsindex 3deee8ba9fd..71f2e4a0524 100644--- a/native/crates/app/src/webview.rs+++ b/native/crates/app/src/webview.rs@@ -2,7 +2,7 @@//! answers it, shared by the native views: a WKWebView on macOS (`macos.rs`), a WebKitGTK view on Linux (`linux.rs`), a//! WebView2 on Windows (`windows.rs`).-use std::path::{Component, Path, PathBuf};+use std::path::{Path, PathBuf};use serde_json::{Value, json};use sha2::{Digest, Sha256};@@ -139,22 +139,40 @@ fn decode_authority(encoded: &str) -> String {/// Local resource roots of folders on the disk.pub fn file_roots(paths: &[PathBuf]) -> Vec<files::Resource> {- paths.iter().map(|path| files::Resource::file(path.to_string_lossy())).collect()+ let resource = |uri: crate::uri::Uri| files::Resource { scheme: uri.scheme, authority: uri.authority, path: uri.path, query: String::new() };+ paths.iter().map(|path| resource(crate::uri::Uri::file(&path.to_string_lossy()))).collect()}/// resourceLoading.ts containment: the resource, without its query and `..` escapes, under a root of its scheme and/// authority; a `file` resource also as resolved. Extension file system providers have no realpath, so theirs is the/// lexical check only, and `vscode-remote` is denied without a remote connection.pub fn is_contained(resource: &files::Resource, roots: &[files::Resource]) -> bool {- let path = Path::new(&resource.path);- if resource.scheme == "vscode-remote" || path.components().any(|component| component == Component::ParentDir) {+ is_contained_on(resource, roots, cfg!(windows))+}++/// The containment on Windows or elsewhere: `file` paths as `fsPath` gives them, compared ignoring case on Windows+/// (uriIdentityService's `extUri` for a file system without `PathCaseSensitive`).+fn is_contained_on(resource: &files::Resource, roots: &[files::Resource], windows: bool) -> bool {+ let separators: &[char] = if windows { &['/', '\\'] } else { &['/'] };+ let fs_path = |resource: &files::Resource| match resource.scheme.as_str() {+ "file" => crate::uri::fs_path_on(&resource.scheme, &resource.authority, &resource.path, windows),+ _ => resource.path.clone(),+ };+ let comparable = |path: &str| if windows && resource.scheme == "file" { path.to_lowercase() } else { path.to_owned() };+ let path = fs_path(resource);+ if resource.scheme == "vscode-remote" || path.split(separators).any(|segment| segment == "..") {return false;}- let Some(root) = roots.iter().find(|root| root.scheme == resource.scheme && root.authority.eq_ignore_ascii_case(&resource.authority) && path.starts_with(&root.path)) else { return false };+ let under = |root: &str| {+ let (path, root) = (comparable(&path), comparable(root));+ let root = root.trim_end_matches(separators);+ path == root || path.strip_prefix(root).is_some_and(|rest| rest.starts_with(separators))+ };+ let Some(root) = roots.iter().find(|root| root.scheme == resource.scheme && root.authority.eq_ignore_ascii_case(&resource.authority) && under(&fs_path(root))) else { return false };if resource.scheme != "file" {return true;}- match (std::fs::canonicalize(path), std::fs::canonicalize(&root.path)) {+ match (std::fs::canonicalize(&path), std::fs::canonicalize(fs_path(root))) {(Ok(real), Ok(real_root)) => real.starts_with(real_root),_ => true,}@@ -613,6 +631,13 @@ mod tests {assert!(!is_contained(&resource("memfs", "", "/nonexistent-root/media/a.png"), &roots), "a root holds only its own scheme");assert!(!is_contained(&resource("memfs", "other", "/media/a.png"), &roots), "nor another authority");assert!(!is_contained(&resource("vscode-remote", "wsl+x", "/media/a.png"), &[resource("vscode-remote", "wsl+x", "/media")]));+ // On Windows: URI.file of `C:\w\media` keeps the drive's case, asWebviewUri's toString lowercases it.+ let roots = [resource("file", "", "/C:/nonexistent-root/Media")];+ assert!(is_contained_on(&resource("file", "", "/c:/nonexistent-root/media/a.png"), &roots, true));+ assert!(!is_contained_on(&resource("file", "", "/c:/nonexistent-root/media/a.png"), &roots, false));+ assert!(!is_contained_on(&resource("file", "", "/c:/nonexistent-root/mediaX/a.png"), &roots, true));+ assert!(!is_contained_on(&resource("file", "", "/c:/nonexistent-root/media/..\\secret"), &roots, true));+ assert!(!is_contained_on(&resource("file", "", "//host/share/a.png"), &roots, true));}#[test]diff --git a/native/crates/app/src/webview/windows.rs b/native/crates/app/src/webview/windows.rsindex 9bc4380cefd..59e6bf97636 100644--- a/native/crates/app/src/webview/windows.rs+++ b/native/crates/app/src/webview/windows.rs@@ -405,7 +405,7 @@ unsafe fn answer(environment: &ICoreWebView2Environment, resources: &Resources,let mut range = PWSTR::null();let range = request.Headers()?.GetHeader(w!("Range"), &mut range).ok().map(|()| take_pwstr(range));if resource.scheme == "file" {- return respond(environment, &args, resource_response(&resource.path, std::fs::read(&resource.path).ok(), range.as_deref()));+ return respond(environment, &args, resource_response(&resource.path, std::fs::read(crate::uri::fs_path(&resource.scheme, &resource.authority, &resource.path)).ok(), range.as_deref()));}let deferral = args.GetDeferral()?;let (environment, path) = (environment.clone(), resource.path.clone());diff --git a/native/crates/app/src/workbench/backup_tracker.rs b/native/crates/app/src/workbench/backup_tracker.rsindex c435ccefdc1..00001d8fbaa 100644--- a/native/crates/app/src/workbench/backup_tracker.rs+++ b/native/crates/app/src/workbench/backup_tracker.rs@@ -110,7 +110,7 @@ fn rand_below_1000() -> u32 {}fn file_uri(path: &Path) -> String {- Uri::new("file", "", &path.to_string_lossy(), "", "").map_or_else(|_| String::new(), |uri| uri.to_string(false))+ Uri::file(&path.to_string_lossy()).to_string(false)}impl Workbench {diff --git a/native/crates/app/src/workbench/file_dialogs.rs b/native/crates/app/src/workbench/file_dialogs.rsindex a03f03ef40a..9d5b98af416 100644--- a/native/crates/app/src/workbench/file_dialogs.rs+++ b/native/crates/app/src/workbench/file_dialogs.rs@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};use futures::channel::oneshot;use gpui::Context;-use serde_json::{Value, json};+use serde_json::Value;use super::Workbench;use crate::commands::Outcome;@@ -231,7 +231,7 @@ fn save_filters(languages: &Languages, default: &Path) -> Vec<(String, Vec<Strin}fn file_uri(path: &Path) -> Value {- json!({ "$mid": 1, "scheme": "file", "authority": "", "path": path.to_string_lossy(), "query": "", "fragment": "" })+ crate::uri::Uri::file(&path.to_string_lossy()).to_json()}fn answer<T: Send + 'static>(picked: oneshot::Receiver<T>, to_value: impl FnOnce(T) -> Value + Send + 'static, cx: &mut Context<Workbench>) -> oneshot::Receiver<Result<Value, Value>> {@@ -247,6 +247,8 @@ fn answer<T: Send + 'static>(picked: oneshot::Receiver<T>, to_value: impl FnOnce#[cfg(test)]mod tests {+ use serde_json::json;+use super::*;#[test]diff --git a/native/crates/app/src/workbench/host_requests.rs b/native/crates/app/src/workbench/host_requests.rsindex 92aedb01c42..62235c5a2a2 100644--- a/native/crates/app/src/workbench/host_requests.rs+++ b/native/crates/app/src/workbench/host_requests.rs@@ -804,6 +804,7 @@ pub(super) fn uri_parts(uri: &Value) -> Result<(&str, PathBuf), Value> {match (scheme, authority) {("", _) => Err(serialized_error("Invalid uri. Scheme and authority or path must be set.")),("file", _) | (_, "") if path.is_empty() => Err(serialized_error("Invalid uri. Scheme and authority or path must be set.")),+ ("file", _) if cfg!(windows) => Ok((scheme, PathBuf::from(crate::uri::fs_path(scheme, authority, path)))),("file", _) | (_, "") => Ok((scheme, PathBuf::from(format!("{path}{query}")))),_ => Ok((scheme, PathBuf::from(format!("//{authority}{path}{query}")))),}diff --git a/port/ledger.md b/port/ledger.mdindex 4ed2eb3064d..29809c1d7ff 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -82,7 +82,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,| M24 Windows | app/src/keybindings.rs:86 | open | [windows L] Windows keybindings: `default-win` table, the `win` key of extension and user rules, Windows labels (keybindingLabels.ts for `OperatingSystem.Windows`: `Ctrl+Shift+P`, `Windows`, `win`), and windowsKeyboardMapper.ts for layouts. The per-platform mechanism is M24's (decision "Menu bar and keybinding tables"), with a Linux table hook; it unblocks the M23 Linux row app/src/keybindings.rs:86. Windows shows now: the macOS table on GPUI's platform modifier (Ctrl). | `cargo gc test -p app keybindings` on the host with the Windows table || M24 Windows | app/src/keyboard_layout.rs:7 | open | [windows M] keyboard layout info and raw mapping (native-keymap's Windows `GetKeyboardLayout`, `MapVirtualKeyEx`, `ToUnicodeEx`). | `cargo gc test -p app keyboard` on the windows runner || M24 Windows | app/src/clipboard.rs:91 | open | [windows M] clipboard file lists, HTML and custom formats (Chromium's registered clipboard formats); GPUI's Windows clipboard has text and images. Windows shows now: text only. | `cargo gc test -p app clipboard` on the windows runner |-| M24 Windows | files/src/disk.rs:58 | open | [windows M] file system on NTFS: read-only through `FILE_ATTRIBUTE_READONLY`, file and directory symlinks, case-insensitive path compare, Recycle Bin (trash crate), ReadDirectoryChangesW (notify). | `cargo gc test -p files` on the windows runner |+| M24 Windows | files/src/disk.rs:58 | open | [windows M] file system on NTFS: read-only through `FILE_ATTRIBUTE_READONLY`, file and directory symlinks, case-insensitive path compare, Recycle Bin (trash crate), ReadDirectoryChangesW (notify); Windows versions of the `cfg(unix)` tests that lock files or folders or make symlinks (readonly, text_files, explorer_actions, terminal completion_service). | `cargo gc test -p files` on the windows runner || M24 Windows | app/src/editor_history.rs:59 | in progress | [windows L] drive-letter paths and file URIs (`file:///c%3A/...`, uri.ts `fsPath` on Windows, backslash separators in labels). Done: uri.rs `Uri::file` and `fs_path` as uri.ts `URI.file` and `uriToFsPath` (backslashes, drive letters, UNC authorities), used by editor_history.rs, the editor's model URIs (editor.rs `uri_value`, `uri_string`, host_requests.rs `uri_parts`, on Windows only: elsewhere a `//host` path keeps the port's form), backup_tracker.rs, file_dialogs.rs, language_features.rs and webview resources (`file_roots`, `is_contained` comparing `fsPath`s ignoring case as `extUri` on Windows, the WebView2 file read). Open: the other `file` URI reads (`uri["path"]` of a `file` URI taken as the path: debug, scm, search, notebooks, tasks and the rest), backslash separators in labels (labels.ts `getPathLabel`), and the UNC host check (`security.restrictUNCAccess`, `security.allowedUNCHosts`, Electron's node `ERR_UNC_HOST_NOT_ALLOWED`): a `file://host/share` URI now reaches `\\host\share`, so a link to it sends the user's NTLM credentials to that host. | `cargo gc test -p app uri::tests::file_uris_and_fs_paths_per_platform` and `cargo gc test -p app webview::tests::maps_resource_urls` on the host; [windows] api-tests and a webview image from the workspace on the windows runner || M24 Windows | app/src/settings_import.rs:28 | open | [windows S] settings import from `%APPDATA%\Code`, `%APPDATA%\Cursor`, `%APPDATA%\VSCodium`, extensions from `%USERPROFILE%\.vscode\extensions` and the others. | `cargo gc test -p app settings_import` on the windows runner || M24 Windows | app/src/workbench/shell_command.rs:70 | in progress | [windows S] no Shell Command on Windows (upstream has it on macOS only): the user setup puts `{app}\bin` on the user PATH (code.iss `addtopath`), the zip leaves PATH alone. | the commands absent from the palette on the windows runner; the installer row's check |diff --git a/port/notes.md b/port/notes.mdindex 6c6c81fa4c1..0d14f0450f7 100644--- a/port/notes.md+++ b/port/notes.md@@ -1022,6 +1022,7 @@ What to do (milestone 21, in order):- Named pipes: `exthost/src/pipe.rs` carries both the extension host connection (`\\.\pipe\vscode-ipc-<uuid>-sock`) and the single instance (`\\.\pipe\<sha256(user data)[..8]>-<version>-main-sock`, launch.rs), as ipc.net.ts names them. Instances are made as libuv's `uv_pipe_bind` makes them (duplex, byte mode, 64 KiB buffers, default security descriptor) plus `PIPE_REJECT_REMOTE_CLIENTS` and `FILE_FLAG_FIRST_PIPE_INSTANCE`, so a second listener fails as Node's `listen` does with EADDRINUSE. The handles are overlapped: synchronous I/O on one pipe handle is serialized by Windows, and the extension host reader thread blocks in a read while the main thread writes. Clients connect with `SECURITY_IDENTIFICATION`, so a pipe server cannot act as the client. The single instance name is fixed per user data folder in the machine-wide pipe namespace, as upstream's: another local user who creates it first receives a later start's arguments and working directory. A second instance calls `AllowSetForegroundWindow` with the pipe server's pid (`GetNamedPipeServerProcessId`) where main.ts asks the first instance for its pid over IPC. `generateUuid` and the profile ids read the OS random source (getrandom), not `/dev/urandom`.- Console: the app is a GUI-subsystem binary, as Electron's, so a start from Explorer or the Start menu opens no console window; at start it attaches to the console of the process that started it unless the output is redirected or the CLI set `ELECTRON_NO_ATTACH_CONSOLE` (electron_main_win.cc, Chromium's `RouteStdioToConsole`), so `bin\<applicationName>.cmd --help` prints in the terminal.- Proxy: `request/windows.rs` sends through curl.exe as Linux does, with the proxy picked first: the session proxy, else the IE settings, auto-detect and the PAC URL through WinHTTP's resolver where Chromium runs the script in its own V8 (same answer, other engine), then the manual proxy. The rule and bypass parsing is Chromium's (`request/proxy_rules.rs`, built on every platform for its host tests). Difference: curl takes one proxy, so a PAC list's later entries are no fallback.+- File URIs: `uri.rs` `Uri::file` and `fs_path` are uri.ts `URI.file` and `uriToFsPath`, with the platform a parameter so the host tests check the Windows branches. The editor's model URIs take them on Windows only: elsewhere the port keeps a `//host/a` model path in the URI path (editor.rs `a_non_file_uri_keeps_its_authority`) where upstream makes `host` the authority.## Accepted platform differences