简体   繁体   中英

Multi-line TODO: Comments in Eclipse

Fairly straight forward question here. Has anyone figured out how to do a TODO: comment in Eclipse that spans multiple lines? I cannot for the life of me get it to work.

I assign a short title/explanation to the TODO. This title will be picked up by your IDE and put in the task list for reference. Then underneath I describe my TODO at length.

The first line will be nicely highlighted in your code, so you can easily recognize your to-do's inline too.

/**
*   TODO: Short explanatory title
*   Here I start a more lengthy description.
*   This can consist of as many lines as you want.
*/

Please try with below lines,

    /**
     * <pre>
     * TODO : You can write very long line here, which will not truncate in task desc.
     * </pre>
     */

You can create multi line TODO comments like this:

/**
* 
*         TODO This is the first line
*         This is the second line of todo comment
*/
 *
 * @TODO this is the first line<br>this is the second line
 * 

Will display with 2 Lines in the tooltips since i've used <br> ;)

I don't know if this might help you, but you can also add you own custom task tags under Preferences>Java>Compiler>Task tags. That way you can seperate the default(auto-generated) tags from your own tags which you might find more important to fix then the standard TODO tags.

You can then also configure the Tasks view to only display your own custom tags for instance...

It seem Eclipse does not mark TODO as comment, it looks for the word "TODO".

So it seem like you have to something like (for now at least):

// TODO:
// TODO:
// TODO:

or

/* TODO:
 * TODO:
 * TODO:
 */

for multi-line TODOs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM