Community
Participate
Working Groups
I just checked out the latest cdt_2_0 branch (should be close to or equal 2.0.1 RC1) and discovered a problem with the content assist feature. It seems that if I have section of code inside a conditional, content assist does not work if the conditional is not true in the property page setting. For example a simple helloworld managedbuild C project, #include <stdio.h> int main ( int argc, char *argv[] ) { printf ( "Helloworld.\n" ) ; #ifdef PRINT_ARGS (*) #endif return ( 0 ) ; } If I have not defined PRINT_ARGS in the property page (-DPRINT_ARGS), then I cannot use content assist inside the conditional to say, enter a for loop starting on the empty line (*) by typing "for" cntl-space.
That is the design intent. The next generation of source code parser should be able to figure out how to take both sides of #if branches. Marking this as an enhancement and setting to Future.
*** Bug 72826 has been marked as a duplicate of this bug. ***
I believe code completion should not care about if PRINT_ARGS is defined or not. If the user wants to code inside #ifdef / #endif, it is probably legitimate anyway. So CA should be available no matter what.
*** Bug 98352 has been marked as a duplicate of this bug. ***
Hi... Is there any progress on this issue? I think this is such a user visible improvement... You know, I love CDT, you guys rock. I work on big projects who are shared between multiple teams. There are _lots_ of ifdefs and they are managed by makefiles, so it's kind of a burden to have to insert each one of them into eclipse build system... And it makes the same information replicated in more than one place. Is this such a complicated issue? If you need a hand, I can perhaps take a stab on it with you. Thanks, Andre
Another thing I miss too much is the ability to follow navigating inside functions protected by random ifdef (by ctlr+mouse click over function name).
(In reply to comment #5) > > I work on big projects who are shared between multiple teams. There are _lots_ > of ifdefs and they are managed by makefiles, so it's kind of a burden to have to > insert each one of them into eclipse build system... Did you try scanner discovery? It is supposed to figure out your -D for indexer from makefile output.
Returning old defects to pool so I can have an accurate list of what I'm working on.
I tested this with CDT master: - "for" + ctrl+space inside the ifdef offers the for loop completion - just ctrl+space inside the ifdef offers all available completions - a prefix, e.g. "prin" + ctrl+space inside the ifdef still offers all available completions, without filtering for the prefix The last one is a bug. Let's leave this report open for that.
(In reply to Nathan Ridge from comment #9) > I tested this with CDT master: > > - "for" + ctrl+space inside the ifdef offers the for loop completion > - just ctrl+space inside the ifdef offers all available completions > - a prefix, e.g. "prin" + ctrl+space inside the ifdef still offers > all available completions, without filtering for the prefix > > The last one is a bug. Let's leave this report open for that. Testing with current CDT master, the behaviour is even worse: even "for" + Ctrl+Space offers all available completions rather than the for loop completion.
New Gerrit change created: https://git.eclipse.org/r/88729
Gerrit change https://git.eclipse.org/r/88729 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=8956d2c7e6e1227083f39df6f9121db9cdd92bff
Fixed for 9.3.
Mentioned in the 9.3 N&N: https://wiki.eclipse.org/CDT/User/NewIn93#Improved_content_assist_in_inactive_code