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:
outlineRules:
markdown: outline/markdown.ymlThen:
ast-grep outline README.mdwould 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:
ast-grep outline --outline-rules outline/markdown.yml README.mdon every invocation.
Source: ast-grep/ast-grep