Reputation: 3436
I am working in Apex code on the Eclipse IDE for the Salesforce.com platform.
Is there a way to comment (or uncomment) multiple lines of code using two forward slashes easily?
Java shortcuts of Ctrl + Shift + / don't work in Apex that I can tell. I was hoping to find a method similar to the one in Xcode where you can highlight multiple lines, then Command + /.
I didn't find any threads dealing with Apex comments here on Stackoverflow, but will gladly take the whipping for not being thorough if someone is able to find it.
I specifically don't want to use the /* */ method of multiple line commenting because of the logical flaw with that method. I also don't want to explain that particular logic flaw at the moment.
Many thanks in advance, Ted S.
Upvotes: 1
Views: 2717
Reputation: 17338
There are two types of commenting single-line and multi-line.
Single line
comment Ctrl + /
uncomment Ctrl + /
Multiline
comment Ctrl + Shift + /
uncomment Ctrl + Shift + \ (note the backslash)
Hope this helps!
Upvotes: 0
Reputation: 11
A workaround for commenting multiple lines (using //) which I am finding acceptable is to use Alt + Shift + A (windows, not sure what the Mac hotkey is) to turn on multi-line edit, then type the comment. Not being able to configure the hotkeys is very irritating, hope this helps some ppl.
Upvotes: 1
Reputation: 1214
I haven't found any of the shortcuts that would do this either but it occurred to me that maybe if you could get a macro or scripting plugin you could create your own hotkey. The following thread has some suggestions for potential macro plugins.
Is there a Macro Recorder for Eclipse?
Upvotes: 0