Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying camel cased words as such with underscores in Eclipse

To me, reading long camel cased words can sometimes be a bit frustrating. For example:

aReallyLongCamelCasedMethodNameWhichIsTooSelfDescribing

Now, look at this version:

a_Really_Long_Camel_Cased_Method_Name_Which_Is_Too_Self_Describing

Which version is easier on your eyes? The second one is for mine.

While using Emacs, I stumbled upon a nice minor mode called glasses mode.

Since I'm working primarily with Java, I'm an Eclipse user and I wonder if there is some way to display camel cased words with underscores?

Note that I'm not asking for a way to actually convert camel cased words as described, I'm just looking for a mechanism that works like Emacs' glasses mode in Eclipse.

A regexp to actually do the conversion can be found by googling "Convert camelCase to underscores".

like image 488
darioo Avatar asked Oct 27 '10 20:10

darioo


3 Answers

Have you considered using Emacs as your Java IDE? I really like Eclipse and the move sounds painful to me too. However, I bump into more and more people that are actually doing it. Just type "emacs ide java" into google.

It's definitely not a move for everyone, but if you know Emacs fairly well it might be a better option than trying to convert emacs features into Eclipse.

like image 159
User1 Avatar answered Nov 09 '22 19:11

User1


If you can't find any existing Eclipse plugins, then I would consider writing your own editor extension.

like image 41
javamonkey79 Avatar answered Nov 09 '22 19:11

javamonkey79


If you haven't laid down your mouse and gone into retirement yet, there are now 2 solutions to this:

  1. use emacs within Eclipse with the emacs+ plugin although I haven't established that you can use a .emacs init file to pre-program much of the cool emacs stuff emacs can do like your requirement
  2. convert camel-case to underscored separated using the AnyEdit plug-in and then hit CTRL+z to go back
like image 22
Adam Avatar answered Nov 09 '22 19:11

Adam