Bug 329995 - Update all C/C++ views when the active configuration changes
Summary: Update all C/C++ views when the active configuration changes
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 10.1.0   Edit
Assignee: Marc-André Laperle CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
: 213300 313944 331639 420796 465605 481090 (view as bug list)
Depends on:
Blocks: 313944 481090
  Show dependency tree
 
Reported: 2010-11-11 08:52 EST by Alex Freidin CLA
Modified: 2020-10-24 14:17 EDT (History)
8 users (show)

See Also:


Attachments
Change the default workspace indexer setting (1.15 KB, patch)
2010-11-11 09:41 EST, Alex Freidin CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Freidin CLA 2010-11-11 08:52:47 EST
Build Identifier: 20100617-1415

Today, when changing an active configuration, non of the relevant views is updated: Editor, Outline, Project Explorer. That's because the default indexer setting is set to bind all these views to a single build configuration - Debug. Users  frequently complain about that and expect the views to update automatically like in other IDEs, e.g. Visual Studio.
If my understanding is correct, current Indexer setting was selected to avoid performance problems with very large projects. Specifically when setting an indexer to bind to an active configuration, it does full re-indexing when configuration is switched and that can take a long time for very large projects. From user's POV, this is a pure implementation problem.
Ideally, the solution should be fixing the indexer performance and changing the default setting.
Meanwhile, I believe that very large projects are mainly makefile based and changing configurations is not an issue there. Therefore, any interested party for who huge managed projects are more an exception than normal, can use the indexer which is bound to active configuration such that all views update at configuration switch.
I'll post a patch shortly.

Reproducible: Always
Comment 1 Alex Freidin CLA 2010-11-11 09:41:12 EST
Created attachment 182901 [details]
Change the default workspace indexer setting

Makes the indexer work based on active build configuration by default.
Comment 2 Andrew Gvozdev CLA 2010-11-11 09:52:00 EST
I am not sure what is the point of this patch. Obviously "the implementation problem" of "fixing the indexer performance" has to be resolved first.
Comment 3 Alex Freidin CLA 2010-11-11 10:08:55 EST
(In reply to comment #2)
> I am not sure what is the point of this patch. Obviously "the implementation
> problem" of "fixing the indexer performance" has to be resolved first.

I wasn't aware of https://bugs.eclipse.org/bugs/show_bug.cgi?id=183781, but in any case it should be applied after that bug is fixed.
The immediate use of the patch is for audience that do not necessary deal with huge projects. So, instead of hiding a performance problem by introducing wrong system behavior, which is the current state, with this patch one would only notice a problem with very large projects and then workaround it by binding the indexer to some constant configuration.
Comment 4 Andrew Gvozdev CLA 2010-11-11 11:04:06 EST
Take a look at bug 172919 where the feature was implemented and decision about defaults was made. I agree with that. While arguable there are more users who want to link indexer to active build configuration, it is just an inconvenience (and admittedly confusion) of having hard to discover the option in preference. On the other hand such a default would make the switching unusable out of the box for those with big projects, and it applies not only to managed but to Standard Makefile projects as well.
Comment 5 James Blackburn CLA 2010-12-02 10:23:44 EST
*** Bug 213300 has been marked as a duplicate of this bug. ***
Comment 6 James Blackburn CLA 2010-12-02 10:49:15 EST
For what it's worth, I think the current default is extremely confusing to new users. For the reasons below, I believe changing it in the base CDT would benefit many more users than it hurts.

Large projects, which take a long time to index, likely have an external build system, and likely use fewer configurations than managedbuild projects. This is because:
   - make targets aren't tied to configurations
   - scanner discovery is not configuration aware
So the users of large projects gain little benefit (with stock CDT) in using multiple configurations.

For users of managedbuild the opposite is true.  Multiple configurations are frequently used (by default there are 2) and users almost instantly encounter this issue.

As a result I believe if we change the default, and show code 'correctly', fewer users will be confused, and users with large projects will on the whole be unaffected.

We should also make it easy for products to override the default in their customization.ini, and we can provide a FAQ entry for users of the stock CDT on how to stop the indexer from running when changing build configurations.
Comment 7 Andrew Gvozdev CLA 2010-12-02 11:00:12 EST
I agree that it is very confusing. I think we could reduce the confusion in UI, see suggestion in bug 313944. That should be easy enough to do.
Comment 8 Alex Freidin CLA 2010-12-05 04:33:09 EST
To add to James point, the performance issue concerns only a certain percentage of users. The re-indexing triggered by configuration switch is visible in UI and the user has a clear understanding what's going on and a full control to modify indexer settings. 
On the other hand, in practice, it is not possible to deduct that the views show wrong data not because of a bug in CDT, but due to indexer setting, deep in the project properties.
Since we're not in consensus, I think it's a good idea to make this setting customizable.
Also, reducing confusion in UI is welcome.
Comment 9 James Blackburn CLA 2010-12-06 09:42:17 EST
*** Bug 331639 has been marked as a duplicate of this bug. ***
Comment 10 Marc-André Laperle CLA 2014-06-25 17:14:36 EDT
*** Bug 420796 has been marked as a duplicate of this bug. ***
Comment 11 Marc-André Laperle CLA 2015-04-28 22:16:57 EDT
*** Bug 465605 has been marked as a duplicate of this bug. ***
Comment 12 Marc-André Laperle CLA 2020-10-05 12:51:15 EDT
The default is just too confusing. I now think it's better to change the default to using the active config and let other people affected by slow indexing time modify the preference if necessary.

(In reply to James Blackburn from comment #6)
> Large projects, which take a long time to index, likely have an external
> build system, and likely use fewer configurations than managedbuild
> projects. This is because:
>    - make targets aren't tied to configurations
>    - scanner discovery is not configuration aware
> So the users of large projects gain little benefit (with stock CDT) in using
> multiple configurations.

A lot of build systems heavily use configurations. My projects have hundreds of configs and are large. In any case, in those more advanced scenarios, I still think people can tweak preferences to only use a fixed config if that makes sense. In my case, even with a large project that takes forever to index, it still doesn't make sense to use a fixed config, as target platforms are quite different.

Scanner discovery is also now configuration-aware, MBS through Language Settings Providers and I think also Core build.
Comment 13 Eclipse Genie CLA 2020-10-05 13:05:18 EDT
New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/170333
Comment 15 Marc-André Laperle CLA 2020-10-24 13:27:24 EDT
*** Bug 313944 has been marked as a duplicate of this bug. ***
Comment 16 Marc-André Laperle CLA 2020-10-24 14:09:44 EDT
*** Bug 481090 has been marked as a duplicate of this bug. ***
Comment 17 Marc-André Laperle CLA 2020-10-24 14:17:31 EDT
I'm going to remove bug 183781 as a dependency. Having bug 183781 resolved would have made the decision to change the default easier but now that the default is changed, that bug is an independent performance improvement.