Skip to main content

Mountain/IPC/UriComponents/
FromFilePath.rs

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