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 235706 - "exclude from code assistance" defaults to true for new files in project
Summary: "exclude from code assistance" defaults to true for new files in project
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
: 236968 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-09-09 13:08 UTC by david_allen
Modified: 2014-01-02 18:00 UTC (History)
1 user (show)

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 david_allen 2013-09-09 13:08:23 UTC
I have a Project Group comprising of many Projects created of type "C++ project with Existing Sources".

Currently, if a new cpp file is detected in the folder for one of these projects then it is automatically added to the project. This is great :). If one of my fellow developers adds this new file (they use MS VisualStudio), then I will automatically get this new file in my project. All is good.

Prior to 7.3 (I think) then this new cpp file would automatically be indexed by the Code Assistance. 

However, I have noticed (since 7.3 I think) that if a new cpp file is automatically detected and added in the above scenario, then it is added with a property "Exclude from Code Assistance" of True.  This seems to be a change in behaviour.

I find this change to be particularly difficult for my usage of Netbeans, since I now have to track what files have been added by others and ensure that I go to each file and set this property. Is it possible that the default could be "Exclude from Code Assistance" of False?
Comment 1 david_allen 2013-09-09 16:34:12 UTC
I have also noticed that the new files are not being automatically added to the project configurations.xml.  I believe that it used to add them automatically in netbeans 7.2.
By the way, my projects are generated from "Existing Sources" and are based off the CMake CMakeLists.txt (and its generated unix Makefile).
I have also just upgraded to netbeans 7.3.1 and this issue still appears to be present.
Comment 2 Vladimir Voskresensky 2013-09-09 19:24:04 UTC
Hi,

Yes, it was changed as you describe. 
But as soon as you clean&build (or just build) from IDE then NB detects compiler invocation and auto include the file and auto update configuration.xml, no need to manually change property. It solves the problem when file was just added but empty set of settings, so code assistance was not well configured. 

Btw, after clean&build from IDE you can always press "configure code assistance" button on the left side of Output window where you see result of the build. 

Could you confirm, please.
Comment 3 david_allen 2013-09-10 08:20:33 UTC
Hi Vladimir,

Thanks for the fast response.
I do not actually use Netbeans for building, because we have a unix shell script for doing the build. This is because it has additional pre and post build tasks to perform (generating cpp code, packaging javascript etc...) and then calls cmake-generated makefiles.  This means that we have a single build process, which can then also be called from the automated build machines.

I doubt we are the only people who do this on large scale projects (60 NB projects, 3000 cpp files), so it may be worth considering avoiding reliance on build being triggered via NB.  Admittedly there are many ways for people to use Netbeans and so it is a difficult job you have.

Thanks for the information. Now I know how I can automatically include the new files into the Netbeans projects (even if it is not too easy for me).
Comment 4 Alexander Simon 2013-09-10 08:41:20 UTC
Hi David,

NB 7.4 has support of .json file (see bug #233300).
You can try configure code assistance by .json:
Code Assistance->Configure Code Assistance->Advanced Mode->Explore Exec Log File
and select compile_commands.json.

Alexander
Comment 5 Vladimir Voskresensky 2013-09-10 09:40:23 UTC
Hi David,

In NB you can specify anything you type in shell as build command.
I.e. specify as Clean: sh clean.sh
as Build: sh build.sh
And NB still will figure out all automatically :-)
Comment 6 DosBox 2013-12-17 12:00:52 UTC
Hi,

I have the same issue. I am unable to build project on local computer. I am using NB only to develop new codes. I' am using code assistance as "Search file system for C/C++ header files", and it is a huge pain when new files added by pull from repository are excluded from CA. 
Is there any possibility to add feature like "Add all (or multiple) files to code assistance" or to list files that are not added? Searching for them manually is nearly impossible.

Is there any workaround besides building app? I say again, I am unable to build whole project, that takes several hours, only to force NetBeans to include new files to CA.

I will appreciate any kind of help here.

Regards,
Darek
Comment 7 Alexander Simon 2013-12-19 10:34:33 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/ebb2238af3af

Added Project Properties->Code Assistance->Extra Source Files check box.
If the check box is selected, all source files will be included in code assistance regardless of exclude from code assistance check box.
Comment 8 Quality Engineering 2013-12-24 02:42:42 UTC
Integrated into 'main-silver', will be available in build *201312240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/ebb2238af3af
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #235706 "exclude from code assistance" defaults to true for new files in project
Comment 9 pinbender 2014-01-02 18:00:21 UTC
*** Bug 236968 has been marked as a duplicate of this bug. ***