Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Problem with adding entries to language settings provider in CDT plugin
  • From: "Waterlander, Erwin" <erwin.waterlander@xxxxxxxxx>
  • Date: Mon, 13 Jul 2020 15:21:15 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wjnMbUQjbYJPOfJmEx+He9dzOKTh9MvDiu4ujEhtYyo=; b=XdbNAO3/hg4hom9D3yvZyro9ZjiKeyZqmsjOdBb5FZkvle6JOMDOm0c+kUuS5AnWtNu9+iY6miEFlgg6AbGTTx3wbdKjmYpebhrdjJQbUlRpgcBs7NyNrU0olHWkVgij4wZVbHv1E/jnD6XubKk6F+u+CXNBatLiJFEjAaYQnAr+lKNPchwviYG5L/eN818VB2a/fUZih+yA24thnkM5MKe0d+8M206O544omEFiIIDccdwS9zpvipCAJHa1tAiZBAmaqobrmnHZ7SETnoH+hPzIf72DYofEu7EdHgtjw7YqPukvGvvdhiBl3nvesv9XkplzwMP0PGsgriCzFRbnxA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IdqsCumTdcA+tQR9d8lIKnOV4qt1DiGMxIb0Bi8dxM+MB6In6xLgw9Uqsx6le32CXSX9D/+872hdzRfPcwyc0fNvuGuBYoPpY9BxGc/hx50G7P12sbhSc80zOdhviu2LlagvF6hLWd3lMKRqCZVoSTQsu+mWd4rlE1Sbm5eG0ucG1CVWIdDpNNCFs6TK7B1O893sAyKLqH8g4q+OYundrwqoYB5jIuapHYPQB5wYUvmLsyV5C6ULg3ZVCD5+VJn9c09j1z7toTmeLiX9EeG1EC3YMii1ymMGGzAeuCZnBO518ffWTwt/ZOAUPT0+7WS1jSaECh6YFm/MYHvJiMqMOQ==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • Dlp-product: dlpe-windows
  • Dlp-reaction: no-action
  • Dlp-version: 11.2.0.6
  • Ironport-sdr: DIKsfEUn09lQ0GXSRFiOZH++FHjippE8RZ14hvFAmKySOun80fVvKpGeK/EYfPSVCQ+eVLoPMP u5Xyih3lH3Wg==
  • Ironport-sdr: +P1vimZVPsVckBewwLJZGX4GoxJePja00g6M4jr/JE4dAn8NC9pzO6/d42eicK2b9iqhu3GdeT XqC/ZHPFE71A==
  • List-archive: <https://www.eclipse.org/mailman/private/cdt-dev>
  • List-help: <mailto:cdt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AdZZKT5RftkmtXh4SRePpdUd/cCJjg==
  • Thread-topic: Problem with adding entries to language settings provider in CDT plugin

Hi,

When I add an editable language settings provider via the plugin.xml to a CDT plugin per configuration, the entries added in the plugin.xml are not there.
And when I add entries programmatically to the provider they are also not there.
What am I doing wrong?

I took the example from the CDT plugin developers guide and added this to the plugin.xml:

   <extension
         point="org.eclipse.cdt.core.LanguageSettingsProvider">
      <provider
            class="org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider"
            id="org.eclipse.cdt.example.toolchain.provider1"
            name="Example Provider"
            prefer-non-shared="true">
         <entry
               kind="includePath"
               name="org.eclipse.cdt.example.toolchain.entry2"
               value="/project/include">
         </entry>
      </provider>
   </extension>
   <extension
         point="org.eclipse.cdt.ui.LanguageSettingsProviderAssociation">
      <id-association
            id="org.eclipse.cdt.example.toolchain.provider1"
            ui-edit-entries="true">
      </id-association>
   </extension>


         <configuration
               id="org.eclipse.cdt.example.toolchain.configuration1"
               languageSettingsProviders="org.eclipse.cdt.example.toolchain.provider1;org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider;org.eclipse.cdt.ui.UserLanguageSettingsProvider"
               name="Test Release">
               .....
         </configuration>


Adding entries programmatically:


        LanguageSettingsGenericProvider provider = null;

        List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription)
                .getLanguageSettingProviders();
        for (ILanguageSettingsProvider p : providers) {
            if (p.getId().contains("example")) {
                provider = (LanguageSettingsGenericProvider) p;
                break;
            }
        }

        System.out.println("provider id: " + provider.getId());        
        // Output: provider id: org.eclipse.cdt.example.toolchain.provider1
        // No number suffix (?)

        // Get existing entries (from plugin.xml).
        List<ICLanguageSettingEntry> entries = provider.getSettingEntries(cfgDescription, project,
                "org.eclipse.cdt.core.cSource");

       // entries appears to be null. I would expect to see the include path from plugin.xml.

        if (entries == null)
            entries = new ArrayList<ICLanguageSettingEntry>();

        // Add extra include path
        CIncludePathEntry entry;
        entry = CDataUtil.createCIncludePathEntry("/project/include/extra", ICSettingEntry.NONE);
        entries.add(entry);

        provider.setSettingEntries(cfgDescription, project, "org.eclipse.cdt.core.cSource", entries);

        CoreModel.getDefault().setProjectDescription(project, projectDescription);


regards,

-- 
Erwin

---------------------------------------------------------------------
Intel Benelux B.V.
Registered in The Netherlands under number 24134020
Statutory seat: Rotterdam
Registered address: Capronilaan 37, 1119NG Schiphol-Rijk

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



Back to the top