#2970·ast-grep

Support custom outline rules for built-in languages

Author: user753Created Sep 27, 2026Updated Sep 27, 2026
Labelsenhancement

⭐ Suggestion

Allow configuring additional outline rules for built-in languages in sgconfig.yml.

Currently, outlineRules can be configured for custom languages, while built-in languages require passing --outline-rules on the command line.

For example, a new project-level configuration could look like:

yaml
outlineRules:
  markdown: outline/markdown.yml

Then:

bash
ast-grep outline README.md

would load the bundled Markdown outline rules plus the configured project rules.

Ideally, configured rules would be additive to bundled rules, matching the current behavior of --outline-rules.

Use Cases

I want to extend the built-in Markdown outline with project-specific entries, such as YAML frontmatter.

Currently this requires:

bash
ast-grep outline --outline-rules outline/markdown.yml README.md

on every invocation.