Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Add Include autotriggering

2010/7/17 Tomasz Wesołowski <kosashi@xxxxxxxxx>:
> Hello,
>
> I've found some traces of a feature which would "add includes on code
> assist", as in - I assume - trigger the "Add Include" action when the user
> selects anything from CA; something similar to automatic addition of Imports
> in JDT.
>
> There is some commented code about this in several places. For example, you
> may see
> /org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/contentassist/ContentAssistPreference.java:65:
>
> //    /** Preference key for adding includes on code assist (unused) */
> //    public final static String ADD_INCLUDE=
> "content_assist_add_import";    //$NON-NLS-1$
>
> This preference was apparently removed from the Preferences page around
> 24-01-2007. This is quite some time; we should note that both Context Assist
> and (especially) Add Include have evolved a lot since then.
>
> One of the points of my GSoC is to implement a similar feature in CDT (see
> bug 319175).
>
> I'd like to ask:
> - Was this feature functional in CDT at some time?
> - If so, why was it removed?
> - Who used to work on it?

I'm not even sure. We've always been hesitant about add includes since
you don't always know in the file where to add it. At least the team I
was with pre 2006 was. Assuming it was them. Did you go back even
further in history and see when it was added and by who?

The main gotcha I can think of is that the file where something is
defined is often not the file you need to include. Like for Windows,
you need to include files in a certain order for them to compile which
is why you include windows.h for most things. I recommend giving some
thought to that before proceeding.


Back to the top