Skip to content

Commit c92bcf6

Browse files
authored
Fix issues with some tests, remove old LSP code (#2031)
<!-- ELLIPSIS_HIDDEN --> > [!IMPORTANT] > Update build process and test configurations, including a new release build script and minor test adjustments. > > - **Build Process**: > - Update build command in `.github/workflows/build-vscode-release.reusable.yaml` from `pnpm run build` to `pnpm run build:release`. > - Add `server:build:release` script in `package.json` for VSCode extension. > - **Tests**: > - Change model name in `modular.test.ts` from 'gemini-1.5-pro-001' to 'gemini-1.5-pro'. > - **Code Cleanup**: > - Remove unnecessary whitespace in `types.go`. > - Remove `baml-client#build` dependency in `turbo.json`. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 1f69e1f. You can [customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this summary. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
1 parent 7736f22 commit c92bcf6

32 files changed

Lines changed: 21 additions & 2483 deletions

File tree

‎.github/workflows/build-vscode-release.reusable.yaml‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
workflow_call:
1010
inputs:
1111
is_release_build:
12-
description: 'Whether this is a release build (affects --pre-release flag)'
12+
description: "Whether this is a release build (affects --pre-release flag)"
1313
type: boolean
1414
default: true
1515
version:
16-
description: 'Version string to use for the build'
16+
description: "Version string to use for the build"
1717
type: string
1818
required: true
1919

@@ -66,14 +66,14 @@ jobs:
6666
uses: actions/download-artifact@v4
6767
with:
6868
name: baml-cli-${{ matrix.rust-target }}
69-
path: cli-artifact-${{ matrix.code-target }}
69+
path: cli-artifact-${{ matrix.code-target }}
7070
# Unique path per job
7171
# Add error handling if the specific artifact isn't found
7272

7373
- name: List downloaded artifact content
7474
run: |
75-
echo "Contents of cli-artifact-${{ matrix.code-target }} directory:"
76-
ls -R cli-artifact-${{ matrix.code-target }}
75+
echo "Contents of cli-artifact-${{ matrix.code-target }} directory:"
76+
ls -R cli-artifact-${{ matrix.code-target }}
7777
7878
# Rust toolchain setup (only needed for WASM part)
7979
- uses: dtolnay/rust-toolchain@stable
@@ -175,7 +175,6 @@ jobs:
175175
echo "Binary copied successfully for $CODE_TARGET."
176176
ls -l "$dest_path"
177177
178-
179178
- name: Install Dependencies
180179
# Install deps in the context of the specific extension package
181180
run: pnpm install --frozen-lockfile
@@ -185,7 +184,7 @@ jobs:
185184
# This might be redundant if it doesn't change per target,
186185
# but safer to run it. Consider optimizing if slow.
187186
# Run from root to build dependencies correctly.
188-
run: pnpm run build
187+
run: pnpm run build:release
189188
working-directory: typescript/
190189

191190
- name: Create dist directory
@@ -194,15 +193,15 @@ jobs:
194193
- name: Package VSCode Extension for ${{ matrix.code-target }}
195194
id: package
196195
run: |
197-
PRE_RELEASE_FLAG=""
198-
if [[ "${{ inputs.is_release_build }}" == "false" ]]; then
199-
PRE_RELEASE_FLAG="--pre-release"
200-
fi
201-
OUTPUT_FILENAME="dist/baml-${{ matrix.code-target }}.vsix"
202-
echo "Packaging for target: ${{ matrix.code-target }}"
203-
# Run vsce from the directory containing the extension's package.json
204-
npx @vscode/vsce package $PRE_RELEASE_FLAG --target ${{ matrix.code-target }} -o $OUTPUT_FILENAME --no-dependencies
205-
echo "vsix_path=$OUTPUT_FILENAME" >> $GITHUB_OUTPUT
196+
PRE_RELEASE_FLAG=""
197+
if [[ "${{ inputs.is_release_build }}" == "false" ]]; then
198+
PRE_RELEASE_FLAG="--pre-release"
199+
fi
200+
OUTPUT_FILENAME="dist/baml-${{ matrix.code-target }}.vsix"
201+
echo "Packaging for target: ${{ matrix.code-target }}"
202+
# Run vsce from the directory containing the extension's package.json
203+
npx @vscode/vsce package $PRE_RELEASE_FLAG --target ${{ matrix.code-target }} -o $OUTPUT_FILENAME --no-dependencies
204+
echo "vsix_path=$OUTPUT_FILENAME" >> $GITHUB_OUTPUT
206205
working-directory: typescript/vscode-ext/packages
207206

208207
- name: Upload VSIX artifact for ${{ matrix.code-target }}
@@ -227,4 +226,4 @@ jobs:
227226
# with:
228227
# name: vscode-playground
229228
# path: typescript/vscode-ext/packages/web-panel/dist
230-
# if-no-files-found: error
229+
# if-no-files-found: error

‎engine/language_client_python/src/runtime.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ impl BamlRuntime {
151151
})
152152
.collect::<Vec<_>>();
153153

154-
// let collector = collector.map(|c| c.inner.clone());
155154
pyo3_async_runtimes::tokio::future_into_py(py, async move {
156155
let (result, _) = baml_runtime
157156
.call_function(

‎engine/language_server/src/server/api/diagnostics.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,10 @@ pub fn publish_session_lsp_diagnostics(
9090
if !file_url.to_string().contains("baml_src") {
9191
return Ok(());
9292
}
93+
tracing::info!("publishing diagnostics for {}", file_url);
9394
let project = session
9495
.get_or_create_project(&path)
95-
.expect("We just ensured the session is valid");
96+
.expect("We just ensured the session is valid.");
9697

9798
let diagnostics = project_diagnostics(project.clone());
9899
for (uri, diagnostics) in diagnostics {

‎integ-tests/test.baml‎

Whitespace-only changes.

‎integ-tests/typescript/tests/modular.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('Modular API Tests', () => {
110110

111111
it('modular google gemini', async () => {
112112
const client = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY!)
113-
const model = client.getGenerativeModel({ model: 'gemini-1.5-pro-001' })
113+
const model = client.getGenerativeModel({ model: 'gemini-1.5-pro' })
114114

115115
const clientRegistry = new ClientRegistry()
116116
clientRegistry.setPrimary('Gemini')

‎typescript/turbo.json‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@
4848
"clean": {
4949
"cache": false
5050
},
51-
"baml-client#build": {
52-
"dependsOn": ["@gloo-ai/baml-language-server#build"],
53-
"outputs": ["out/**"]
54-
},
5551
"baml#vscode:package": {
5652
"dependsOn": ["baml-client#build"],
5753
"outputs": ["baml-*.vsix"]

‎typescript/vscode-ext/packages/language-server/.gitattributes‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎typescript/vscode-ext/packages/language-server/.gitignore‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎typescript/vscode-ext/packages/language-server/LICENSE‎

Lines changed: 0 additions & 201 deletions
This file was deleted.

‎typescript/vscode-ext/packages/language-server/README.md‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)