Add rust-analyzer inlay hints tool#4
Conversation
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 51 minutes and 26 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a complete ChangesInlay Hints Feature Implementation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
| let Some(kinds) = kinds else { | ||
| return Ok(None); | ||
| }; |
There was a problem hiding this comment.
🟡 Empty kinds array silently filters out all inlay hints instead of returning all
When the user passes "kinds": [] (an empty array), parse_kind_filters at src/ra/inlay_hints.rs:68-86 returns Ok(Some(BTreeSet::new())) — a Some wrapping an empty set. In format_inlay_hints at src/ra/inlay_hints.rs:136-140, the filter check filters.map(|f| f.contains(...)).unwrap_or(true) will always return false for Some(empty_set), silently discarding every hint. This is semantically different from omitting kinds entirely (None), which correctly returns all hints. A user or agent passing "kinds": [] likely intends "no filter" (all kinds) but gets zero results with no error or warning.
| let Some(kinds) = kinds else { | |
| return Ok(None); | |
| }; | |
| let Some(kinds) = kinds.filter(|k| !k.is_empty()) else { | |
| return Ok(None); | |
| }; |
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
ra_inlay_hintsMCP tool with whole-file or selected-range requests, kind filtering, bounded grouped output, and optional raw hints.textDocument/inlayHintclient support plus formatter/validation helpers.main.Testing
cargo fmt --checkcargo test --locked --allcargo clippy --locked --all-targets -- -D warningsSummary by CodeRabbit
New Features
Documentation