Bug 248613 - "Folding" feature in C/C++ is not working well
Summary: "Folding" feature in C/C++ is not working well
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 5.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 5.0.2   Edit
Assignee: Anton Leherbauer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-25 11:53 EDT by Yevgeny Shifrin CLA
Modified: 2009-05-26 22:06 EDT (History)
1 user (show)

See Also:
cdtdoug: iplog-


Attachments
Fix (7.85 KB, patch)
2008-10-08 05:42 EDT, Anton Leherbauer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yevgeny Shifrin CLA 2008-09-25 11:53:08 EDT
Build ID: 120080617-2000 (version 3.4.0)

Steps To Reproduce:
* Create C++ project.

* Create C++ class.

* Make sure that "Folding" feature is enabled on methods.

* Create method similar to the following example (make sure that you have line breaks as in this example):
jungle::Monkey_ptr
jungle::MonkeyImpl::
Initialize()
{
...
}

* Fold the method and you will see "jungle::MonkeyImpl::".

* Expected behavior, you should see method name (with or without namespace prefix). In java editor "folding" works correct, method name is always shown.

* I am working in on a very big project where it is conventional to make the line breaks as in example above.   


More information:
Comment 1 Andrew Gvozdev CLA 2008-09-26 07:56:26 EDT
We got a lot of (generated) code like that:
if (421 > 0)
{
} else
{
}

The if would fold in this simple case:
if (421 > 0)..
}
else {
}

Another case where folding is totally off is where conditions expand to next line:
   if (1
         && 2)
   {
   } else if (3
         || 4)
   {
   }
After folding:
   if (1..
         || 4)
   {
   }
eh?

Curiously, while typing these examples for this bug in editor it would fold the line I am typing in the process of typing - hiding the very line I am typing from typing. I hope you get that but I am not sure if I could reproduce it again.

Let me know if I should file separate bugs for that.
Comment 2 Anton Leherbauer CLA 2008-09-26 08:32:43 EDT
(In reply to comment #1)
> Let me know if I should file separate bugs for that.

Those issues seem to be related to statement folding.
Yes, please file a separate bug for it.
Comment 3 Andrew Gvozdev CLA 2008-09-26 09:19:45 EDT
sure - bug 248716
Comment 4 Anton Leherbauer CLA 2008-10-08 05:42:39 EDT
Created attachment 114527 [details]
Fix
Comment 5 Anton Leherbauer CLA 2008-10-08 05:43:12 EDT
Fixed in 5.0.2 and HEAD > 20081008.