Skip to content

egor/vscode-ext #2079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 74 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
b7b7b37
basic hosting of frontend and websocket communication
egol Jun 10, 2025
ce37d10
rust talking to frontend
egol Jun 10, 2025
2462fd7
cleaned up code
egol Jun 10, 2025
6c663e2
add basic file watching for saved files
egol Jun 10, 2025
0a73230
improve file watching to watch a baml_src directory
egol Jun 10, 2025
730d354
added init which grabs all baml files at baml_src
egol Jun 10, 2025
a2fc63e
basic implementation for playground via cli
egol Jun 11, 2025
1d45222
correctly update removed .baml files
egol Jun 11, 2025
7fcec1d
change embedd to pull from web-panel build file directly
egol Jun 11, 2025
4f9925d
basic LSP playground embed
egol Jun 12, 2025
0c79597
add reciever to keep broadcast channel alive
egol Jun 12, 2025
e2cdddd
web update on save working
egol Jun 12, 2025
6922f1e
did_change test
egol Jun 12, 2025
48a74c2
working unsaved update passthrough from lsp to playground
egol Jun 12, 2025
f565298
Connection error for webview
egol Jun 12, 2025
59db9b1
fix icon, description
sxlijin May 30, 2025
5904fb3
MyBundle -> BamlBundle
sxlijin May 30, 2025
d907668
set up lang server runner
sxlijin May 30, 2025
15591c7
add working code
sxlijin May 31, 2025
19df09c
better comment
sxlijin Jun 2, 2025
f551b70
java to kotlin
sxlijin Jun 13, 2025
a7a115d
delete the java code
sxlijin Jun 13, 2025
f2589a8
add command support for LSP
sxlijin Jun 14, 2025
91fb791
get a basic downloading impl partially working
sxlijin Jun 14, 2025
51e9208
init zed extension support
egol Jun 16, 2025
80990b4
added on hover function switching to LSP
egol Jun 17, 2025
b515479
disable websocket in vscode
egol Jun 17, 2025
fd06736
automatically find a new port if selected one is being used
egol Jun 17, 2025
12531ae
change git path for extension and set to release mode
egol Jun 17, 2025
dcdd76a
revert changes to cli
egol Jun 17, 2025
bee7046
Merge branch 'canary' into Egor/zed-extension
egol Jun 17, 2025
bc834a3
force web-view to be built before language server
egol Jun 17, 2025
4f638f2
various fixes + code actions for zed
egol Jun 17, 2025
898320a
disable on-hover fn selection and add go to def selection. Fix connec…
egol Jun 17, 2025
016718c
build modification
egol Jun 17, 2025
7afb712
build script adjustments
egol Jun 18, 2025
79a6c00
more build script adjustments
egol Jun 18, 2025
20b19be
build script runs after macro in rust, remove macro for embed
egol Jun 18, 2025
8f63676
try changing workflow file order
egol Jun 18, 2025
00f6163
more workflow modification
egol Jun 18, 2025
476e640
fix missing wasm-bindgen when building language-server
egol Jun 18, 2025
c86c77e
download specfic wasm-bindgen version in install script
egol Jun 18, 2025
3bcdb44
fix test for lsp and git diff check
egol Jun 18, 2025
5ae0967
remove build.rs script and replace with install.sh, fix connection st…
egol Jun 18, 2025
3dbc75f
fix order of install script
egol Jun 18, 2025
7cc5efb
add comments and rename script
egol Jun 19, 2025
c3cb181
testing panel view
egol Jun 19, 2025
30eaa62
Merge remote-tracking branch 'origin/egor/zed-extension' into sam/jet…
egol Jun 19, 2025
23810d9
LSP communicates port to jetbrains automatically with baml/port
egol Jun 19, 2025
6360a5b
playground codelens button correctly selects function but no longer o…
egol Jun 19, 2025
c489da0
add persistent functions on frontend server-side + execute command
egol Jun 24, 2025
9b11f99
add support for test code lens
egol Jun 24, 2025
9649c58
add a queue to playground server so it can wait for websocket connection
egol Jun 24, 2025
0dfd5d7
remove logic for storing last selected function server side
egol Jun 24, 2025
f6fa631
adding back in github LSP downloading
egol Jun 24, 2025
57ed827
add kotlinSerialization for github release parsing
egol Jun 24, 2025
5a63181
change gradle properties to use stable lsp4ij version
egol Jun 24, 2025
51011cd
Merge branch 'canary' into sam/jetbrains2
egol Jun 24, 2025
8e4a183
formatting pass
egol Jun 24, 2025
8da4663
more fixes for clippy
egol Jun 24, 2025
bd4c9c6
turn of debug mode
egol Jun 25, 2025
1835bea
fix formatting
egol Jun 25, 2025
ac15c8a
clippy fixes
egol Jun 25, 2025
f2cc679
check for temp directory to avoid error
egol Jun 25, 2025
095caac
try forcing more memory
egol Jun 25, 2025
8555e60
add checks to file extraction
egol Jun 25, 2025
5e3fd6f
basic hook up of lsp playground to vscode + codelens
egol Jun 25, 2025
d0c4ba3
automatically wait and retrieve port + loading screen
egol Jun 25, 2025
c848e66
remove vscode to webview communication
egol Jun 25, 2025
6abb18d
improve naming
egol Jun 26, 2025
287a383
improve comment for directory embed
egol Jun 26, 2025
965d2e6
allow language server to serve files to frontend via existing VS Code…
egol Jun 26, 2025
08798c4
working proxy
egol Jun 27, 2025
53ceadd
clean up proxy code
egol Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 106 additions & 12 deletions engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion engine/baml-schema-wasm/src/runtime_wasm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ pub fn on_wasm_init() {
if #[cfg(debug_assertions)] {
const LOG_LEVEL: log::Level = log::Level::Debug;
} else {
const LOG_LEVEL: log::Level = log::Level::Info;
// TODO uncomment this
const LOG_LEVEL: log::Level = log::Level::Debug;
}
};
// I dont think we need this line anymore -- seems to break logging if you add it.
Expand Down
4 changes: 4 additions & 0 deletions engine/language_server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ warp = "0.3"
futures-util = "0.3"
include_dir = "0.7"
mime_guess = "2.0.4"
base64 = "0.21"
reqwest = { version = "0.11", features = ["json"] }
http = "0.2"
bytes = "1.0"

