简体   繁体   中英

Any way to hide comments in Eclipse

Does anyone know if it would be possible to hide java comments in Eclipse? Is there any trick I could try?

You can fold most block /* ... */ comments to a single line. You can't do that inside code blocks (method bodies, static blocks, etc.) and maybe a few other places. You also can't collapse multiple lines of // ... style comments.

You could always change the syntax highlighting colors so the comments are in the background color. ;)

To turn on folding: Windows->Preferences->Java->Editor->Folding

Enabling 'Folding' in the preferences dialog lets you use the '+' and '-' buttons next to the line numbers to hide comments. Do do this...

Windows->Preferences->Java->Editor->Folding

Then the comments will go away!

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