This command displays the properties of the currently selected language. The Language Properties dialog box appears when you click the Properties button in the Preferences: Language dialog box.
Source Insight supports two types of languages: Built-in and Custom. You can alter a few options for built-in languages. For custom languages, you can control all the parameters for a generic language.
The Info page is used to edit the name of the language, and a comment. Clicking the Keywords… button opens the Language Keywords dialog box.
Each language has basic options that govern how Source Insight treats files with this language. Built-in languages, such as C/C++ have fewer options in this page than do custom languages.
Contains program source code
If enabled, then Source Insight will consider this a programming language. Certain features are altered when a programming language is used, as opposed to a simple textual language. For instance, references to declared symbols are displayed in the "Ref to …" styles.
Case sensitive text
This indicates whether the language is case sensitive or not. This affects how keywords are matched, as well as how symbols names are resolved in the symbol lookup engine.
Uses C preprocessor
If enabled, then Source Insight will recognize #if and #ifdef preprocessor directives.
Allow smart tab
If enabled, then the Smart Tab feature will be enabled when editing this type of language. If not enabled, then Smart Tab will perform like a simple tab.
Use Syntax Formatting
If enabled, then Syntax Formatting will be used when displaying files in this language.
Detect comment styles
If enabled, then special comment styles will be detected. See: Comment Styles.
Non-AlphaNum identifier chars
This text box contains the set of all valid non-alpha-numeric identifier characters. Alpha-numeric strings are always considered identifiers.
Detect numbers
If enabled, then numbers found in the text are formatted with the "Number" style. The check boxes following this enable special number formats for hex and octal numbers.
The Comments and Ranges page is where you specify how comments and other multi-line range elements are parsed. A quoted string is an example of a non-comment multi-line range element.
Add…
Click this button to add a new range element. The Range Definition dialog box will appear. See: Range Definition.
Delete
Deletes the selected range element.
Edit…
Opens the Range Definition dialog box so that you can edit the range element's properties. See: Range Definition.
Delete All
Deletes all range elements.
The Range Definition dialog box appears when you add a new range element, or edit a range element in the Language Properties: Comments and Ranges dialog box. It controls all the properties of a range. A range definition specifies how comments and other multi-line range elements are parsed. A quoted string is an example of a non-comment multi-line range element.
Type of range
Select the type of range element from this list. There are two types of range elements:
Line The range starts with a delimiter, and extends to the end of the line. It cannot span more than a single line.
Multiline The range starts with a delimiter, and ends with another delimiter. The range can span more than single line, but it can also be contained within a single line. The starting and ending delimiter can be the same (such as a quote).
The list also contains presets for single and double quoted string ranges, and some comment styles. When you select one of the presets, the parameters for the preset are loaded into the other text boxes in the dialog box.
Syntax Formatting Style
This specifies the syntax formatting style to apply to the range. Normally, you would select a comment style. However, you are free to select any style. If the range element describes a quoted string, you would probably want to select the "String" style. See: Style Properties.
The style is applied to the whole range. The style overrides any other automatically applied style, such as "Reference To…" styles.
Range begins/ends with
These two text boxes specify the delimiter tokens that start and end the range. The tokens can be up to 15 characters long. If a Line range type is specified, then there is only one delimiter text box enabled. If you are specifying a Multiline range, the beginning and ending delimiters can be the same. This would be the case for a quoted string.
Escape sequence
If either the Begin or End delimiter is preceded by this escape sequence, then the delimiter is ignored. For example, you might specify backslash \ as an escape character in a quoted string so that you can embed quote characters inside the string like this: "a string with \"embedded\" quotes".
Allow nesting
This applies only if a Multiline range is specified. If this option is turned on, then the range can be nested. If the Begin and End delimiters are the same, nesting is not allowed because it doesn't make any sense.
Skip symbol parsing
The contents of the range will be ignored when the file is parsed for symbol definitions.
Include delimiters in style
The Begin and End delimiters are also formatted with the selected style. If this is unchecked, then the delimiters are formatted in the "Delimiter" style.
Columns Group
The columns group allows you to control if the range element should be sensitive to where on the line it occurs.
Only valid in the following columns
If enabled, then the range is only recognized if its Begin delimiter occurs in the range starting at the First column and up to and including the Last column. If this check box is unchecked, then the column is ignored.
The Custom Parsing page is where you can type a set of regular expressions to perform simple parsing operations on the language source files.
Use regular expressions for parsing
This enables the custom parsing expressions. Uncheck this to disable the use of custom parsing.
Expressions
This lists each parsing expression and the type of symbol it yields. When Source Insight parses a file, all the expressions are applied to the whole file.
Add…
Click this button to add a new parsing expression to the list. See: Custom Parsing Expression.
Delete
Click this to delete the selected expression.
Edit…
Click this to edit the expression. See: Custom Parsing Expression.
Delete All
Click this to delete all the expressions from the list.
When you click the Add or Edit button in the Custom Parsing dialog box, the Custom Parsing Expression dialog box appears.
Regular expression pattern:
This text box contains the regular expression used to parse a symbol definition out of a file. The expression should contain one group. The group describes what part of the matching pattern is the symbol name. Using a custom pattern allows you to parse symbols out of files for which Source Insight has no built-in knowledge. For example, the following string parses sections out of .INI files like WIN.INI.
^\[\(.*\)\]
For more information, see Regular Expressions.
Finds this symbol type:
This pull-down list specifies what type of symbol is found by the parsing pattern. The list contains all of the possible symbol types. The symbol types are fixed and cannot be extended. The symbol type also determines the syntax formatting style used to display the symbol.
The symbol type specified for the custom parsing expression determines the style that will be used to display the symbol's declaration and references. Each symbol type X has a corresponding "Ref to X" and "Declare X" style.
When a symbol definition is parsed, the corresponding "Declare…" style is used when displaying the symbol name. For example, if the symbol definition is a Function, then the function name will be displayed in the "Declare Function" style. See: Style Properties.