Formatting code does not format comments, formatting code comments do not wrap

Source: Internet
Author: User
Tags comments

Problem: When using Shift+ctrl+f format code, the following situation occurs, the comments will be formatted, the comments written on one line are divided into two lines, the readability is not high and the format is not friendly.

Unfriendly format:

The actual format required:

Problem solving:

First enter Window-->preferences-->java-->code Style-->formatter to create a template that does not require formatting comments.

Remove the option to format the comment:

Apply the template you created:

That's fine, but it's very simple.

Attention:

Here is the default Eclipse template, do not directly in the default template to modify, so it can not be modified, only to create a template (the newly created template settings and Eclipse default is the same), and then in the template you created, modify, apply your own template.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.