Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Using ScannerInfoProvider and "Includes" project element

I described it at http://wiki.eclipse.org/CDT/Developer/FAQ#How_do_I_contribute_Include.2FLibrary_paths_or_Macros_to_a_project_configuration_using_LanguageSettingsProvider_extension_point.3F.

To solve this particular problem that you stated - with supplying one set of entries for one specific file and another for all others - you could implement a provider along these lines:

public class YourProvider extends LanguageSettingsBaseProvider {
   public List<ICLanguageSettingEntry> getSettingEntries(ICConfigurationDescription cfgDescription, IResource rc, String languageId) {
      if (your_rc.equals(rc))
         return your_rc_entries;
      else
         return common_entries;
      
   }
}

Thanks,
Andrew


On Tue, Sep 17, 2013 at 12:41 PM, Joseph Henry <Joseph.Henry@xxxxxxx> wrote:

How does that work?

 

Could you give me an example of how to do this?

 

From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Andrew Gvozdev
Sent: Tuesday, September 17, 2013 11:53 AM


To: CDT General developers list.
Subject: Re: [cdt-dev] Using ScannerInfoProvider and "Includes" project element

 

Hi Joseph,

LanguageSettingsProviders are designed to support entries per resource basis. If you have 1 resource that is different you can set the common entries on project level and different set of entries for the specific resource.

 

Thanks,

Andrew

 

On Tue, Sep 17, 2013 at 10:56 AM, Joseph Henry <Joseph.Henry@xxxxxxx> wrote:

I have an interesting problem that maybe somebody on this list could help me with.

 

We have a custom tool chain, and to put it simply, we are required to provide a ScannerInfoProvider implementation so that we can properly return IScannerInfo on a per resource basis. We do this because 1 resource in a project can have a much different include path that another, so putting them all in the LanuageSettings was not acceptable.

 

With all this said, here is my problem:

 

Since we are not using the LanguageSettingProvider to give all the search include paths, the “Includes” project element does not show up any more. This is the UI element that you can expand and see the include folders, and further expand to see the files, etc.

 

Is there any way that I can:

 

1.)    Have this element use the search path that I return from my ScannerInfoProvider

2.)    Append the paths in the Language Settings also. (I still want to have this work so that users have a way to manually specify search paths.)

 

Any help with this would be great. As far as I can tell, the Java class that somewhat control the contents of the Includes element is org.eclipse.cdt.internal.ui.cview.IncludeRefContainer.

 

Thanks,

Joseph Henry.

 

 


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

 


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top