Everything
2.4.6 Use the smart edit function

The smart edit function is used to complement the names of functions, variables and the arguments of functions during input to C/C++ source files and offer them as candidates.

The smart edit function operates with the items listed below.

-

Global functions

-

Global variables

-

Struct or union members

-

Class member functions (only for C++ source files) [CC-RX]

-

Class member variables (only for C++ source files) [CC-RX]

Figure 2.9

Display Example of Smart Edit Function

Caution 1.

This function is supported only when the build tool provided by CS+ (CC-RH/CC-RX/CC-RL) is used (i.e. this function is disabled when an external build tool is used).

Caution 2.

This function is disabled when the Mixed display mode is selected.

Caution 3.

The function does not work with structures where nesting is to the third level or deeper.

 

The smart edit function displays the following items.

 

(1)Candidates for functions/variables/arguments of functions

(2)Pop-up of the function/variable information

 

Note that follow the procedure below to enable the smart edit function.

-

Select the [Smart edit] check box in the [Text Editor - General / Debug] category of the Option dialog box (default).

-

Candidates are displayed by using the cross reference information that is generated by the build tool. Therefore, specify [Yes(-Xcref)][CC-RH][CC-RX]/[Yes(-cref)][CC-RL] with the [Output cross reference information] property on the Property panel of the build tool to be usedNote, and then run and complete a build.
If an error in building occurs, the cross reference information before the error occurred is used if any exists.

Note

If this setting is invalid, the smart edit function cannot be used since the output will be empty of the cross reference information.

(1)

Candidates for functions/variables/arguments of functions

(a)

How to display

Candidates for functions/variables are displayed when:

-

"." or "->" is input if there is a relevant member for the left side.

-

"::" is input if there is a relevant member for the left side (only for C++ source files) [CC-RX].

-

The [Ctrl] + [Space] key on the keyboard is pressed (all candidates are displayed).
However, if there is only one candidate, the relevant character string is inserted at this time without displaying the candidate.

Caution

If you enter an incomplete member name and press [Ctrl] + [Space], CS+ does not suggest a correct name.

 

Candidates for arguments of functions are displayed when:

-

In a function name, "(" is input if there is a relevant function on the left side of "(".

-

The [Ctrl] + [Shift] + [Space] key on the keyboard is pressed while the text cursor is at the location of an argument for a function.

(b)

How to insert character strings

Select a character string from the candidates list by using the [Up]/[Down] key or the mouse, then press the [Enter] key or the [TAB] key.

(c)

Termination of the candidates display

The candidates display disappears by any one of the following methods.

-

Press the [ESC] key

-

Enter a key other than an alphanumeric character

When nothing is selected from the candidates list: This operation has no effect.
When an item is selected in the candidates list: The selected character strings are inserted.

(d)

Description of each area (candidates for functions and variables)

Figure 2.10

Display of Candidates for Functions and Variables

<1>

Candidates list

Displays candidates for functions and variables in alphabetical order.
If there are character strings that match to the character strings at the caret position, they are highlighted (case insensitive).
The following icons are displayed as labels for the list of candidates.

Icon

Description

 

Shows that the candidate is for a typedef.

 

Shows that the candidate is for a function.

 

Shows that the candidate is for a variable.

 

Shows that the candidate is for a class type. [CC-RX]

 

Shows that the candidate is for a structure type.

 

Shows that the candidate is for an union type.

 

Shows that the candidate is for a namespace. [CC-RX]

 

Shows that the candidate is for a protected member. [CC-RX]

 

Shows that the candidate is for a private member. [CC-RX]

<2>

Toolbar

Switches whether candidates for functions and variables are displayed or not.

Button

Description

 

Displays candidates for functions.

 

Displays candidates for variables.

<3>

Tab

Switches the members to be displayed.

Tab Name

Description

All members

Displays all candidates.

Public members

Displays only the candidates with the public attribute.

<4>

Detailed display

Displays details of candidates for functions or variables currently being selected.

Item

Description

(1)

Kind

Shows whether the selected item is a function or a variable.

