Apex Smart CleanerClean Apex Code. Generate Technical Documentation. Improve Salesforce Code Quality. Apex Smart Cleaner is a Visual Studio Code extension designed to automatically clean Salesforce Apex code and generate technical documentation whenever an Apex file is saved. It helps Salesforce developers maintain cleaner, more readable, and better-documented Apex classes and triggers. Features1. Automatic Apex Code CleanupAutomatically executes when an Apex file is saved. Features include:
2. Intelligent Technical Documentation GeneratorAutomatically generates technical documentation for Apex components. Class Documentation Generates documentation containing:
Example: /**
Method Documentation Automatically generates method descriptions based on method names and code implementation. Supported documentation includes:
Example: /**
Intelligent Method Description Detection Identifies common Apex operations, including: | Apex Operation | Generated Description | | HTTP Callout | External system communication | | Database.insert | Salesforce record insertion | | Database.update | Salesforce record updates | | Database.delete | Salesforce record deletion | | SOQL | Salesforce record retrieval | | Queueable Apex | Asynchronous processing | | Future Methods | Asynchronous execution | | JSON.serialize | JSON serialization | | JSON.deserialize | JSON deserialization | | addError() | Business rule validation | | Event Publishing | Salesforce event publishing | 3. Supported Apex Components| Component | Support | | Apex Classes | Yes | | Apex Interfaces | Yes | | Apex Enums | Yes | | Apex Triggers | Yes | | Apex Methods | Yes | | Method Parameters | Yes | | Method Return Types | Yes | Existing documentation immediately before a declaration is checked to avoid generating duplicate documentation. 4. Automatic Output Panel RefreshThe extension provides a dedicated VS Code Output channel: Apex Smart Cleaner The Output panel displays the latest execution report after every Apex file save. It refreshes even when the file is saved without making code changes. Output Report Includes: | Report Information | Description | | File Name | Current Apex file name | | Characters Before | Original character count | | Characters After | Final character count | | System.debug Removed | Characters removed during debug cleanup | | Whitespace Removed | Characters removed during whitespace cleanup | | Total Characters Removed | Total character difference | | Documentation Added | Number of documentation blocks generated | | Cleanup Status | Cleanup execution status | | Documentation Status | Documentation generation status | | File Save Status | Save status | | Last Updated | Latest report timestamp | 5. Manual Apex CleanupDevelopers can also execute the cleanup command manually. Command:
Command ID:
The command cleans the active Apex file, generates documentation, saves the file, and refreshes the Output panel through the save event. Execution FlowDeveloper Saves Apex File | v Check Apex File Extension | v Remove System.debug() | v Remove Unnecessary Whitespace | v Generate Class Documentation | v Generate Method Documentation | v Generate Trigger Documentation | v Apply Changes Before Save | v Save Apex File | v Refresh Output Panel | v Display Latest Cleanup Report Supported File Types| File Type | Extension |
| Apex Class | The extension also checks the VS Code language identifier for Apex files. How to UseAutomatic Cleanup
Manual Cleanup
View Cleanup Report
Requirements
Future EnhancementsPotential future improvements include:
Version InformationExtension Name: Apex Smart Cleaner Version: 1.0.2 Language: JavaScript Platform: Visual Studio Code Technology: VS Code Extension API LicenseMIT License Apex Smart Cleaner Write Clean Apex. Generate Smart Documentation. Build Better Salesforce Applications. |