Skip to content

NEW @W-22465143@ Add ast-dump command for generating PMD AST output#2050

Merged
nikhil-mittal-165 merged 2 commits into
devfrom
feature/ast-dump
Jun 16, 2026
Merged

NEW @W-22465143@ Add ast-dump command for generating PMD AST output#2050
nikhil-mittal-165 merged 2 commits into
devfrom
feature/ast-dump

Conversation

@nikhil-mittal-165

Copy link
Copy Markdown
Contributor

PMD Custom Rules: AST Dump Support

Creating PMD custom rules requires AST dumps of the relevant source patterns and classes. Currently, the CLI has no way to retrieve AST output from core and surface it to users.

This change introduces a new --ast-dump flag (exposed as the code-analyzer ast-dump command) that generates and returns the Abstract Syntax Tree produced by PMD for a given source file, in XML format. The output can then be used by the creating-custom-rule skill to generate precise XPath expressions for authoring PMD custom rules.

Supports Apex, Visualforce, HTML, XML, and JavaScript, with both JSON and XML output formats.

Comment thread src/lib/actions/AstDumpAction.ts Outdated
@nikhil-mittal-165

Copy link
Copy Markdown
Contributor Author

@aruntyagiTutu aruntyagiTutu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approve to unblock.

@nikhil-mittal-165 nikhil-mittal-165 merged commit c83d69a into dev Jun 16, 2026
12 checks passed
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.

3 participants