Slashdot Mirror


Eclipse Finally Gets Code Folding

binarysearch writes "Code folding is finally in the Eclipse project! After more than two years open, Eclipse's Bug 9355 has finally been marked FIXED. Code Folding was the most-voted for bug in Eclipse, with support for J2SE 1.5 features in a close second. Check out the I20040504 Integration build for folding in the Compilation Unit Editor (Class File Editor support is in HEAD). For those who dislike the implementation, it is requested that you create a new bug, rather than reopening 9355."

7 of 90 comments (clear)

  1. Code folding is: by Elwood+P+Dowd · · Score: 4, Informative
    Code folding is where you can collapse a block of code between a set of squirrely braces so it reads"
    { ... }
    or
    // ...
    or
    /* ... */
    Or whatever. Yes, this is like VS.NET and a million other IDEs. I use it all the time, but it never would have occured to me that it was a big deal. I figgered y'all FS/OSS types would use incremental search and brace matching to go anywhere in your code, rather than the scrolly-wheel. Isn't that what "real" programmers would do?
    --

    There are no trails. There are no trees out here.
    1. Re:Code folding is: by Yokaze · · Score: 4, Interesting

      > Isn't that what "real" programmers would do?

      Or what about keeping the code blocks small and concise? See Linux kernel coding style Chapter 4.
      If you have to scroll some pages to find the corresponding closing tag, something has gone wrong.

      But I've to admit, that I use code folding myself, which shows, I'm not a real programmer. But I also prefer Emacs to vi, which only confirms the fact I'm a quiche eater.

      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
  2. code folding? by jpu8086 · · Score: 5, Interesting

    this is a misnomer. i was lost for a while. i was under the assumption that code folding is akin to code wrapping (which eclipse has had since day 1)

    i would rather term it code collapse...and which is what they call it in the main bug report. however, lots of people call it folding in the followup comments.

    i guess i better get used to it being called code folding too.

    so, i am happy that i can collapse 100s of lines of code into just the relevant 10-15 lines of code easily. however, i think this can create a problem of introducing silly error pass through (because you dont have the whole perspective on things). i think they have a feature to collapse all code that doesnt involve a variable "x". Anyone tested this yet?

    --
    now supporting:
    cmdrTaco for president '04
    michael for oval office intern summer '05
  3. Re:Availability by Dr_Java · · Score: 5, Informative

    The M9 Build is scheduled for Friday May 21, 2004 - its hidden away in the documentation. Full release of 3.0 is scheduled for July 2004.

  4. Hint for Emacs Users by AT · · Score: 4, Informative

    I know this article is about eclispse, but I'd like to point out this feature exists in emacs, too.

    Turn on hs-minor-mode (M-x hs-minor-mode) and code blocks can be folded and unfolded with shift-middle-click (or C-c @ C-c).

  5. questionable features by f00zbll · · Score: 5, Insightful
    although the feature is useful and many programs have them. For example several HTML editors have this feature, since many html pages have tons of tables. Having folding is great for documents that are long like HTML. For code I feel it tends to lead to bad habits.

    For example, most of the .NET programmers I work with are x-VB guys and they use this alot. what ends up happening is they put all the classes in one file. Which actually leads to a tendency of coding with lots of inner classes. One of the biggest strengths of Java in my mind is it encourages programmers write smaller chunks of code that is more modular and re-usable. If you write your code in a well organized manner, you won't really need folding. Especially since the right pane in Eclipse shows you the methods and allows you to double click and jump to that point quickly.

    I read the bug/feature requests and many of the arguments in my mind are personal bias. they aren't really valid. Several people complained Eclipse wasn't usable because it didn't have folding. I question that way of thinking and suggest the user is inflexible and unwilling to adapt. If it's that important, then write it yourself and submit it to eclipse. Needless whining serves no one any good. The time spent whining could be spent coding.

  6. Re:Eclipse and C++ by Gill+Bates · · Score: 4, Informative

    Can anyone comment on how far the CDT has come in the last 12 months? Oh and also - is there any support for refactoring C++ yet :)

    Not very far, AFAIKT. I used it a couple of months ago for some JNI/C++ code I was working on, and found that although it looks a lot like the Java editor, it behaves vastly different.

    No code completion, no code formatting, no refactoring.

    Just a basic code editor with color syntax highlighting.