webbrowser = "0.8"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

# This script is needed as the language_server embeds the web-panel dist
# directory in the playground_server.rs file. It builds all of the dependencies
# for it as well as the web-panel itself.
# This script installs dependencies for the frontend and builds it so that it
# appears under dist. This is needed as playground_server_helpers.rs embeds the dist
# directory.

# Exit on error
set -e
Expand Down
26 changes: 13 additions & 13 deletions engine/language_server/src/baml_project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct BamlProject {

impl Drop for BamlProject {
fn drop(&mut self) {
tracing::info!("Dropping BamlProject");
tracing::debug!("Dropping BamlProject");
}
}

Expand All @@ -83,7 +83,7 @@ impl std::fmt::Debug for BamlProject {

impl BamlProject {
pub fn new(root_dir: PathBuf) -> Self {
tracing::info!("Creating BamlProject for {}", root_dir.display());
tracing::debug!("Creating BamlProject for {}", root_dir.display());
Self {
root_dir_name: root_dir,
files: HashMap::new(),
Expand Down Expand Up @@ -172,7 +172,7 @@ impl BamlProject {
let generated = match runtime.run_codegen(&all_files, no_version_check.unwrap_or(false)) {
Ok(gen) => {
let elapsed = start_time.elapsed();
tracing::info!(
tracing::debug!(
"Generated {:?} baml_clients in {:?}ms",
gen.len(),
elapsed.as_millis()
Expand All @@ -181,7 +181,7 @@ impl BamlProject {
}
Err(e) => {
let elapsed = start_time.elapsed();
tracing::info!(
tracing::debug!(
"Failed to run codegen in {:?}ms: {:?}",
elapsed.as_millis(),
e
Expand All @@ -192,11 +192,11 @@ impl BamlProject {
};

match generated.len() {
1 => tracing::info!(
1 => tracing::debug!(
"Generated 1 baml_client: {}",
generated[0].output_dir_full.display()
),
n => tracing::info!(
n => tracing::debug!(
"Generated {n} baml_clients: {}",
generated
.iter()
Expand All @@ -209,7 +209,7 @@ impl BamlProject {
}

pub fn set_unsaved_file(&mut self, document_key: &DocumentKey, content: Option<String>) {
tracing::info!(
tracing::debug!(
"Setting unsaved file: {}, {}",
document_key.path().display(),
content.clone().unwrap_or("None".to_string())
Expand All @@ -228,7 +228,7 @@ impl BamlProject {
self.cached_runtime = None;
}
pub fn save_file(&mut self, document_key: &DocumentKey, content: &str) {
tracing::info!(
tracing::debug!(
"Saving file: {}, {}",
document_key.path().display(),
content
Expand All @@ -240,7 +240,7 @@ impl BamlProject {
}

pub fn update_file(&mut self, document_key: &DocumentKey, content: Option<String>) {
tracing::info!(
tracing::debug!(
"Updating file: {}, {}",
document_key.path().display(),
content.clone().unwrap_or("None".to_string())
Expand Down Expand Up @@ -303,7 +303,7 @@ impl BamlProject {
) -> Result<BamlRuntime, Diagnostics> {
let mut all_files_for_hash = self.files.iter().collect::<Vec<_>>();

log::info!(
log::debug!(
"Baml Project saved files: {:#?}, Unsaved files: {:#?}",
all_files_for_hash.len(),
self.unsaved_files.len()
Expand All @@ -329,13 +329,13 @@ impl BamlProject {
tracing::debug!("Runtime cache hit ({})", current_hash);
return cached_result.clone();
}
tracing::info!(
tracing::debug!(
"Runtime cache miss (hash mismatch: {} != {})",
*cached_hash,
current_hash
);
} else {
tracing::info!("Runtime cache miss (no cache entry)");
tracing::debug!("Runtime cache miss (no cache entry)");
}

let files_for_runtime = self
Expand Down Expand Up @@ -1007,7 +1007,7 @@ impl Project {
}

let elapsed = start_time.elapsed();
tracing::info!("update_runtime took {:?}ms", elapsed.as_millis());
tracing::debug!("update_runtime took {:?}ms", elapsed.as_millis());
Ok(())
}

Expand Down
Loading