Reference Styles

References to symbols that are not actual declarations are formatted with an appropriate "Reference" style. There are reference styles for different types of symbols. Reference formatting gives you a lot of information without having to ask for it. It becomes instantly obvious if you have misspelled a function name, or whether you are using a constant, or a local variable, or a global variable.

For example, a code fragment might look like:



The call to "SeekTokenLnIch" is formatted with the "Ref to Function" style. The C macro function "Hdo­cOfTgl" is formatted with the "Ref to Macro" style, which helps you know just by looking at it that it is a macro. The parameter "hpar" is formatted with the "Ref to Parameter" style, so we know it is a parameter passed to the current function. The identifier "htglLocal" is formatted with the "Ref to Local Variable" style, so we know it is a local variable in the current function. The "kswaChangeMark" constant is formatted with the "Ref to Constant" style, so we know it is either a #define or enum value.

Distinguishing Class and Struct Members

Reference styles are also useful to distinguish member variables and member functions from other variables. In this example, the function DoSomething is referencing both member variables, and a file-scope function and a global variable. The reference styles make each reference look different. The Ref To Member styles in this example have been given the Italic property. So, for example, the references to valueTest inside the DoSomething function is shown in italic. This tells you that valueTest is a member variable.



If you select Options > Style Properties, you can see all the reference styles. Their names all start with "Ref to...".

Enabling reference formatting can slow the display down in some cases. Source Insight needs to perform sym­bol lookup operation each time it encounters a potential symbol reference.