开发者

Eclipse insertion of multiple comment lines

开发者 https://www.devze.com 2023-04-11 18:10 出处:网络
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

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

精彩评论

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

关注公众号