Results 1 to 6 of 6
  1. #1
    Codeless is offline Member
    Join Date
    Nov 2010
    Posts
    37
    Rep Power
    0

    Default Is it possible to create hidden comments in eclipse?

    I have started to comment more on code however I find this gets messy. I think a lot of my comments are unnecessary but I still want them in case I forget something

    So a feature I think would be useful is hidden comments, for example you want to comment about a section of code - keep this comment shown like a normal comment. but now you want a *lower level of abstraction* and comment an individual line. you only want to see this comment when the you click show, because unlike the normal comment you only want to see this when you are inspecting beyond the general comment

    so I think having two different level of comments would be ideal for abstracting code on two different levels, having the benefit of looking at it neat with just the section comments and then showing the lower level comments when you want it

    like all ideas I'm sure its already been done. so is there something like this in eclipse?

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,785
    Blog Entries
    7
    Rep Power
    21

    Default Re: Is it possible to create hidden comments in eclipse?

    Right click in the left margin, next to the first line of your comment; select 'folding>enable folding'; you can hide or show your comment with the small plus or minus sign.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Codeless is offline Member
    Join Date
    Nov 2010
    Posts
    37
    Rep Power
    0

    Default Re: Is it possible to create hidden comments in eclipse?

    I have folding enabled but I can't seem to hide comments. I can do this with methods with the sign described but there doesn't seem to be anyway to hide the comment line, or comment on the line unless I've missed something

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,785
    Blog Entries
    7
    Rep Power
    21

    Default Re: Is it possible to create hidden comments in eclipse?

    Go to Window>Preferences>Java>Editor>Folding and select 'fold comments'.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Codeless is offline Member
    Join Date
    Nov 2010
    Posts
    37
    Rep Power
    0

    Default Re: Is it possible to create hidden comments in eclipse?

    I did as you said and its enabled now, it wasn't before, however no option appears to show up. I tried // and /* comments but the little minus symbol doesnt appear - or anything else

    there is an option to collapse comments that shows up when you right click the margin but this has no effect (even if comments highlighted) and was there before I enabled the thing

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default Re: Is it possible to create hidden comments in eclipse?

    I don't use Eclipse, but you probably need to use doc comments that open with /** and close with */ (note that the opening has two asterisks, not one).

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. create gui using eclipse
    By uthpalaw in forum AWT / Swing
    Replies: 0
    Last Post: 03-12-2011, 12:23 PM
  2. How to create set up file from eclipse
    By Santosh_JAVA in forum Advanced Java
    Replies: 1
    Last Post: 02-23-2011, 02:00 PM
  3. Create jar file from Eclipse
    By tarkowc in forum New To Java
    Replies: 4
    Last Post: 01-25-2011, 08:42 PM
  4. How to create an eclipse editor?
    By Rudraraju440059 in forum Eclipse
    Replies: 0
    Last Post: 08-23-2010, 12:56 PM
  5. Eclipse - comments
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-07-2007, 03:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •