Repository navigation
fix(describe): hide language-internal functions - #4250
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 (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughFunction provenance is encapsulated in ChangesFunction metadata and visibility
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant LSP as LSP actions
participant Definition as Definition::is_language_internal
participant ItemTree as file_item_tree
LSP->>Definition: Check resolved definition visibility
Definition->>ItemTree: Read FunctionMetadata.is_language_internal
ItemTree-->>Definition: Return internal-visibility flag
Definition-->>LSP: Allow or filter listing and description
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: 3
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_project/src/symbols.rs (1)
130-135: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winExclude language-internal functions from the listing.
list_functions_with_metadatastill pushes every function; changing only the origin access does not hide functions markedmetadata.is_language_internal. Skip internal functions before constructingFunctionSymbol, while retaining user-facing companions.🤖 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_project/src/symbols.rs` around lines 130 - 135, Update list_functions_with_metadata to filter out functions whose metadata.is_language_internal is true before constructing or pushing FunctionSymbol. Preserve user-facing companion functions and the existing origin-based parameter handling for all non-internal functions.
🤖 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_compiler2_ast/src/lower_expr_body.rs`:
- Around line 4417-4419: Update the user-lambda lowering path around
FunctionMetadata::language_internal to use FunctionMetadata::user_facing with
FunctionOrigin::UserDefined. Preserve language_internal only for
compiler-synthesized functions so normal lambdas retain user-defined provenance
and remain visible to downstream paths.
In `@baml_language/crates/baml_lsp2_actions/src/actions.rs`:
- Around line 82-84: Update the function filtering condition in the code-action
generation flow to continue when either the origin is not
FunctionOrigin::UserDefined or func.metadata.is_language_internal is true.
Preserve the existing origin check while excluding language-internal functions
from RunInPlayground code lenses.
In `@baml_language/crates/baml_project/src/client_codegen.rs`:
- Around line 200-202: Update the SDK filtering conditions around the visible
AutoDerive check and its corresponding free-function filter to also exclude
methods whose metadata.is_language_internal flag is true. Retain the existing
FunctionOrigin::AutoDerive and FunctionOrigin::Internal exclusions, applying the
metadata visibility check in both locations.
---
Outside diff comments:
In `@baml_language/crates/baml_project/src/symbols.rs`:
- Around line 130-135: Update list_functions_with_metadata to filter out
functions whose metadata.is_language_internal is true before constructing or
pushing FunctionSymbol. Preserve user-facing companion functions and the
existing origin-based parameter handling for all non-internal functions.
🪄 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: 9ca5fc2d-96df-4529-81ae-54467e58af15
📒 Files selected for processing (24)
baml_language/crates/baml_compiler2_ast/src/ast.rsbaml_language/crates/baml_compiler2_ast/src/companions.rsbaml_language/crates/baml_compiler2_ast/src/lib.rsbaml_language/crates/baml_compiler2_ast/src/lower_cst.rsbaml_language/crates/baml_compiler2_ast/src/lower_expr_body.rsbaml_language/crates/baml_compiler2_emit/src/lib.rsbaml_language/crates/baml_compiler2_hir/src/builder.rsbaml_language/crates/baml_compiler2_hir/src/contributions.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/builder.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/functions.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/functions.rsbaml_language/crates/baml_compiler2_ppir/src/lib.rsbaml_language/crates/baml_compiler2_tir/src/inference.rsbaml_language/crates/baml_lsp2_actions/src/actions.rsbaml_language/crates/baml_lsp2_actions/src/annotations.rsbaml_language/crates/baml_lsp2_actions/src/describe.rsbaml_language/crates/baml_lsp2_actions/src/listing.rsbaml_language/crates/baml_lsp2_actions/src/listing_tests.rsbaml_language/crates/baml_lsp2_actions/src/outline.rsbaml_language/crates/baml_lsp2_actions/src/utils.rsbaml_language/crates/baml_project/src/client_codegen.rsbaml_language/crates/baml_project/src/db.rsbaml_language/crates/baml_project/src/symbols.rsbaml_language/crates/baml_tests/src/incremental/scenarios.rs
Summary
Validation
Summary by CodeRabbit