feat(angular): support @-blocks - #160
Conversation
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds Angular ChangesAngular
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/compiler.rs (1)
21-146: ⚡ Quick winAdd at least one pretty-mode Angular compiler assertion.
compile_angular_nodeandcompile_block_bodynow have separate pretty-print branches, but every new Angular compiler test here goes throughcompile_content_core, so only compact output is exercised. A small pretty-mode regression for something like@ifplus@switchwould protect the new indentation/newline path 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 `@tests/compiler.rs` around lines 21 - 146, Add a new test in the same tests/compiler.rs that exercises the pretty-print branch for Angular output (so the new pretty-mode code paths in compile_angular_node and compile_block_body are covered) — create a small input containing an Angular combination such as an `@if` followed by an `@switch`, call the pretty-mode compiler helper (invoke whatever test helper triggers pretty printing — e.g., a compile_content_pretty or compile_content_core with a pretty=true flag) and assert the expected pretty-formatted HTML string; reference compile_angular_node and compile_block_body as the targeted code paths and keep the test similar in style to existing ones.
🤖 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.
Nitpick comments:
In `@tests/compiler.rs`:
- Around line 21-146: Add a new test in the same tests/compiler.rs that
exercises the pretty-print branch for Angular output (so the new pretty-mode
code paths in compile_angular_node and compile_block_body are covered) — create
a small input containing an Angular combination such as an `@if` followed by an
`@switch`, call the pretty-mode compiler helper (invoke whatever test helper
triggers pretty printing — e.g., a compile_content_pretty or
compile_content_core with a pretty=true flag) and assert the expected
pretty-formatted HTML string; reference compile_angular_node and
compile_block_body as the targeted code paths and keep the test similar in style
to existing ones.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1588ec5d-c440-4670-aa98-e3db8ded7f26
📒 Files selected for processing (21)
README.mdexamples/angular.hsmlexamples/angular.htmlsrc/compiler/mod.rssrc/formatter/mod.rssrc/formatter/tests/format.rssrc/parser/angular/mod.rssrc/parser/angular/node.rssrc/parser/angular/process.rssrc/parser/angular/tests/mod.rssrc/parser/angular/tests/node.rssrc/parser/children.rssrc/parser/mod.rssrc/parser/parse.rssrc/parser/tag/node.rssrc/validate/mod.rssrc/validate/tests/validate.rstests/cli.rstests/compiler.rstests/lsp.rstests/wasm.rs
efd1995 to
8b387b4
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
8c42c0e to
e0093aa
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/validate/tests/validate.rs (1)
75-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
ErrorCode::DuplicateClass.code()instead of"W002".Line 81 re-hardcodes the diagnostic contract that the rest of this file already references through
ErrorCode. Reusing the enum keeps the helper from drifting if the code changes later.Suggested change
fn dup_class_count(source: &str) -> usize { let (_, ast) = parse(Span::new(source)).unwrap(); validate(&ast, source) .iter() - .filter(|d| d.code.as_deref() == Some("W002")) + .filter(|d| d.code.as_deref() == Some(ErrorCode::DuplicateClass.code())) .count() }🤖 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 `@src/validate/tests/validate.rs` around lines 75 - 82, The dup_class_count helper is hardcoding the duplicate-class diagnostic string instead of using the shared ErrorCode contract. Update the filter in dup_class_count to compare against ErrorCode::DuplicateClass.code() so the test stays aligned with the validator’s diagnostic symbol and does not drift if the code changes.
🤖 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.
Nitpick comments:
In `@src/validate/tests/validate.rs`:
- Around line 75-82: The dup_class_count helper is hardcoding the
duplicate-class diagnostic string instead of using the shared ErrorCode
contract. Update the filter in dup_class_count to compare against
ErrorCode::DuplicateClass.code() so the test stays aligned with the validator’s
diagnostic symbol and does not drift if the code changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a10b46ef-15fa-4d5c-be2e-9f1d3d664bbd
📒 Files selected for processing (21)
README.mdexamples/angular.hsmlexamples/angular.htmlsrc/compiler/mod.rssrc/formatter/mod.rssrc/formatter/tests/format.rssrc/parser/angular/mod.rssrc/parser/angular/node.rssrc/parser/angular/process.rssrc/parser/angular/tests/mod.rssrc/parser/angular/tests/node.rssrc/parser/children.rssrc/parser/mod.rssrc/parser/parse.rssrc/parser/tag/node.rssrc/validate/mod.rssrc/validate/tests/validate.rstests/cli.rstests/compiler.rstests/lsp.rstests/wasm.rs
✅ Files skipped from review due to trivial changes (4)
- src/parser/angular/tests/mod.rs
- tests/wasm.rs
- tests/lsp.rs
- README.md
🚧 Files skipped from review as they are similar to previous changes (14)
- src/parser/angular/mod.rs
- src/formatter/tests/format.rs
- src/parser/parse.rs
- examples/angular.hsml
- src/validate/mod.rs
- src/parser/angular/process.rs
- src/parser/mod.rs
- src/parser/children.rs
- src/formatter/mod.rs
- src/parser/tag/node.rs
- tests/compiler.rs
- src/compiler/mod.rs
- tests/cli.rs
- src/parser/angular/node.rs
Summary by CodeRabbit
@‑block support across parsing, formatting, compilation, and validation:@let,@if/@else if/@else,@for/@empty,@switch/@case/@default,@defer(placeholder/loading/error + optional triggers), and@boundary/@catch.@‑block support complete.