Repository navigation
Dim BAML namespace prefixes in editors - #4168
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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 (16)
📝 WalkthroughWalkthroughQualified path separators are now emitted as namespace semantic tokens when resolvable, semantic-token results are sorted by source range, tests update expected streams, and VS Code/Monaco semantic highlighting is enabled for BAML namespaces. ChangesSemantic token classification
Estimated code review effort: 3 (Moderate) | ~25 minutes 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 |
⏭️ 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):
|
Binary size checks passed✅ 7 passed
Generated by |
Summary
Why
Namespace prefixes should recede so type and function names stay visually prominent. Monaco previously discarded the semantic token stream because qualified type tokens could be emitted out of order, producing wrapped negative column deltas.
Impact
root.blah.Hiandbaml.json.jsondim their namespace prefixes and dots. Member and enum dots remain unchanged. The neutral alpha color adapts across light and dark themes and remains user-overridable.Validation
cargo nextest run -p baml_lsp2_actions_tests 'test_files::semantic_tokens::'(80 passed)cargo nextest run -p baml_lsp2_actions_tests 'range_tokens_test::tests::'(2 passed)pnpm --filter app-promptfiddle typecheckpnpm --filter app-promptfiddle buildpnpm --filter baml-language buildNote
Low Risk
Changes are confined to LSP semantic token classification, ordering, and editor theme defaults; no runtime, auth, or data-path impact.
Overview
Namespace path segments and their separating dots are now classified as namespace semantic tokens when resolution confirms a real namespace prefix (value paths and qualified type names). Dots before members, enums, or non-namespace segments stay operators.
Document order: Full-file and in-range semantic token results are sorted by span after the walk. That fixes Monaco rejecting streams when qualified type highlighting emitted segment tokens before their dots (invalid LSP deltas).
Editors: VS Code and the PromptFiddle Monaco embed enable semantic highlighting and apply a semi-transparent gray rule for
namespace:bamlso prefixes likebaml.jsonrecede while type and function names stay prominent.Reviewed by Cursor Bugbot for commit 3b5b407. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Bug Fixes
Tests