function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mike LeachMike Leach 

Auto Formatting Apex Classes

I have several *.cls files that use space indentation and need converting to tabs.

 

The Java perspective in Eclipse has options for auto-formatting Java files, but I've been unable to apply this towards to Apex class files.

 

Any thoughts or guidance on how to do this? Maybe a magic plug-in somewhere?

 

Thx!

 

-Mike

 

CaptainObviousCaptainObvious

 

Here are some options for converting spaces to tabs:
With Notepad++

Some tools for converting spaces to tabs:


In Notepad++ you can use TextFX > TextFX Edit > Leading space to tabs or tabs to spaces.

 

If you prefer a plugin, try AnyEdit tools for Eclipse.

 

Note that if you edit/save the class in the Salesforce GUI, tabs will revert to spaces.