Skip to content

Commit 7f3800c

Browse files
committed
zed fix
1 parent 1e65673 commit 7f3800c

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

engine/zed/src/lib.rs

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ use zed_extension_api::{self as zed, settings::LspSettings, LanguageServerId, Re
66
// https://github.com/zed-extensions/csharp/blob/main/src/csharp.rs
77

88
const GITHUB_REPO: &str = "BoundaryML/baml";
9-
10-
// Embed the binary for debug mode
11-
#[cfg(feature = "debug")]
12-
const BAML_CLI_BINARY: &[u8] = include_bytes!("../../target/debug/baml-cli");
13-
// const BAML_CLI_BINARY: &[u8] = include_bytes!("../baml-cli");
149
struct BamlBinary {
1510
path: String,
1611
args: Option<Vec<String>>,
@@ -139,18 +134,27 @@ impl zed::Extension for BamlExtension {
139134
language_server_id: &zed::LanguageServerId,
140135
worktree: &zed::Worktree,
141136
) -> Result<zed::Command> {
142-
let baml_binary = self.language_server_binary(language_server_id, worktree)?;
143-
Ok(zed::Command {
144-
#[cfg(feature = "debug")]
145-
command: format!(
146-
"{}/../target/debug/language-server-hot-reload",
147-
env!("CARGO_MANIFEST_DIR")
148-
),
149-
#[cfg(not(feature = "debug"))]
150-
command: baml_binary.path,
151-
args: baml_binary.args.unwrap_or_else(|| vec!["lsp".into()]),
152-
env: vec![("VSCODE_DEBUG_MODE".to_string(), "true".to_string())],
153-
})
137+
#[cfg(feature = "debug")]
138+
{
139+
Ok(zed::Command {
140+
command: format!(
141+
"{}/../target/debug/language-server-hot-reload",
142+
env!("CARGO_MANIFEST_DIR")
143+
),
144+
args: vec!["lsp".into()],
145+
env: vec![("VSCODE_DEBUG_MODE".to_string(), "true".to_string())],
146+
})
147+
}
148+
149+
#[cfg(not(feature = "debug"))]
150+
{
151+
let baml_binary = self.language_server_binary(language_server_id, worktree)?;
152+
Ok(zed::Command {
153+
command: baml_binary.path,
154+
args: baml_binary.args.unwrap_or_else(|| vec!["lsp".into()]),
155+
env: Default::default(),
156+
})
157+
}
154158
}
155159

156160
// fn language_server_initialization_options(

0 commit comments

Comments
 (0)