Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 520054

Summary: [typing] switch default not indented automatically while typing
Product: [Eclipse Project] JDT Reporter: Christoph Daniel Schulze <zephanya>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: lukas.eder, noopur_gupta
Version: 4.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description Christoph Daniel Schulze CLA 2017-07-22 05:48:26 EDT
While typing a switch statement, entering "case" causes the line to be indented correctly. That is, if this is the before

    switch (e) {
    case ITEM1:
        break;
        // <-- START TYPING HERE

once I finish typing "case", instead of

    switch (e) {
    case ITEAM1:
        break;
        case

I see this (expected) result:

    switch (e) {
    case ITEAM1:
        break;
    case

This automatic "de-indentation" does not happen for the default case, though. Here, the result would look like this:

    switch (e) {
    case ITEAM1:
        break;
        default

There are other tickets, such as Bug 161024, which seem to be similar, but are geared at the explicit auto formatter. Invoking that on this example works perfectly fine and produces the expected result:

    switch (e) {
    case ITEAM1:
        break;
    default:
    }

This is with a fresh Oxygen installation without wandering near the preferences dialogue.
Comment 1 Noopur Gupta CLA 2017-07-25 06:47:15 EDT
Reproducible in Eclipse 3.8 also.
Comment 2 Mateusz Matela CLA 2018-01-13 16:12:32 EST
*** Bug 529735 has been marked as a duplicate of this bug. ***
Comment 3 Eclipse Genie CLA 2020-04-13 17:49:16 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.