feat(cli): add syntax highlighting to diagnostics - #4159
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR replaces Ariadne-based human diagnostics with Miette, adds structured diagnostic message highlights, applies semantic token highlights in CLI output, preserves highlight metadata in caches, updates compiler and TIR diagnostic construction, and refreshes LSP and diagnostic-rendering fixtures. ChangesDiagnostic rendering migration
Estimated code review effort: 5 (Critical) | ~100 minutes Sequence Diagram(s)sequenceDiagram
participant CLI
participant ProjectDatabase
participant Highlighter
participant DiagnosticRenderer
participant Miette
CLI->>ProjectDatabase: collect diagnostics and source files
CLI->>Highlighter: generate HighlightSpan values
CLI->>DiagnosticRenderer: render diagnostics with highlights
DiagnosticRenderer->>Miette: render Human output
Miette-->>CLI: formatted diagnostic block
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Binary size checks passed✅ 7 passed
Generated by |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
baml_language/crates/baml_cli/src/diagnostics_cache.rs (1)
57-65: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winTest non-empty
message_highlightsround trips.The current fixtures use empty vectors, so they cannot detect omitted or reordered highlight data. Populate diagnostic, annotation, and related-info highlights and assert that the restored diagnostic preserves them.
Also applies to: 75-75
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_cli/src/diagnostics_cache.rs` around lines 57 - 65, Update the diagnostics cache round-trip tests around the diagnostic, annotation, and CachedRelatedInfo fixtures to use non-empty message_highlights with distinguishable entries, then assert the deserialized diagnostic preserves each vector’s contents and ordering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@baml_language/crates/baml_cli/src/diagnostics_cache.rs`:
- Around line 57-65: Update the diagnostics cache verification flow around
rehydrate_file_blob() to invalidate legacy blobs on the first BAML_CACHE_VERIFY
run using an external cache/version marker. Add a regression fixture containing
a pre-additions Borsh blob that rehydrates an annotation into
message_highlights, and assert that verification rejects it rather than
accepting the decoded data.
---
Nitpick comments:
In `@baml_language/crates/baml_cli/src/diagnostics_cache.rs`:
- Around line 57-65: Update the diagnostics cache round-trip tests around the
diagnostic, annotation, and CachedRelatedInfo fixtures to use non-empty
message_highlights with distinguishable entries, then assert the deserialized
diagnostic preserves each vector’s contents and ordering.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1bb63e6d-446c-46dd-91ea-fd5c73324355
⛔ Files ignored due to path filters (89)
baml_language/crates/baml_tests/snapshots/broken_syntax/banned_expressions/baml_tests__broken_syntax__banned_expressions__02_parser__banned_expressions.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/banned_expressions/baml_tests__broken_syntax__banned_expressions__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/braceless_lambda/baml_tests__broken_syntax__braceless_lambda__02_parser__braceless_lambda.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/braceless_lambda/baml_tests__broken_syntax__braceless_lambda__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/error_cases/baml_tests__broken_syntax__error_cases__02_parser__syntax_errors.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/error_cases/baml_tests__broken_syntax__error_cases__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/header_in_llm_function/baml_tests__broken_syntax__header_in_llm_function__02_parser__test.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/header_in_llm_function/baml_tests__broken_syntax__header_in_llm_function__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/is_in_type_position/baml_tests__broken_syntax__is_in_type_position__02_parser__main.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/is_in_type_position/baml_tests__broken_syntax__is_in_type_position__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/mismatched_brackets/baml_tests__broken_syntax__mismatched_brackets__02_parser__main.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/mismatched_brackets/baml_tests__broken_syntax__mismatched_brackets__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/namespaces_same_name/baml_tests__broken_syntax__namespaces_same_name__02_parser__main.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/namespaces_same_name/baml_tests__broken_syntax__namespaces_same_name__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/optional_parameter_defaults/baml_tests__broken_syntax__optional_parameter_defaults__02_parser__callback_param_defaults.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/optional_parameter_defaults/baml_tests__broken_syntax__optional_parameter_defaults__02_parser__function_type_defaults.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/optional_parameter_defaults/baml_tests__broken_syntax__optional_parameter_defaults__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_error_recovery/baml_tests__broken_syntax__parser_error_recovery__02_parser__invalid_syntax.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_error_recovery/baml_tests__broken_syntax__parser_error_recovery__02_parser__missing_braces.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_error_recovery/baml_tests__broken_syntax__parser_error_recovery__02_parser__partial_input.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_error_recovery/baml_tests__broken_syntax__parser_error_recovery__02_parser__unclosed_string.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_error_recovery/baml_tests__broken_syntax__parser_error_recovery__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_speculative/baml_tests__broken_syntax__parser_speculative__02_parser__ambiguous_function.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_speculative/baml_tests__broken_syntax__parser_speculative__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_strings/baml_tests__broken_syntax__parser_strings__02_parser__nested_quotes.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_strings/baml_tests__broken_syntax__parser_strings__02_parser__unicode_strings.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_strings/baml_tests__broken_syntax__parser_strings__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/patterns_array_rest_parser_recovery/baml_tests__broken_syntax__patterns_array_rest_parser_recovery__02_parser__patterns_array_rest_parser_recovery.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/patterns_array_rest_parser_recovery/baml_tests__broken_syntax__patterns_array_rest_parser_recovery__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/pending_greaters_fix/baml_tests__broken_syntax__pending_greaters_fix__02_parser__extra_greater.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/pending_greaters_fix/baml_tests__broken_syntax__pending_greaters_fix__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/postfix_non_null_assertion/baml_tests__broken_syntax__postfix_non_null_assertion__02_parser__main.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/postfix_non_null_assertion/baml_tests__broken_syntax__postfix_non_null_assertion__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/stream_annotations/baml_tests__broken_syntax__stream_annotations__02_parser__main.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/stream_annotations/baml_tests__broken_syntax__stream_annotations__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/test_invalid_contexts/baml_tests__broken_syntax__test_invalid_contexts__02_parser__main.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/test_invalid_contexts/baml_tests__broken_syntax__test_invalid_contexts__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/type_annotation_errors/baml_tests__broken_syntax__type_annotation_errors__02_parser__type_malformed.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/type_annotation_errors/baml_tests__broken_syntax__type_annotation_errors__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/compiles/catch_throw/baml_tests__compiles__catch_throw__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/anyfunction/baml_tests__diagnostic_errors__anyfunction__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/assignment_expr_position/baml_tests__diagnostic_errors__assignment_expr_position__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/attr_disambiguation/baml_tests__diagnostic_errors__attr_disambiguation__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/backtick_interp_type_errors/baml_tests__diagnostic_errors__backtick_interp_type_errors__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/backtick_strict_types/baml_tests__diagnostic_errors__backtick_strict_types__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/basic_types/baml_tests__diagnostic_errors__basic_types__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/builtin_io/baml_tests__diagnostic_errors__builtin_io__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/captured_field_chain/baml_tests__diagnostic_errors__captured_field_chain__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/catch_arm_braceless_return/baml_tests__diagnostic_errors__catch_arm_braceless_return__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/catch_return_type_mismatch/baml_tests__diagnostic_errors__catch_return_type_mismatch__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/catch_throw_regressions/baml_tests__diagnostic_errors__catch_throw_regressions__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/closure_errors/baml_tests__diagnostic_errors__closure_errors__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/control_flow/baml_tests__diagnostic_errors__control_flow__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/format_checks/baml_tests__diagnostic_errors__format_checks__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/function_type_missing_throws/baml_tests__diagnostic_errors__function_type_missing_throws__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/function_type_throws/baml_tests__diagnostic_errors__function_type_throws__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/function_types/baml_tests__diagnostic_errors__function_types__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/generic_call_ambiguity/baml_tests__diagnostic_errors__generic_call_ambiguity__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/generic_class_destructure_no_type_args/baml_tests__diagnostic_errors__generic_class_destructure_no_type_args__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/generic_error_arg_no_cascade/baml_tests__diagnostic_errors__generic_error_arg_no_cascade__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/generics/baml_tests__diagnostic_errors__generics__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/headers_edge_cases/baml_tests__diagnostic_errors__headers_edge_cases__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/invalid_numeric_literals/baml_tests__diagnostic_errors__invalid_numeric_literals__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/is_pattern_negative/baml_tests__diagnostic_errors__is_pattern_negative__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/json_alias/baml_tests__diagnostic_errors__json_alias__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/json_static_method_arity/baml_tests__diagnostic_errors__json_static_method_arity__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/lambda_errors/baml_tests__diagnostic_errors__lambda_errors__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/lexical_scoping_errors/baml_tests__diagnostic_errors__lexical_scoping_errors__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/match_exhaustiveness/baml_tests__diagnostic_errors__match_exhaustiveness__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/namespaces_bare_name_rejected/baml_tests__diagnostic_errors__namespaces_bare_name_rejected__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/namespaces_stream_direct_ref/baml_tests__diagnostic_errors__namespaces_stream_direct_ref__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/null_handling/baml_tests__diagnostic_errors__null_handling__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/numeric_invariance/baml_tests__diagnostic_errors__numeric_invariance__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/optional_parameter_defaults/baml_tests__diagnostic_errors__optional_parameter_defaults__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/patterns_array_rest_binding/baml_tests__diagnostic_errors__patterns_array_rest_binding__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/patterns_class_destructure/baml_tests__diagnostic_errors__patterns_class_destructure__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/patterns_class_destructure_namespaces/baml_tests__diagnostic_errors__patterns_class_destructure_namespaces__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/patterns_new/baml_tests__diagnostic_errors__patterns_new__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/runtime_id_misuse/baml_tests__diagnostic_errors__runtime_id_misuse__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/self_in_body/baml_tests__diagnostic_errors__self_in_body__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/simple_function/baml_tests__diagnostic_errors__simple_function__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/simple_type_error/baml_tests__diagnostic_errors__simple_type_error__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/test_expr_name_type_error/baml_tests__diagnostic_errors__test_expr_name_type_error__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/test_expr_wrong_runner/baml_tests__diagnostic_errors__test_expr_wrong_runner__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/test_with_runner_ambiguity/baml_tests__diagnostic_errors__test_with_runner_ambiguity__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/type_aliases/baml_tests__diagnostic_errors__type_aliases__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/type_reflection_strict/baml_tests__diagnostic_errors__type_reflection_strict__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/unknown_type_error/baml_tests__diagnostic_errors__unknown_type_error__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/void_return_type/baml_tests__diagnostic_errors__void_return_type__05_diagnostics.snapis excluded by!**/*.snap
📒 Files selected for processing (11)
baml_language/crates/baml_cli/src/diagnostics_cache.rsbaml_language/crates/baml_compiler_diagnostics/src/diagnostic.rsbaml_language/crates/baml_compiler_diagnostics/src/lib.rsbaml_language/crates/baml_compiler_diagnostics/src/message.rsbaml_language/crates/baml_compiler_diagnostics/src/render.rsbaml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rsbaml_language/crates/baml_lsp2_actions/src/check.rsbaml_language/crates/baml_tests/src/compiler2_tir/inference.rsbaml_language/crates/baml_tests/src/compiler2_tir/phase3a.rsbaml_language/crates/bex_cache/src/lib.rsbaml_language/crates/bex_project/src/bex_lsp/multi_project/diagnostics.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- baml_language/crates/baml_compiler_diagnostics/src/lib.rs
- baml_language/crates/baml_compiler_diagnostics/src/render.rs
…ght-diagnostics # Conflicts: # baml_language/crates/baml_tests/snapshots/diagnostic_errors/lambda_errors/baml_tests__diagnostic_errors__lambda_errors__05_diagnostics.snap
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
baml_language/crates/baml_compiler_parser/src/parser.rs (1)
6082-6087: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRemove redundant quotes around punctuation in the diagnostic.
Because
punctalready contains'.'or'$', the rendered message becomesfield name after \'.'`instead offield name after `.``.Suggested fix
- let punct = if op == TokenKind::Dollar { - "'$'" - } else { - "'.'" - }; + let punct = if op == TokenKind::Dollar { "$" } else { "." };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_compiler_parser/src/parser.rs` around lines 6082 - 6087, Update the diagnostic construction in the unexpected-token handling block to keep punct as the raw punctuation character and retain the existing backtick formatting, so the message renders field name after `.` or field name after `$` without redundant inner quotes.
🧹 Nitpick comments (1)
baml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rs (1)
626-632: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the complete parse diagnostic label.
The test only checks
"expected", so it would pass if thefoundfragment disappeared. Assert both expected and found values to cover the structured-label migration.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rs` around lines 626 - 632, Strengthen the diagnostic assertion in the relevant test by checking the complete annotation label, including both the expected and found token fragments. Replace the partial contains("expected") check with an assertion that verifies the exact structured label produced by the parser diagnostic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@baml_language/crates/baml_compiler_parser/src/parser.rs`:
- Around line 3938-3940: Update the unmatched-greater diagnostic at both
declaration parameter-list and expression generic-argument branches to use
context-specific wording instead of “type expression.” Ensure the first message
identifies unmatched closers in declaration parameters and the second identifies
unmatched closers in expression generic arguments, while preserving the
pending_greaters count.
In
`@baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/complex_headers_test.baml`:
- Around line 69-76: Update the expected diagnostic for the mismatched-types
error so its location points to line 44, where final_result appears, and its
rendered source excerpt also shows the line 44 source text. Keep the error
message and surrounding diagnostic formatting unchanged.
In
`@baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/hover/catch_rethrow_caller.baml`:
- Around line 29-35: Update the E0063 expectation for the unreachable arm in
catch_rethrow_caller.baml so its reported location and underline cover the same
source bytes; align the span to the `{ throw e }` region at column 26 or
restrict it to `throw e` beginning at column 28, preserving the diagnostic’s
intended location.
In
`@baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/compound_ops.baml`:
- Around line 38-65: Add the missing E0004 expected diagnostic in the compound
assignment test for the fifth invalid case, `g += "add"` at line 31, covering
the float-plus-string operator mismatch. Preserve the existing expectations for
the four earlier invalid assignments and match the established diagnostic
formatting.
In
`@baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/for.baml`:
- Around line 63-77: Restore the omitted diagnostics in both golden snapshots:
in baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/for.baml
lines 63-77, append the E0001 type-mismatch diagnostic for b = x at source line
31; in
baml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/type_aliases_jinja.baml
lines 67-94, append the structured diagnostic for the I -> J type-alias
dependency cycle. Preserve all existing diagnostics and update only the expected
rendering.
In
`@baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_basic_syntax.baml`:
- Around line 30-36: The E0097 diagnostic for the extraneous throws declaration
in the basic throw syntax test currently spans the entire union. Update the
diagnostic range calculation to target only the invalid int member in the throws
union, while leaving the valid string member unhighlighted before rendering.
In
`@baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_enum_exact_match.baml`:
- Around line 19-32: Align the expected diagnostics for ThrowsEnumExact with the
test’s exact enum throws-match contract: remove or restore the E0096 and E0097
expectation blocks so the fixture remains silent when no diagnostic is intended;
only retain updated commentary if those errors are intentionally expected.
---
Outside diff comments:
In `@baml_language/crates/baml_compiler_parser/src/parser.rs`:
- Around line 6082-6087: Update the diagnostic construction in the
unexpected-token handling block to keep punct as the raw punctuation character
and retain the existing backtick formatting, so the message renders field name
after `.` or field name after `$` without redundant inner quotes.
---
Nitpick comments:
In `@baml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rs`:
- Around line 626-632: Strengthen the diagnostic assertion in the relevant test
by checking the complete annotation label, including both the expected and found
token fragments. Replace the partial contains("expected") check with an
assertion that verifies the exact structured label produced by the parser
diagnostic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a4a046e9-e15f-4729-8285-789e8b41da4b
⛔ Files ignored due to path filters (26)
baml_language/crates/baml_cli/src/snapshots/baml_cli__describe_command_tests__render_keyword_ts_instanceof.snapis excluded by!**/*.snapbaml_language/crates/baml_cli/src/snapshots/baml_cli__describe_command_tests__render_keyword_ts_new.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/header_in_llm_function/baml_tests__broken_syntax__header_in_llm_function__02_parser__test.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/header_in_llm_function/baml_tests__broken_syntax__header_in_llm_function__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_error_recovery/baml_tests__broken_syntax__parser_error_recovery__02_parser__partial_input.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/parser_error_recovery/baml_tests__broken_syntax__parser_error_recovery__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/pending_greaters_fix/baml_tests__broken_syntax__pending_greaters_fix__02_parser__extra_greater.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/pending_greaters_fix/baml_tests__broken_syntax__pending_greaters_fix__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/broken_syntax/stream_annotations/baml_tests__broken_syntax__stream_annotations__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/compiles/namespaces_shadow/baml_tests__compiles__namespaces_shadow__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/attribute_validation/baml_tests__diagnostic_errors__attribute_validation__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/basic_types/baml_tests__diagnostic_errors__basic_types__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/duplicate_attribute/baml_tests__diagnostic_errors__duplicate_attribute__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/duplicate_class_span/baml_tests__diagnostic_errors__duplicate_class_span__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/duplicate_field_alias/baml_tests__diagnostic_errors__duplicate_field_alias__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/duplicate_field_no_cascade/baml_tests__diagnostic_errors__duplicate_field_no_cascade__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/duplicate_method_no_cascade/baml_tests__diagnostic_errors__duplicate_method_no_cascade__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/duplicate_parameter_no_cascade/baml_tests__diagnostic_errors__duplicate_parameter_no_cascade__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/duplicate_variant_alias/baml_tests__diagnostic_errors__duplicate_variant_alias__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/field_method_conflict_no_cascade/baml_tests__diagnostic_errors__field_method_conflict_no_cascade__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/format_checks/baml_tests__diagnostic_errors__format_checks__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/namespaces_conflict/baml_tests__diagnostic_errors__namespaces_conflict__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/parser_constructors/baml_tests__diagnostic_errors__parser_constructors__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/patterns_class_destructure/baml_tests__diagnostic_errors__patterns_class_destructure__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/patterns_new/baml_tests__diagnostic_errors__patterns_new__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/stream_types/baml_tests__diagnostic_errors__stream_types__05_diagnostics.snapis excluded by!**/*.snap
📒 Files selected for processing (203)
baml_language/crates/baml_cli/src/agent_command.rsbaml_language/crates/baml_cli/src/describe_command.rsbaml_language/crates/baml_cli/src/describe_command_tests.rsbaml_language/crates/baml_cli/src/generate.rsbaml_language/crates/baml_cli/src/grep_command.rsbaml_language/crates/baml_cli/src/init_command.rsbaml_language/crates/baml_cli/src/pack_command.rsbaml_language/crates/baml_cli/src/pack_elf.rsbaml_language/crates/baml_cli/src/playground_command.rsbaml_language/crates/baml_cli/src/project_load.rsbaml_language/crates/baml_cli/src/run_command.rsbaml_language/crates/baml_cli/src/test_command.rsbaml_language/crates/baml_compiler2_ast/src/lowering_diagnostic.rsbaml_language/crates/baml_compiler2_hir/src/diagnostic.rsbaml_language/crates/baml_compiler2_hir/src/namespace.rsbaml_language/crates/baml_compiler2_hir/src/package.rsbaml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rsbaml_language/crates/baml_compiler_parser/src/parser.rsbaml_language/crates/baml_exec/src/auto_cli.rsbaml_language/crates/baml_exec/src/diag_print.rsbaml_language/crates/baml_exec/src/dispatch.rsbaml_language/crates/baml_exec/src/json_coerce.rsbaml_language/crates/baml_lsp2_actions/src/check.rsbaml_language/crates/baml_lsp2_actions_tests/src/parser.rsbaml_language/crates/baml_lsp2_actions_tests/test_files/completion/baml_namespace.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/completion/block_attribute.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/completion/field_attribute.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/completion/type_position.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/inlay_hints/for_loops.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/on_hover/unknown_variable.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/block_attributes.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/class.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/const_binding.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/const_let_else_defer.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/generators.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/if_let_chain.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/map_literal_keys.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/throws_clause.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/semantic_tokens/type_aliases_jinja.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/catch_all_exhaustive.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/catch_bare_type_sugar.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/catch_binding_narrowing.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/catch_on_non_call.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/catch_throw_set_reachability.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/catch_wildcard_only.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/chained_catch.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/exhaustiveness_checks.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/invalid_arm_syntax.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/missing_binding_pattern.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/catch/nested_catch.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/attributes.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/extra_greater_in_generic.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/generator_keywords1.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/incomplete_class.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/invalid_attrs_on_type_alias.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/invalid_keyword_in_type_def.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/invalid_type_aliases.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/map_enums_and_literals.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/map_types.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/map_types2.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/misspeled_boolean_literals.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/partial_class.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/secure_types.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/spelling_error.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/type_aliases_jinja.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/unknown_type.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/class/unsupported_literal_types.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/client/remap_role_invalid_type.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/client/remap_role_non_string_allowed_roles.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/client/remap_role_non_string_values.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/enum/duplicate_value.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/enum/enum_unquoted_description.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/enum/invalid_value_expr.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/const_binding.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/const_reserved_binding_names.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/constructors_invalid.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/early_return_narrowing.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/expr_full.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/extra_dot.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/fn_arg_type_error.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/instanceof_narrowing.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/let_annotations.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/missing_return_value.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/missing_semicolons.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/unknown_field_access.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/unknown_name.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/unresolved_builtin_namespace.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/expr/var_keyword_let_await.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/duplicate_names.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/invalid.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/invalid2.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/invalid_no_return.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/match.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/prompt_errors/prompt1.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/shorthand_clients.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/ai_content_pipeline.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/basic_if.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/complex_headers_test.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/duplicate_function_calls.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/header_in_llm_function.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/if_then_else.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/if_then_only_header.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/invalid.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/headers/nested_if_statements.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/hover/catch_rethrow.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/hover/catch_rethrow_caller.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/hover/function_throws.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/if_let/if_let_binding_scope.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/if_let/if_let_chained.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/if_let/if_let_destructure.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/if_let/if_let_irrefutable_warns.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/if_let/if_let_no_else_in_value_position.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/if_let/if_let_or_pattern.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/if_let/if_let_throws.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/duplicate_implements.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_ambiguous_interface_field_access.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_ambiguous_method_call.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_as_downcast_interface_to_child.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_concrete_field_through_interface_type.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_default_method_non_exhaustive.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_default_on_required_method.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_default_outside_implements.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_duplicate_interface_field_link.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_field_declared_in_implements_block.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_field_rule_invariant_union.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_generic_bound_alias_not_supported.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_generic_bound_violation.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_generic_requires_cycle_changes_args.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_invariant_generic_assignment.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_match_without_wildcard.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_missing_field_in_implements_block.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_missing_required_interface.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_multi_self_call_on_interface_receiver.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_old_qualified_projection.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_out_of_body_field_interface.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_qualified_call_non_implementor.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_qualified_call_unknown_interface.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_self_outside_type.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_unknown_class_field_link.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/error_unknown_interface_field_link.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/extends_cycle.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/field_type_mismatch.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/method_signature_mismatch.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/missing_required_method.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/unknown_interface.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/interface/unknown_interface_member.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/arrays.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/class_arrays.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/classes.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/compound_ops.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/maps.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/nested_arrays.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/nominal_typing.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/optionals.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/invalid_assignment/primitives.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/iterator/stdlib_iterator_errors.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_destructure.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_diverges_loop.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_else_no_bindings.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_irrefutable_warns.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_must_diverge.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_no_else_if.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_or_pattern.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_throws.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/let_else/let_else_wildcard_irrefutable.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/break.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/c_for.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/const_for_loops.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/continue.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/for.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/header_requires_let_negative.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/loops/header_requires_let_positive.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/maps/inconsistent_style.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/maps/key_and_value_typecheck.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/match/match_non_exhaustive.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/match/match_unreachable_arms.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/match/match_with_guards.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/misc/bad_syntax.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/misc/dynamic_types_parser_errors.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/misc/dynamic_types_validation_errors.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/misc/return.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/parens.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/streaming/streaming_ok.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/strings/unquoted_strings.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/template_string/bad_calls.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throw_basic.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throw_expression.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throw_in_catch.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throw_with_catch.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_basic_syntax.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_caller_sees_contract.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_caller_variant_contract.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_contract_violation.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_enum_exact_match.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_enum_extraneous.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_enum_variant_precise.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_enum_variant_violation.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_mixed.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_never_unreachable_rethrow.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_never_violation.bamlbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_type_alias_repro.bamlbaml_language/crates/baml_release/src/lib.rsbaml_language/crates/baml_release/src/skills.rs
🚧 Files skipped from review as they are similar to previous changes (4)
- baml_language/crates/baml_cli/src/test_command.rs
- baml_language/crates/baml_lsp2_actions/src/check.rs
- baml_language/crates/baml_cli/src/pack_command.rs
- baml_language/crates/baml_cli/src/generate.rs
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
baml_language/crates/baml_cli/src/describe_command_tests.rs (1)
1066-1075: 📐 Maintainability & Code Quality | 🟠 Major | ⚖️ Poor tradeoffRun
cargo test --libin a proper build environment.The repository build cannot run here (
aws-lc-sys/ringfail to compile from missing standard C headers), so this manual step must be completed elsewhere before merge.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_cli/src/describe_command_tests.rs` around lines 1066 - 1075, Run cargo test --lib in a properly configured build environment and resolve any failures before merging, including validating the render_keyword_test and render_keyword_testset snapshot tests.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@baml_language/crates/baml_cli/src/describe_command_tests.rs`:
- Around line 1066-1075: Run cargo test --lib in a properly configured build
environment and resolve any failures before merging, including validating the
render_keyword_test and render_keyword_testset snapshot tests.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1dabd5fb-2dcb-4df9-9944-45f2a2c934da
⛔ Files ignored due to path filters (2)
baml_language/Cargo.lockis excluded by!**/*.lockbaml_language/crates/baml_tests/snapshots/diagnostic_errors/lambda_errors/baml_tests__diagnostic_errors__lambda_errors__05_diagnostics.snapis excluded by!**/*.snap
📒 Files selected for processing (5)
baml_language/crates/baml_cli/src/describe_command_tests.rsbaml_language/crates/baml_cli/src/test_command.rsbaml_language/crates/baml_compiler_parser/src/parser.rsbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_enum_exact_match.bamlbaml_language/crates/bex_cache/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (4)
- baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/throw/throws_enum_exact_match.baml
- baml_language/crates/baml_cli/src/test_command.rs
- baml_language/crates/bex_cache/src/lib.rs
- baml_language/crates/baml_compiler_parser/src/parser.rs
…ght-diagnostics # Conflicts: # baml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/match.baml # baml_language/crates/baml_tests/snapshots/diagnostic_errors/format_checks/baml_tests__diagnostic_errors__format_checks__05_diagnostics.snap # baml_language/crates/baml_tests/snapshots/diagnostic_errors/match_exhaustiveness/baml_tests__diagnostic_errors__match_exhaustiveness__05_diagnostics.snap
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@baml_language/.ci/size-gate/aarch64-apple-darwin.toml`:
- Around line 5-9: Regenerate the macOS size snapshot for the artifacts.baml-cli
entry using the same artifact and local build measurement path, then update
file_bytes, stripped_bytes, and gzip_bytes with the resulting self-consistent
values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 769bdd0f-0e5a-4f53-8a50-8418522f5b65
⛔ Files ignored due to path filters (3)
baml_language/Cargo.lockis excluded by!**/*.lockbaml_language/crates/baml_tests/snapshots/diagnostic_errors/format_checks/baml_tests__diagnostic_errors__format_checks__05_diagnostics.snapis excluded by!**/*.snapbaml_language/crates/baml_tests/snapshots/diagnostic_errors/match_exhaustiveness/baml_tests__diagnostic_errors__match_exhaustiveness__05_diagnostics.snapis excluded by!**/*.snap
📒 Files selected for processing (20)
baml_language/.cargo/size-gate.tomlbaml_language/.ci/size-gate/aarch64-apple-darwin.tomlbaml_language/.ci/size-gate/wasm32-unknown-unknown.tomlbaml_language/.ci/size-gate/x86_64-pc-windows-msvc.tomlbaml_language/.ci/size-gate/x86_64-unknown-linux-gnu.tomlbaml_language/crates/baml_cli/tests/agent_install_e2e.rsbaml_language/crates/baml_cli/tests/exit_code_e2e.rsbaml_language/crates/baml_cli/tests/skill_warning_e2e.rsbaml_language/crates/baml_compiler_diagnostics/src/render.rsbaml_language/crates/baml_lsp2_actions_tests/test_files/syntax/functions_v2/match.bamlbaml_language/crates/baml_project/src/testing.rsbaml_language/crates/baml_tests/tests/comparable_sort.rsbaml_language/crates/baml_tests/tests/from_json_interface.rsbaml_language/crates/baml_tests/tests/interfaces.rsbaml_language/crates/baml_tests/tests/interfaces_associated_types.rsbaml_language/crates/baml_tests/tests/interfaces_class_generics.rsbaml_language/crates/baml_tests/tests/tagged_template_lowering.rsbaml_language/crates/baml_tests/tests/to_json_interface.rsbaml_language/crates/baml_tests/tests/to_string_interface.rsbaml_language/crates/baml_tests/tests/tostring_sugar.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- baml_language/crates/baml_compiler_diagnostics/src/render.rs
Summary
Testing
Summary by CodeRabbit
New Features
Bug Fixes
Chores / Tests