Skip to content

Commit a8080ec

Browse files
authored
Do some reformatting (#11)
As we plan on eventually removing this, it makes more sense to have this at the bottom of the file
1 parent 48acae8 commit a8080ec

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/postgres_model_context.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,6 @@ use zed_extension_api::{
99
const PACKAGE_NAME: &str = "@zeddotdev/postgres-context-server";
1010
const SERVER_PATH: &str = "node_modules/@zeddotdev/postgres-context-server/index.mjs";
1111

12-
/// Extensions to the Zed extension API that have not yet stabilized.
13-
mod zed_ext {
14-
/// Sanitizes the given path to remove the leading `/` on Windows.
15-
///
16-
/// On macOS and Linux this is a no-op.
17-
///
18-
/// This is a workaround for https://github.com/bytecodealliance/wasmtime/issues/10415.
19-
pub fn sanitize_windows_path(path: std::path::PathBuf) -> std::path::PathBuf {
20-
use zed_extension_api::{current_platform, Os};
21-
22-
let (os, _arch) = current_platform();
23-
match os {
24-
Os::Mac | Os::Linux => path,
25-
Os::Windows => path
26-
.to_string_lossy()
27-
.to_string()
28-
.trim_start_matches('/')
29-
.into(),
30-
}
31-
}
32-
}
33-
3412
struct PostgresModelContextExtension;
3513

3614
#[derive(Debug, Deserialize, JsonSchema)]
@@ -96,3 +74,25 @@ impl zed::Extension for PostgresModelContextExtension {
9674
}
9775

9876
zed::register_extension!(PostgresModelContextExtension);
77+
78+
/// Extensions to the Zed extension API that have not yet stabilized.
79+
mod zed_ext {
80+
/// Sanitizes the given path to remove the leading `/` on Windows.
81+
///
82+
/// On macOS and Linux this is a no-op.
83+
///
84+
/// This is a workaround for https://github.com/bytecodealliance/wasmtime/issues/10415.
85+
pub fn sanitize_windows_path(path: std::path::PathBuf) -> std::path::PathBuf {
86+
use zed_extension_api::{current_platform, Os};
87+
88+
let (os, _arch) = current_platform();
89+
match os {
90+
Os::Mac | Os::Linux => path,
91+
Os::Windows => path
92+
.to_string_lossy()
93+
.to_string()
94+
.trim_start_matches('/')
95+
.into(),
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)