Skip to content

feat: apply outline extractor options#2746

Merged
HerringtonDarkholme merged 1 commit into
mainfrom
outline-apply-options
Jun 20, 2026
Merged

feat: apply outline extractor options#2746
HerringtonDarkholme merged 1 commit into
mainfrom
outline-apply-options

Conversation

@HerringtonDarkholme

@HerringtonDarkholme HerringtonDarkholme commented Jun 19, 2026

Copy link
Copy Markdown
Member

Stacked on #2745.\n\nThis PR wires outline extractor options into rule compilation and extraction, including safe rule pruning, runtime filtering, and name-only signature detail.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added configurable extraction options to control whether items and members are compiled and retained during outline processing.
    • Introduced an entry “detail” mode to switch output between name-only and full signature rendering.
  • Enhancements

    • Extraction now applies option-driven filtering consistently, so only matching rules are compiled and extracted (including correct import/export classification).
    • Items and members are included or suppressed according to the selected retention settings.
  • Tests

    • Updated and expanded unit tests to cover member/item suppression, detail-driven signature behavior, and import/export filtering.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c306b570-c0a8-4bd4-8a49-31ecfe5e1c01

📥 Commits

Reviewing files that changed from the base of the PR and between 715a85f and 7181af6.

📒 Files selected for processing (2)
  • crates/outline/src/combined_extractor.rs
  • crates/outline/src/extractor.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/outline/src/combined_extractor.rs
  • crates/outline/src/extractor.rs

📝 Walkthrough

Walkthrough

OutlineEntryDetail is threaded into ExtractorCommon, ItemExtractor, and MemberExtractor constructors to conditionally compile the signature template and skip signature rendering in name-only mode. CombinedExtractors gains an OutlineExtractorOptions field, a new try_from_rules constructor that filters and builds extractors using those options, and runtime keep-member/keep-item filtering in the extraction loop.

Changes

Detail-driven extractor construction and options-based filtering

Layer / File(s) Summary
ExtractorCommon detail field and conditional signature compilation
crates/outline/src/extractor.rs
Adds OutlineEntryDetail import and detail: OutlineEntryDetail field to ExtractorCommon; updates ExtractorCommon::try_from to accept detail and compile the signature template only for Signature mode; introduces render_signature helper that returns empty text for Name mode and renders configured or default signatures for Signature mode; updates ItemExtractor::try_from and MemberExtractor::try_from to accept and forward the detail parameter; updates all constructor tests to pass OutlineEntryDetail::Signature.
CombinedExtractors options field, try_from_rules constructor, and extraction filtering
crates/outline/src/combined_extractor.rs
Adds OutlineExtractorOptions import and options: OutlineExtractorOptions field; introduces try_from_rules constructor that filters serialized rules via options.retain_rule, compiles item extractors with options.detail, and conditionally compiles member extractors with member-specific detail when options.members is present; extends new_with_options to accept and store options; updates extraction loop to conditionally retain members and items via options.keep_member and options.keep_item predicates; adds tests validating name-only compilation suppresses member signatures and import/export flag filtering affects compiled extractors and extracted is_import values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • ast-grep/ast-grep#2745: Introduces the options module defining OutlineExtractorOptions and OutlineEntryDetail types that this PR threads into CombinedExtractors and ExtractorCommon.
  • ast-grep/ast-grep#2729: Modifies the same combined_extractor.rs and extractor.rs extraction and entry-building logic that this PR extends with option-driven filtering and detail-conditional signature rendering.
  • ast-grep/ast-grep#2691: Introduces or normalizes the SerializableOutlineRule contract that the new CombinedExtractors::try_from_rules constructor builds runtime extractors from.

Poem

🐇 A rabbit compiles with care,
Signatures bloom only when there's detail to spare.
Options retained, the rules finely sieved,
Name-only paths—no templates conceived!
Keep member, keep item, the forest stays neat,
Each extracted outline a tidy feat. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: apply outline extractor options' directly summarizes the main change: applying outline extractor options to rule compilation and extraction. It clearly reflects the PR's core objective of integrating options throughout the outline extractor pipeline.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch outline-apply-options

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HerringtonDarkholme
HerringtonDarkholme force-pushed the outline-extractor-options branch from 19f528f to 49c910a Compare June 19, 2026 21:18
@HerringtonDarkholme
HerringtonDarkholme force-pushed the outline-extractor-options branch from 49c910a to 94a804a Compare June 19, 2026 21:27
@HerringtonDarkholme
HerringtonDarkholme force-pushed the outline-extractor-options branch from 94a804a to 2e06965 Compare June 19, 2026 21:40
@HerringtonDarkholme
HerringtonDarkholme force-pushed the outline-extractor-options branch from 2e06965 to 4a98866 Compare June 19, 2026 21:54
@HerringtonDarkholme
HerringtonDarkholme force-pushed the outline-extractor-options branch from 4a98866 to daeb138 Compare June 19, 2026 21:59
@HerringtonDarkholme
HerringtonDarkholme force-pushed the outline-extractor-options branch from daeb138 to 192df1a Compare June 19, 2026 22:05
@HerringtonDarkholme
HerringtonDarkholme force-pushed the outline-extractor-options branch from 192df1a to eb352aa Compare June 19, 2026 22:11
Base automatically changed from outline-extractor-options to main June 19, 2026 22:21
Comment thread crates/outline/src/combined_extractor.rs Outdated
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.20548% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.08%. Comparing base (845ca50) to head (7181af6).

Files with missing lines Patch % Lines
crates/outline/src/combined_extractor.rs 94.01% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2746      +/-   ##
==========================================
+ Coverage   86.05%   86.08%   +0.03%     
==========================================
  Files         126      126              
  Lines       22219    22347     +128     
==========================================
+ Hits        19120    19238     +118     
- Misses       3099     3109      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HerringtonDarkholme
HerringtonDarkholme added this pull request to the merge queue Jun 20, 2026
Merged via the queue into main with commit 0af4b77 Jun 20, 2026
6 checks passed
@HerringtonDarkholme
HerringtonDarkholme deleted the outline-apply-options branch June 20, 2026 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant