Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 378196 - switch statement folding not working in remote c editor
Summary: switch statement folding not working in remote c editor
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RDT (show other bugs)
Version: 4.0.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 6.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-01 17:16 EDT by David Salinas CLA
Modified: 2012-05-23 16:57 EDT (History)
1 user (show)

See Also:


Attachments
Fixfor code folding in switch statements. (19.92 KB, patch)
2012-05-01 17:34 EDT, David Salinas CLA
g.watson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Salinas CLA 2012-05-01 17:16:13 EDT
Build Identifier:   PTP RDT XL C/C++ Compiler Support	4.2.0.201204032039	org.eclipse.ptp.rdt.xlc.feature.group

With code folding enabled for statements.  Switch statements in a remote C editor are not folded if they contain case statements.  Which is really likely ... :-)

Reproducible: Always

Steps to Reproduce:
Steps to reproduce:
1. enable folding in preference setting.
2. create a remote C/C++ project and copy following code to a source file: 

int main() {
    int x =0;
    switch (x){
        case 1:
            x = 2;
        case 2:
            x = 3;
        case 3:
            x = 4;
        case 4:
            x = 5;
        default:
            x = 6;
    }
    return 0;
}
3. Close and reopen the file, will see that switch statement is not folded.
4. Open same file from Remote system view , this time, will see it works (since the file will be downloaded and open up locally in this circumstance )
Comment 1 David Salinas CLA 2012-05-01 17:34:46 EDT
Created attachment 214899 [details]
Fixfor code folding in switch statements.
Comment 2 Vivian Kong CLA 2012-05-02 15:35:43 EDT
(In reply to comment #1)
> Created attachment 214899 [details]
> Fixfor code folding in switch statements.

Thanks for the patch Dave.  However I'm getting a lot of errors when I tried to apply it.  Can you do a pull and create the patch again?
Comment 3 Vivian Kong CLA 2012-05-02 16:48:38 EDT
I ignored the errors since the only change is in RemoteFoldingRegionsHandler.

Applied to master and ptp_4_2.  Thanks Dave.