Mountain/IPC/UriComponents/FromFilePath.rs
1#![allow(non_snake_case)]
2
3//! Build a `file://` `UriComponents` from an absolute filesystem path.
4//! Path is emitted verbatim - no percent-encoding, no normalisation -
5//! mirroring what VS Code's `URI.file(…)` readers expect.
6
7use serde_json::{Value, json};
8
9use crate::IPC::UriComponents::StampMidUri;
10
11pub fn Fn<S:AsRef<str>>(Path:S) -> Value {
12 StampMidUri::Fn(json!({
13 "scheme": "file",
14 "authority": "",
15 "path": Path.as_ref(),
16 "query": "",
17 "fragment": "",
18 }))
19}