Skip to content

Commit 9e14339

Browse files
committed
Upgrade zed-extension-api, remove windows workaround
1 parent cf4bc29 commit 9e14339

File tree

4 files changed

+10
-32
lines changed

4 files changed

+10
-32
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "zed_postgres_model_context"
3-
version = "0.0.4"
3+
version = "0.0.5"
44
edition = "2021"
55
publish = false
66
license = "Apache-2.0"
@@ -12,4 +12,4 @@ crate-type = ["cdylib"]
1212
[dependencies]
1313
serde = "1.0"
1414
schemars = "0.8"
15-
zed_extension_api = "0.5.0"
15+
zed_extension_api = "0.7.0"

extension.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id = "postgres-context-server"
22
name = "Postgres Context Server"
33
description = "Model Context Server for PostgreSQL"
4-
version = "0.0.4"
4+
version = "0.0.5"
55
schema_version = 1
66
authors = ["Max Brunsfeld <[email protected]>"]
77
repository = "https://github.com/zed-extensions/postgres-context-server"

src/postgres_model_context.rs

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ impl zed::Extension for PostgresModelContextExtension {
3939
let settings: PostgresContextServerSettings =
4040
serde_json::from_value(settings).map_err(|e| e.to_string())?;
4141

42-
// Sanitize paths for Windows compatibility
43-
let node_path = zed_ext::sanitize_windows_path(zed::node_binary_path()?.into());
44-
let server_path = zed_ext::sanitize_windows_path(env::current_dir().unwrap())
42+
let node_path = zed::node_binary_path()?;
43+
let server_path = env::current_dir()
44+
.unwrap()
4545
.join(SERVER_PATH)
4646
.to_string_lossy()
4747
.to_string();
4848

4949
Ok(Command {
50-
command: node_path.to_string_lossy().to_string(),
50+
command: node_path,
5151
args: vec![server_path],
5252
env: vec![("DATABASE_URL".into(), settings.database_url)],
5353
})
@@ -74,25 +74,3 @@ impl zed::Extension for PostgresModelContextExtension {
7474
}
7575

7676
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)