Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folding mechanism for while/for/if/switch-case #1562

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jakub-suliga
Copy link

Problem:
Currently, there is no folding mechanism for while/for/if/switch-case statements in Eclipse. VSCode and IntelliJ support a folding mechanism for these statements. Therefore, I have created a method that implements this folding mechanism. This is also an open issue: #1426. In addition, I deleted some commented-out code from 2007.

Before:
image

After:
image

How to test:

  1. Start an Eclipse workspace and create a new class.
  2. Add while/for/if/switch-case statements to this class.
  3. Verify that the folding mechanism works as expected.

Here is a small program you can use to test:
public class SimpleProgram {
   public void checkNumber(int number) {
       if (number > 0) {
           System.out.println(number + " ist positiv.");
       } else {
           System.out.println(number + " ist null.");
       }
   }

   public static void main(String[] args) {
       SimpleProgram program = new SimpleProgram();
       int count = 1;
       while (count <= 5) {
           System.out.println("Count ist: " + count);
           count++;
       }
   }
}

Bugs:

Adds a Folding mechanism for while/for/if/switch-case. Currently there
is only a folding mechanism for classes and methods
@jakub-suliga jakub-suliga marked this pull request as draft July 31, 2024 07:29
@@ -520,33 +520,6 @@ private int findFirstContent(final CharSequence content, int prefixEnd) {
return 0;
}

// /**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented out code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants