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 2 commits into
base: master
Choose a base branch
from

Conversation

jakub-suliga
Copy link

@jakub-suliga jakub-suliga commented Jul 31, 2024

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:

@jakub-suliga jakub-suliga marked this pull request as draft July 31, 2024 07:29
@jakub-suliga
Copy link
Author

jakub-suliga commented Sep 25, 2024

Bug:

  • When you press enter or delete a line and the element is closed, the folding mechanism gets buggy

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