# LanguageSettingsProvider

###### Identifier:

org.eclipse.cdt.core.LanguageSettingsProvider

###### Since:

CDT 8.1

###### Description:

This extension point is used to contribute a new Language Settings Provider. A Language Settings Provider is used to get additions to compiler options such as include paths (-I) or preprocessor defines (-D) and others into the project model.

###### Configuration Markup:

<!ELEMENT extension (provider)+>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED>

This extension point is used to contribute a new Language Settings Provider. A Language Settings Provider is used to get additions to compiler options such as include paths (-I) or preprocessor defines (-D) and others into the project model.

- id - ID of the extension point, not used
- name - Name of the extension point, not used

<!ELEMENT provider (language-scope* , entry*)>

<!ATTLIST provider

class CDATA #IMPLIED

id IDREF #REQUIRED

name CDATA #REQUIRED

parameter CDATA #IMPLIED

prefer-non-shared (true | false) "false">

The definition of a language settings provider.

- class - A fully qualified name of the Java class that implements `org.eclipse.cdt.core.language.settings.providers` interface. If empty, `org.eclipse.cdt.core.language.settings.providers.LanguageSettingsBaseProvider` is used by default which provides basic functionality defined by this extension point.
  In case the provider ever needs to be non-shared, set per project/configuration, or editable in UI - the provider must implement `org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsEditableProvider`. There is a generic implementation `org.eclipse.cdt.core.language.settings.providers.LanguageSettingsGenericProvider` that can be used in most cases.
  If there is a need to configure a provider in more deliberate way, attribute `parameter` could be used in a class extending `LanguageSettingsBaseProvider`.
  Default constructor (constructor without arguments) of this class must be public and the package be exported in order to be able to instantiate via extension point.
- id - Unique ID of the provider.
- name - Name of the provider. This name will be presented to a user in UI.
- parameter - A custom parameter to initialize provider. For example, used to deliver command for GCCBuiltinSpecsDetector.
- prefer-non-shared - A flag indicating that the provider should be owned by a configuration rather than be global in workspace and shared between projects (when the choice has not been indicated yet by other means). This preference is consulted in order to initially set the "shared" attribute, for example when a user adds a provider from the list of extension providers. The value "true" of this attribute is meaningful only for providers capable of being non-shared, i.e. providers extending ILanguageSettingsEditableProvider.

<!ELEMENT language-scope EMPTY>

<!ATTLIST language-scope

id CDATA #REQUIRED>

The definition of language scope. Includes the list of language ID this provider is applicable to. If a language scope is not present, the provider will provide for any language.

- id - ID of the language for which this provider provides the entries. As an example, those are languages contributed by CDT (see extension org.eclipse.cdt.core.language):

  - "`org.eclipse.cdt.core.gcc`" for C,

  - "`org.eclipse.cdt.core.g++`" for C++.

<!ELEMENT entry (flag*)>

<!ATTLIST entry

kind (includePath|macro|includeFile|libraryPath|libraryFile|macroFile)

name CDATA #REQUIRED

value CDATA #IMPLIED>

The Language Settings Entries used to provide additions to compiler options such as include paths (-I) or preprocessor defines (-D) and others into the project model.

- kind - Kind of language settings entry which maps to compiler options. For example, following mapping is used for gcc options:
  "`-I`" : includePath
  "`-D`" : macro
  "`-include`" : includeFile
  "`-L`" : libraryPath
  "`-l`" : libraryFile
  "`-imacros`" : macroFile
- name - "name" attribute maps to path for the entries representing a path to a folder or file and to name for `macro` kind representing name-value pair. For example:
  "`/usr/include/`"
  "`MACRO`" (for `#define MACRO value`)
  Note that relative paths are treated as rooted in build working directory (when applicable).
- value - "value" attribute is used for `macro` kind representing name-value pair only. It is not used for the entries representing a path. For example:
  "`value`" (for `#define MACRO value`)

<!ELEMENT flag EMPTY>

<!ATTLIST flag

value (BUILTIN|LOCAL|RESOLVED|VALUE_WORKSPACE_PATH|UNDEFINED|EXPORTED) >

Combination of flags for the entry.

- value - A value of the flag. Corresponds to `ICSettingEntry` flags, see JavaDoc there for more details. Here is an excerpt from the Javadoc for the flags intended to be used with this extension point (the others might be not supported):
  - `BUILTIN` : Indicates settings built in a tool (compiler) itself. That kind of settings are not passed as options to a compiler but indexer or other clients might need them.
  - `LOCAL` : Applicable for `includePath` only which could be local (#include "...") or system (#include <...>). If an `includePath` is not marked as `LOCAL` it is treated as system.
  - `RESOLVED` : Indicates that the entries do not need to be resolved such as expansion of environment variables, normalizing the path against build working directory etc.
  - `VALUE_WORKSPACE_PATH` : is used to indicate that the entry is a resource managed by eclipse in the workspace. The path is rooted in the workspace root.
  - `UNDEFINED` : indicates that the entry should not be defined, corresponds to `-U` option of gcc compiler. If this flag is defined it will negate entries with the same name (and kind) for all providers down the list.
  - `EXPORTED` : indicates that the entry is exported to referencing projects. It will be passed to the projects configurations referencing the configuration the entry belongs to.

###### API Information:

Plug-ins that want to extend this extension point must implement `org.eclipse.cdt.core.language.settings.providers.ILanguageSettingsProvider` interface.
For those cases where contributed settings entries (representing the compiler options) are not changed dynamically it is sufficient to configure existing class LanguageSettingsBaseProvider which is provided by default.

Copyright (c) 2009, 2013 Andrew Gvozdev and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html