(function): Shows the selected item is a function.

(variable): Shows the selected item is a variable.

(2)

Type

Shows the type of the function or the variable.

(3)

Name

Shows the name of the function or the variable.

(4)

Attribute and type

Shows the type of the function or the variable.

[CC-RX]

When the attribute is defined, the access specifier (public/protected/private) is displayed at the head.

(5)

Name and argument

Shows the name of the function or the variable.

When the item is a function, its arguments are also shown.

[CC-RX]

When the item is an overloaded function, the number of times overloaded is displayed in parentheses "( )".

(e)

Description of each area (candidates for arguments of functions)

Figure 2.11

Display of Candidates for Arguments of Functions

Item

Description

(1)

Type

Shows the type of the function or the variable.

(2)

Name and argument

Shows the name of the function and its arguments.

The argument at the current caret position is highlighted.

(3)

Candidate for argument

Shows the name of the function and its arguments.

(4)

Attribute

Shows the attribute (public/protected/private) of the argument. [CC-RX]

(5)

Name and argument

Shows the number of candidates if multiple candidates exist.

Click the or mark to change the candidate.

(f)

Notes for displaying of candidates list

-

The following items are not the subject of the candidates display.

-

Macro definitions

-

Local variables

-

Typedef statements

-

When a structure, union or class [CC-RX] is declared within a function, candidates are not displayed within the function after its own declaration.

-

In some cases the type of variables to be displayed differs from that actually declared when a compiler option which affects the size of variables is set.

-

const and mutable attribute are not displayed.

-

For C++ source files [CC-RX]

-

Namespaces and subclasses (classes declared within classes) are not supported.

-

Candidates for the names of functions and variables are not displayed in response to the input of "(*class)" or "(*this)".

-

Candidates for the names of functions and variables are not displayed for an array declared within a class.

-

When candidates for the names of functions and variables are displayed by using the [Ctrl] + [Space] key combination while a class name is specified to the left and input of a method name is incomplete, the candidates displayed are the names of global functions and variables instead of candidates for the names of functions and variables in the class.

(2)

Pop-up of the function/variable information

When the mouse cursor is hovered over a function name or a variable name on the source text, the information about that function or variable appears in a pop-up.
Note the following, however, when using this function.

-

This function cannot be used when connected to the debug tool.

-

Structures/unions and member functions [CC-RX] declared in header files cannot be displayed in a pop-up.

-

If arguments for the function include a call of another function, incorrect information will be displayed in a pop-up.

Example

myClass.func(myClass.funcStr(

-

const, static, volatile and virtual [CC-RX] attributes cannot be displayed in a pop-up.

-

If the target is a variable of class [CC-RX], structure, union, or enumeration type, its members are displayed as follows:

-

If the target is a class- [CC-RX], structure-, or union-type variable, the types and names of its members are displayed.
If the target is a class-type variable [CC-RX] that includes methods (functions) among its members, the types of the return values and names of the methods (functions) are displayed. Also, "(" ")" is appended to the end of each method name.

-

If the target is an enumeration-type variable, only the names of the members are displayed.

-

Members are displayed in the same order as they are defined in the source file, and each is placed on a single line (up to 20 members can be displayed).

-

For C++ source files [CC-RX]
friend attribute is not supported.

 

The meaning of each icon displayed in a pop-up is described below.

Icon

Description

 

Shows that the target is for a typedef.

 

Shows that the target is for a function.

 

Shows that the target is for a variable.

 

Shows that the target is for a class type. [CC-RX]

 

Shows that the target is for a structure type.

 

Shows that the target is for an union type.

 

Shows that the target is for a namespace. [CC-RX]

 

Shows that the target is for an enumeration type.

Figure 2.12

Pop-up Display of Smart Edit Function

 

Caution

Even if you hover the mouse over code immediately after #ifdef to #endif, no information on the function or variable will be displayed in a pop-up. Members will not be suggested either.
Also, no information on a first variable between #ifdef and #endif will be displayed in a pop-up if you place the mouse over the variable in code that follows #endif. Members will not be suggested either.