mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Bug 45203. A preference for forward-declaring external variables.
This commit is contained in:
parent
073237d901
commit
fba15d74dc
5 changed files with 22 additions and 4 deletions
|
@ -35,6 +35,7 @@ public class OrganizeIncludesBlock extends OptionsConfigurationBlock {
|
|||
private static final Key KEY_FORWARD_DECLARE_COMPOSITE_TYPES = getCDTUIKey(PreferenceConstants.FORWARD_DECLARE_COMPOSITE_TYPES);
|
||||
private static final Key KEY_FORWARD_DECLARE_ENUMS = getCDTUIKey(PreferenceConstants.FORWARD_DECLARE_ENUMS);
|
||||
private static final Key KEY_FORWARD_DECLARE_FUNCTIONS = getCDTUIKey(PreferenceConstants.FORWARD_DECLARE_FUNCTIONS);
|
||||
private static final Key KEY_FORWARD_DECLARE_EXTERNAL_VARIABLES = getCDTUIKey(PreferenceConstants.FORWARD_DECLARE_EXTERNAL_VARIABLES);
|
||||
private static final Key KEY_FORWARD_DECLARE_TEMPLATES = getCDTUIKey(PreferenceConstants.FORWARD_DECLARE_TEMPLATES);
|
||||
private static final Key KEY_FORWARD_DECLARE_NAMESPACE_ELEMENTS = getCDTUIKey(PreferenceConstants.FORWARD_DECLARE_NAMESPACE_ELEMENTS);
|
||||
|
||||
|
@ -57,6 +58,7 @@ public class OrganizeIncludesBlock extends OptionsConfigurationBlock {
|
|||
KEY_FORWARD_DECLARE_COMPOSITE_TYPES,
|
||||
KEY_FORWARD_DECLARE_ENUMS,
|
||||
KEY_FORWARD_DECLARE_FUNCTIONS,
|
||||
KEY_FORWARD_DECLARE_EXTERNAL_VARIABLES,
|
||||
KEY_FORWARD_DECLARE_TEMPLATES,
|
||||
KEY_FORWARD_DECLARE_NAMESPACE_ELEMENTS,
|
||||
};
|
||||
|
@ -95,6 +97,9 @@ public class OrganizeIncludesBlock extends OptionsConfigurationBlock {
|
|||
control = addCheckBox(composite, PreferencesMessages.OrganizeIncludesBlock_forward_declare_functions,
|
||||
KEY_FORWARD_DECLARE_FUNCTIONS, TRUE_FALSE, 0);
|
||||
LayoutUtil.setHorizontalSpan(control, 2);
|
||||
control = addCheckBox(composite, PreferencesMessages.OrganizeIncludesBlock_forward_declare_external_variables,
|
||||
KEY_FORWARD_DECLARE_EXTERNAL_VARIABLES, TRUE_FALSE, 0);
|
||||
LayoutUtil.setHorizontalSpan(control, 2);
|
||||
control = addCheckBox(composite, PreferencesMessages.OrganizeIncludesBlock_forward_declare_templates,
|
||||
KEY_FORWARD_DECLARE_TEMPLATES, TRUE_FALSE, 0);
|
||||
LayoutUtil.setHorizontalSpan(control, 2);
|
||||
|
|
|
@ -502,9 +502,10 @@ public final class PreferencesMessages extends NLS {
|
|||
public static String OrganizeIncludesBlock_allow_reordering;
|
||||
public static String OrganizeIncludesBlock_forward_declare_composite_types;
|
||||
public static String OrganizeIncludesBlock_forward_declare_enums;
|
||||
public static String OrganizeIncludesBlock_forward_declare_external_variables;
|
||||
public static String OrganizeIncludesBlock_forward_declare_functions;
|
||||
public static String OrganizeIncludesBlock_forward_declare_templates;
|
||||
public static String OrganizeIncludesBlock_forward_declare_namespace_elements;
|
||||
public static String OrganizeIncludesBlock_forward_declare_templates;
|
||||
public static String OrganizeIncludesBlock_heuristic_header_substitution;
|
||||
public static String OrganizeIncludesBlock_partner_indirect_inclusion;
|
||||
public static String OrganizeIncludesBlock_unused_statements;
|
||||
|
|
|
@ -559,9 +559,10 @@ OrganizeIncludesPreferencePage_title= Organize Includes
|
|||
OrganizeIncludesBlock_allow_reordering= Allow &reordering of includes
|
||||
OrganizeIncludesBlock_forward_declare_composite_types= Forward declare &classes, structs and unions
|
||||
OrganizeIncludesBlock_forward_declare_enums= Forward declare &enums when possible
|
||||
OrganizeIncludesBlock_forward_declare_external_variables= Forward declare external &variables
|
||||
OrganizeIncludesBlock_forward_declare_functions= Forward declare &functions
|
||||
OrganizeIncludesBlock_forward_declare_templates= Forward declare &templates
|
||||
OrganizeIncludesBlock_forward_declare_namespace_elements= Forward declare &namespace elements
|
||||
OrganizeIncludesBlock_forward_declare_templates= Forward declare &templates
|
||||
OrganizeIncludesBlock_heuristic_header_substitution= Allow &heuristic header file substitution
|
||||
OrganizeIncludesBlock_partner_indirect_inclusion= Skip include if included by &partner header
|
||||
OrganizeIncludesBlock_unused_statements= &Unused Includes and Forward Declarations:
|
||||
|
|
|
@ -39,8 +39,7 @@ public class IncludePreferences {
|
|||
public final boolean forwardDeclareCompositeTypes;
|
||||
public final boolean forwardDeclareEnums;
|
||||
public final boolean forwardDeclareFunctions;
|
||||
// TODO(sprigogin): Create a preference for this.
|
||||
public final boolean forwardDeclareExternalVariables = false;
|
||||
public final boolean forwardDeclareExternalVariables;
|
||||
public final boolean forwardDeclareTemplates;
|
||||
public final boolean forwardDeclareNamespaceElements;
|
||||
public final UnusedStatementDisposition unusedStatementsDisposition;
|
||||
|
@ -75,6 +74,8 @@ public class IncludePreferences {
|
|||
PreferenceConstants.FORWARD_DECLARE_ENUMS, project, false);
|
||||
forwardDeclareFunctions = PreferenceConstants.getPreference(
|
||||
PreferenceConstants.FORWARD_DECLARE_FUNCTIONS, project, false);
|
||||
forwardDeclareExternalVariables = PreferenceConstants.getPreference(
|
||||
PreferenceConstants.FORWARD_DECLARE_EXTERNAL_VARIABLES, project, false);
|
||||
forwardDeclareTemplates = PreferenceConstants.getPreference(
|
||||
PreferenceConstants.FORWARD_DECLARE_TEMPLATES, project, false);
|
||||
forwardDeclareNamespaceElements = PreferenceConstants.getPreference(
|
||||
|
|
|
@ -1985,6 +1985,16 @@ public class PreferenceConstants {
|
|||
*/
|
||||
public static final String FORWARD_DECLARE_FUNCTIONS = "forwardDeclare.functions"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Whether external variables should be forward declared if possible.
|
||||
*
|
||||
* Example:
|
||||
* extern int errno;
|
||||
*
|
||||
* @since 5.7
|
||||
*/
|
||||
public static final String FORWARD_DECLARE_EXTERNAL_VARIABLES = "forwardDeclare.externalVariables"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Whether C++ templates should be forward declared if possible.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue