ProvideLanguageServiceAttribute.EnableLineNumbers ProvideLanguageServiceAttribute.EnableLineNumbers ProvideLanguageServiceAttribute.EnableLineNumbers Property


Determines if the Line numbers option can be selected in the Options dialog box.

public bool EnableLineNumbers { get; set; }
member this.EnableLineNumbers : bool with get, set
Public Property EnableLineNumbers As Boolean
Property Value

Returns true if the Line numbers option is enabled for use; otherwise, returns false.


[ProvideLanguageService(typeof(MyLanguageService),           // Required  
                        MyConstants.languageName,            // Required  
                        MyConstants.languageNameResourceID,  // Required  
    // Optional language service properties  
    EnableLineNumbers = true,  // line numbers are supported  


Visual Studio can display line numbers for any source file, helping users find particular lines of source. This ability is controlled from the Options dialog box (available from the Tools -> Options menu) with the option Line numbers. If a language service cannot support line numbers for some reason, then the EnableLineNumbers property should be set to false, thereby disabling the Line numbers option.

This property is available to any language service implementation.

The default is true when the corresponding registry entry is accessed through the LanguagePreferences class.

The registry entry looks like this:

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

Applies to