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

Bug 325962

Summary: [projection] Code folding behaves in unexpected ways in presence of syntax errors
Product: [Eclipse Project] JDT Reporter: jules <jules>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description jules CLA 2010-09-22 09:38:00 EDT
Build Identifier: 20090621-0832

When editing code with sections folded, transient syntax errors (e.g. because an declaration has been partially written but not completed) immediately above the folded area can cause the editor to behave in illogical ways, e.g. moving the code that is being actively edited inside a folded region.

The editor should probably avoid changing the start and end locations of a folded region when there is a syntax error in the immediate vicinity.  Moving code that the user is actively editing inside a folded region is *very* confusing.

Reproducible: Always

Steps to Reproduce:
1. Create a class and add a public method to it.
2. Fold the method
3. Place the cursor before the folded method and type "public", as if you were about to add a new public declaration.
4. Wait for about a second.
5. The new "public" keyword disappears; if you open the folded region you will see that it is now inside the region.
Comment 1 Dani Megert CLA 2010-09-22 09:53:26 EDT

*** This bug has been marked as a duplicate of bug 104373 ***