This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 99038 - code folding: confused by #ifdef in include-Block
Summary: code folding: confused by #ifdef in include-Block
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 5.x
Hardware: All All
: P4 blocker (vote)
Assignee: Egor Ushakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-26 21:12 UTC by Thomas Preisler
Modified: 2013-05-17 08:48 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Preisler 2007-03-26 21:12:26 UTC
This IZ is a dup of CR 6538935.

DESCRIPTION OF PROBLEM
--------------------------------
If there is a #ifdef in the include-Block at the beginning of a source file, the
code folding range for the include block stops at the first #include-Statement
after the #ifdef. Instead, the code folding range should cover also the
subsequent #include statements, and the #ifdef should be treated as nested
within the range of the include block.
STEPS TO DUPLICATE
-------------------------
This can be easily seen with the following example:
Put these lines in a file and open it with the editor in the IDE:
#include <string.h>
#include <socket.h>
#ifdef TRACING
#include <stdio.h>
#endif
#include <foo.h>
#include <bar.h>
A code folding range from string.h up to and including stdio.h is displayed. The
last two include statements should be covered as well, and the #ifdef/#endif
should be nested within this.
Comment 1 Egor Ushakov 2008-01-24 15:57:23 UTC
currently we have this folding:
+ #include <string.h>
- #include <socket.h>
+ #ifdef TRACING
| #include <stdio.h>
- #endif
+ #include <foo.h>
- #include <bar.h>
Comment 2 Egor Ushakov 2008-01-24 16:23:02 UTC
Major folding problem in this issue was solved.
As for ifdef block: 
inside #ifdef block may be other declarations, not includes,
so to be consistent with folding in other situations we will not put #ifdef block
as sub block into includes folding block.
Please file enhancement if you don't agree.
Comment 3 Alexander Ioffe 2008-04-29 18:29:00 UTC
Verified