Automatic Formatting

With automatic formatting, a language service automatically inserts a snippet of code when a user begins to type a known code construct.

Automatic Formatting Behavior

For example, when you type if, the language service automatically inserts matching braces, or if you press the ENTER key, the language service forces the insertion point on the new line to the appropriate indent level, depending on whether the preceding line opens up a new scope.

The command filter used for the rest of the language service can also be used for automatic formatting. You can also highlight matching braces by calling HighlightMatchingBrace.

See Also

Concepts

Developing a Language Service