Skip to content
| Marketplace
Sign in
Visual Studio Code>Linters>PMD Apex Auto-FixerNew to Visual Studio Code? Get it now.
PMD Apex Auto-Fixer

PMD Apex Auto-Fixer

Optimumvalue

|
1 install
| (1) | Free
Run PMD on Salesforce Apex classes/triggers, review findings, and auto-fix them with Claude.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PMD Apex Auto-Fixer

A VS Code extension for Salesforce projects that:

  1. Runs PMD against Apex classes, triggers (and other selected files) in your SFDX project.
  2. Lists the files with PMD findings in a dedicated "PMD Apex Fixer" view, with each violation underneath its file.
  3. Lets you check one or more files and fix them automatically with Claude (Anthropic), showing a diff you accept or reject per file before anything is written to disk.

Requirements

  • Java (8+) available on PATH, or configured via pmdApexFixer.javaHome. PMD itself is downloaded automatically on first use.
  • An Anthropic API key.

Getting started

  1. Run PMD Apex Fixer: Set Claude API Key from the Command Palette. The key is stored in VS Code's encrypted Secret Storage.
  2. Run PMD Apex Fixer: Scan Workspace, or right-click a folder/file in the Explorer and choose PMD Apex Fixer: Scan Selected Files/Folder.
  3. Open the PMD Apex Fixer view in the Activity Bar. Check the files you want fixed.
  4. Click the sparkle icon (Fix Checked Files with Claude) in the view's title bar.
  5. For each file, review the diff between the original and Claude's proposed fix, then Accept Fix or Reject.

Configuration

Setting Description
pmdApexFixer.claudeModel Claude model used to generate fixes (default claude-sonnet-5).
pmdApexFixer.pmdVersion PMD release to auto-download (default 7.9.0).
pmdApexFixer.pmdInstallPath Use an existing PMD install instead of auto-downloading (path to the directory containing bin/).
pmdApexFixer.rulesetPath Path to a custom PMD ruleset XML. Defaults to a bundled ruleset covering PMD's built-in Apex categories.
pmdApexFixer.javaHome JAVA_HOME to use if Java isn't already on PATH.
pmdApexFixer.includeGlobs / pmdApexFixer.excludeGlobs Control which files "Scan Workspace" picks up.
pmdApexFixer.maxDiagnosticsPerFileInPrompt Caps how many violations are sent to Claude per file.

Notes

  • Only .cls and .trigger files are scanned/fixed — PMD's Apex rules don't apply to Visualforce pages, LWC, or Aura components.
  • Nothing is written to disk without an explicit Accept Fix in the diff prompt.
  • PMD is downloaded once into VS Code's global storage and reused across projects.

Development

npm install
npm run compile   # or: npm run watch

Press F5 in VS Code to launch an Extension Development Host.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft