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 239664 - Code assistance settings keep resetting
Summary: Code assistance settings keep resetting
Status: REOPENED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project Discovery (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-19 16:40 UTC by Urkle
Modified: 2015-10-28 12:24 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 Urkle 2013-12-19 16:40:48 UTC
I have a new C++ project I setup (cmake existing sources) and I set the project-level code assistance settings to override the preprocessor defines..  However after compiling the project those settings continually keep getting cleared out after a successful compile.   This is getting EXTREMELY aggravating as the code assistance will then determine the code block I'm working on to be "not compiled" and dims it.. Forcing me to reset the code assistance preprocessor defines again.
Comment 1 Alexander Simon 2013-12-20 06:57:22 UTC
Hi Urkle,

IDE has a feature "configure project after build". The feature analyze build artifacts (exec log) and reconfigure project by exec log.
You can turn off the feature. Unselect check box in Project Properties->Code Assistance->Use Build Analyzer.

Could you explain why you modify project settings.
Is it a bug in "Build Analyzer"? I.e. build analyzer does not detect right preprocessor defines. If so, please provide more info how to reproduce the problem.
Comment 2 Alexander Simon 2013-12-20 07:07:08 UTC
Another work around is:
- add preprocessor defines in the tool collection Tools->Options->C/C++->Code Assistance->Macro Definitions
Comment 3 Alexander Simon 2013-12-20 12:56:46 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/d85ce199576f
Comment 4 Alexander Simon 2013-12-20 13:30:47 UTC
Ignore comment #3
Comment 5 Urkle 2013-12-20 17:02:51 UTC
"why I am modified the build props" So I was working on Allegro4 (for the Mac+Linux port of Gemini Rue).  And they have a bunch of loadable modules of which I was writing a new sound module..  the Cmake build system does a "2-pass" on the source file. the first pass is for modules built-into the main library which is disabled.. The second pass is when each module is compiled.

So the netbeans Build analyzer is picking up the first pass settings which would specifically pick up the define ALLEGRO_WITH_MODULES

causing this block

#if (defined ALLEGRO_WITH_SDL2DIGI) && ((!defined ALLEGRO_WITH_MODULES) || (defined ALLEGRO_MODULE))

to disable all the code inside.  However since I'm writing that code FOR the module I really want it enabled, thus I was overriding the setting with ALLEGRO_MODULE so I could see all the syntax/errors get code completion etc..

IMHO the UI should either allow overriding/adding settings on-top of the auto settings OR it should clearly mark that these settings will be overwritten by the build analyzer if the project has the setting turned on.
Comment 6 Vladimir Voskresensky 2013-12-20 20:04:21 UTC
Looks very similar as duplicate of issue #217778
Comment 7 Urkle 2013-12-20 20:27:05 UTC
Yes. this does sound VERY similar to that bug.  However a "simpler" fix might be to simply allow adding additional preprocessor defines that are always applied in addition to the detected config that way us "advanced" users can get the view working the way we want.  And that doesn't require implementing multiple-compilations of a compilation unit.
Comment 8 Vladimir Voskresensky 2013-12-20 20:48:23 UTC
you are right. And as Alexander pointed out already now you have workaround:
- after the first auto config, switch off in project properties Code Assistance->Use Build Analyzer, then add your ALLEGRO_WITH_MODULES into Undefined macro section
Comment 9 Vladimir Voskresensky 2013-12-20 20:50:26 UTC
(if I got you right, you need to undef some macro, not define extra one, right?)

If you need to define macro, then the workaround is:
-Tools->Options->C/C++, activate Code Assistance page
-for both C and for C++ add in macro section your macro
Comment 10 Urkle 2013-12-20 20:57:39 UTC
In my case I was defining  ALLEGRO_MODULE. but I could have undeffed the other define too.

Thanks for helping out so quickly on this..
Comment 11 PolesApart 2014-03-17 14:47:23 UTC
(In reply to Urkle from comment #7)
> Yes. this does sound VERY similar to that bug.  However a "simpler" fix
> might be to simply allow adding additional preprocessor defines that are
> always applied in addition to the detected config that way us "advanced"
> users can get the view working the way we want.  And that doesn't require
> implementing multiple-compilations of a compilation unit.

+1 on that.