开发者

Eclipse insertion of multiple comment lines

At present if I type "/*" and press enter I get the follwing .

/*
*
*/

Is there a setting somewere that allwos me to 开发者_Python百科make the default like this

/*
* TESTING 
*/

thanks


Indeed there is! Assuming you want to change the Java code templates (though it's similar for other plugins too):

First, go to Window -> Preferences.

Eclipse insertion of multiple comment lines

Then, Java -> Code Style -> Code Templates -> Comments.

Eclipse insertion of multiple comment lines


Now that I have a better idea of what you are looking for, I think what you want is to define a custom code template.

Again, go to Window -> Preferences.

Then, Java -> Editor -> Templates. Create a new template.

Under name give it something like 'xxx' so you won't collide with other reserved words (unfortunately, anything with / or /* is reserved). For the pattern, just add the following:

/*
 * TESTING
 */

Eclipse insertion of multiple comment lines

Now, when you type 'xxx' then CTRL+<space> in the editor, it will replace it with your comment template.

See also: Eclipse Code Templates (pdf)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