@@ -9,28 +9,6 @@ use zed_extension_api::{
99const PACKAGE_NAME : & str = "@zeddotdev/postgres-context-server" ;
1010const 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-
3412struct PostgresModelContextExtension ;
3513
3614#[ derive( Debug , Deserialize , JsonSchema ) ]
@@ -96,3 +74,25 @@ impl zed::Extension for PostgresModelContextExtension {
9674}
9775
9876zed:: 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