Skip to content
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

Fix windows generation through vscode always outputting to the root workspace directory if the path was ../ #1247

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

aaronvg
Copy link
Contributor

@aaronvg aaronvg commented Dec 16, 2024

The issue for windows is that g.output_dir is always /baml_client when the user set it to ../. Rather than have rust try to do fancy things like resolve the output directory (which doesn't seem to work in wasm in windows), give VSCode the relative path to baml_src, since vscode can build it from the project.path

Important

Fixes file generation path issue in baml_project_manager.ts and updates dunce package version in Cargo.lock.

  • Behavior:
    • Fixes file generation path issue in baml_project_manager.ts by using output_dir_relative_to_baml_src for output directory.
    • Logs output directory paths for debugging.
  • Dependencies:
    • Updates dunce package version from 1.0.4 to 1.0.5 in Cargo.lock.

This description was created by Ellipsis for 594a4cd. It will automatically update as commits are pushed.

Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baml ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 3:48am

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to b899550 in 20 seconds

More details
  • Looked at 100 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. engine/Cargo.lock:1683
  • Draft comment:
    Ensure that the update of the dunce crate from version 1.0.4 to 1.0.5 is compatible with the rest of the codebase. Check for any breaking changes or deprecations in the new version.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR updates the dunce crate version in Cargo.lock from 1.0.4 to 1.0.5. This change should be verified to ensure compatibility and correctness.
2. engine/baml-schema-wasm/src/runtime_wasm/generator.rs:9
  • Draft comment:
    Ensure that the new field output_dir_relative_to_baml_src is correctly populated and used throughout the codebase. Verify that it does not introduce any unintended side effects.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR adds a new field output_dir_relative_to_baml_src to the WasmGeneratorOutput struct. This change is reflected in the Into implementation for WasmGeneratorOutput.
3. typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts:377
  • Draft comment:
    Ensure that the out_dir is correctly constructed and used in place of g.output_dir. Verify that this change resolves the issue of incorrect output directory and does not introduce new bugs.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR modifies the logic to use out_dir instead of g.output_dir directly. This change is intended to fix the issue of outputting to the root workspace directory.
4. typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts:394
  • Draft comment:
    Ensure that all instances where g.output_dir is replaced with out_dir are consistent and correct. This change appears in multiple places, such as lines 395, 422, and 424.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR modifies multiple instances where g.output_dir is replaced with out_dir. This change should be consistent across all usages to ensure correctness.

Workflow ID: wflow_uO04RbOhhYmldVsA


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 594a4cd in 27 seconds

More details
  • Looked at 24 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts:434
  • Draft comment:
    Consider using utimesSync or promisify to handle utimes as a promise for consistency with the rest of the code.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. typescript/vscode-ext/packages/language-server/src/lib/baml_project_manager.ts:374
  • Draft comment:
    Remove or replace console.log with a proper logging mechanism for production code. This applies to other console.log statements as well.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The console.log statements for debugging should be removed or replaced with a proper logging mechanism before merging the PR.

Workflow ID: wflow_2GDplbJhOr2Ak3O4


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@aaronvg aaronvg added this pull request to the merge queue Dec 16, 2024
Merged via the queue into canary with commit cdc1838 Dec 16, 2024
11 checks passed
@aaronvg aaronvg deleted the windows-path-fix branch December 16, 2024 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant