ProvideLanguageServiceAttribute.ShowSmartIndent Property

 

Determines if the Smart Indenting option is enabled in the Options dialog box.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

public bool ShowSmartIndent { get; set; }

Property Value

Type: System.Boolean

Returns true if the Smart Indenting option is enabled; otherwise, returns false.

There are three basic styles of indenting control: None, Block, and Smart. Each controls the behavior of indenting when a new line is typed in the source code. These three options are selectable in the Options dialog box (available under the Tools -> Options menu), typically under the Tabs property page for each language. If the ShowSmartIndent property is set to true, then the indenting option for Smart can be changed. This also indicates that the language service supports smart indenting. Visual Studio can support the None and Block modes without knowing the language being edited, but the Smart indenting option requires knowledge of the language to set the proper indentation levels.

This property is available to any language service implementation.

The default is false indicating the Smart indent option is disabled.

The registry entry looks like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[X.Y]\Languages\Language Services\
  [Language Name]\
    ShowSmartIndent = reg_dword: 0x00000001

[ProvideLanguageService(typeof(MyLanguageService),           // Required
                        MyConstants.languageName,            // Required
                        MyConstants.languageNameResourceID,  // Required
    // Optional language service properties
    ShowSmartIndent = true,  // enable indent options
                       )]
Return to top
Show: