Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

How can do code alignment with Eclipse base Force.com IDE. Alignment shortcut key 'CTRL+SHIFT+F' is not working for Apex code.

1 Answer

0 votes
by (32.1k points)

The Force IDE opens the Apex class in an Apex Editor. This editor doesn't appear in the list of contexts that you can correlate with a key event. So, for example, a list contains contents such as 'editing in a structured text', 'editing in Java Source', etc. Your apex editor doesn't contribute a 'Source' menu option to the right-click menu. So, there is no way to get to the formatting features.

I attempted to open the apex class in Java. Now, the 'Source' menu option appears the format option doesn't do anything.

The one and only thing I can get to work is this:

Select file > Open with > Other > Locate Java Editor. 

Once the file is open, 

select all text ( right click) > Source > Correct Indentation

This doesn't reformat but it does fix the indentation problem.

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers

500 comments

108k users

Browse Categories

...