Skip to content

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

Closed
nikhil-mittal-165 wants to merge 5 commits into
devfrom
feat/ast-dump-command
Closed

NEW @W-22465143@ Add ast-dump command for generating PMD AST output#2047
nikhil-mittal-165 wants to merge 5 commits into
devfrom
feat/ast-dump-command

Conversation

@nikhil-mittal-165

Copy link
Copy Markdown
Contributor

Introduces a new code-analyzer ast-dump command that generates and displays the Abstract Syntax Tree produced by PMD for a given source file. Supports Apex, Visualforce, HTML, XML, and JavaScript with JSON and XML output formats.

Introduces a new `code-analyzer ast-dump` command that generates and displays
the Abstract Syntax Tree produced by PMD for a given source file. Supports
Apex, Visualforce, HTML, XML, and JavaScript with JSON and XML output formats.
@nikhil-mittal-165 nikhil-mittal-165 changed the title NEW - Add ast-dump command for generating PMD AST output NEW @W-22465143@ Feat Add ast-dump command for generating PMD AST output Jun 5, 2026
@nikhil-mittal-165 nikhil-mittal-165 changed the title NEW @W-22465143@ Feat Add ast-dump command for generating PMD AST output @W-22465143@ Feat Add ast-dump command for generating PMD AST output Jun 5, 2026
@nikhil-mittal-165 nikhil-mittal-165 changed the title @W-22465143@ Feat Add ast-dump command for generating PMD AST output NEW @W-22465143@ Add ast-dump command for generating PMD AST output Jun 5, 2026
@nikhil-mittal-165

Copy link
Copy Markdown
Contributor Author

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.

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