LanguagePreferences Class

LanguagePreferences Class

 
clsCompliantAlternativeNone

Provides support for language service-specific preferences.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

System.Object
  Microsoft.VisualStudio.Package.LanguagePreferences

[CLSCompliantAttribute(false)]
[ComVisibleAttribute(true)]
[GuidAttribute("934a92fd-b63a-49c7-9284-11aec8c1e03f")]
public class LanguagePreferences : IVsTextManagerEvents2, IDisposable

NameDescription
System_CAPS_pubmethodLanguagePreferences()

Initializes a new instance of the LanguagePreferences class (default initialization only).

System_CAPS_pubmethodLanguagePreferences(IServiceProvider, Guid, String)

Initializes a new instance of the LanguagePreferences class (this is the preferred method).

NameDescription
System_CAPS_pubpropertyAutoListMembers

Gets or sets whether members are automatically listed as part of IntelliSense support.

System_CAPS_pubpropertyAutoOutlining

Gets or sets whether or not auto-outlining is supported outlining (this requires parser support for hidden regions).

System_CAPS_pubpropertyCodeSenseDelay

Gets or sets the number of milliseconds the user must hold the cursor over an identifier before initiating any IntelliSense operation.

System_CAPS_pubpropertyCutCopyBlankLines

Gets or sets whether to include spaces on blank lines when cutting and copying.

System_CAPS_pubpropertyEnableAsyncCompletion

Gets or sets if background parsing is supported.

System_CAPS_pubpropertyEnableCodeSense

Gets or sets whether or not IntelliSense is supported.

System_CAPS_pubpropertyEnableCommenting

Gets or sets whether or not blocks of code can be commented and uncommented.

System_CAPS_pubpropertyEnableFormatSelection

Gets or sets whether or not code can be formatted.

System_CAPS_pubpropertyEnableLeftClickForURLs

Gets or sets whether or not URLs in the code can be navigated to by a simple click.

System_CAPS_pubpropertyEnableMatchBraces

Gets or sets whether or not matching braces are supported.

System_CAPS_pubpropertyEnableMatchBracesAtCaret

Gets or sets whether or not matching braces can be shown while typing a matching brace.

System_CAPS_pubpropertyEnableQuickInfo

Gets or sets whether or not the IntelliSense Quick Info operation is supported.

System_CAPS_pubpropertyEnableShowMatchingBrace

Gets or sets whether or not the text included in the span of the matching pair is shown in the status bar.

System_CAPS_pubpropertyHideAdvancedMembers

Gets or sets whether or not advanced members are hidden in the IntelliSense members list.

System_CAPS_pubpropertyHighlightMatchingBraceFlags

Gets or sets the flags for highlighting matching braces.

System_CAPS_pubpropertyIndentSize

Gets or sets the number of spaces to indent when formatting source.

System_CAPS_pubpropertyIndentStyle

Gets or sets the style used for formatting sections of text.

System_CAPS_pubpropertyInsertTabs

Gets or sets whether or not to insert tabs instead of spaces when formatting sections of text.

System_CAPS_protpropertyLanguageName

Gets or sets the name the language service is registered under.

System_CAPS_pubpropertyLineNumbers

Gets or sets whether or not line numbers are to be shown.

System_CAPS_pubpropertyMaxErrorMessages

Gets or sets the maximum number of error messages that can be shown at any one time.

System_CAPS_pubpropertyMaxRegionTime

Gets or sets the maximum region time.

System_CAPS_pubpropertyParameterInformation

Gets or sets whether or not the IntelliSense method tip operation is supported.

System_CAPS_pubpropertyShowNavigationBar

Gets or sets whether or not drop-down bars are to be shown.

System_CAPS_protpropertySite

Gets or sets the service provider.

System_CAPS_pubpropertyTabSize

Gets or sets the number of spaces a single tab covers.

System_CAPS_pubpropertyVirtualSpace

Gets or sets whether or not the editor should assume spaces at the end of all lines.

System_CAPS_pubpropertyWordWrap

Gets or sets whether or not word wrapping is enabled.

System_CAPS_pubpropertyWordWrapGlyphs

Gets or sets whether or not a glyph should be shown for a line that is word-wrapped.

NameDescription
System_CAPS_pubmethodApply()

Applies all changes made to the preferences.

System_CAPS_pubmethodDispose()

Cleans up any allocated resources before the object is destroyed.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetBooleanValue(RegistryKey, String, Boolean)

Obtains a boolean value from the specified registry entry.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetIntegerValue(RegistryKey, String, Int32)

Gets an integer value from the specified registry entry.

System_CAPS_pubmethodGetLanguagePreferences()

Gets the modifiable user language settings from Visual Studio.

System_CAPS_pubmethodGetSite()

Gets the service provider.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInit()

Initializes LanguagePreferences.

System_CAPS_pubmethodInitMachinePreferences(RegistryKey, String)

Gets language service-specific settings from the registry.

System_CAPS_pubmethodInitUserPreferences(RegistryKey, String)

Gets user-modifiable settings.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodOnRegisterMarkerType(Int32)

Called when a new marker type is registered with Visual Studio.

System_CAPS_pubmethodOnRegisterView(IVsTextView)

Called when a view is registered.

System_CAPS_pubmethodOnReplaceAllInFilesBegin()

Called when the Replace All in Files operation has begun.

System_CAPS_pubmethodOnReplaceAllInFilesEnd()

Called when the Replace All In Files operation has ended.

System_CAPS_pubmethodOnUnregisterView(IVsTextView)

Called when a view is closed.

System_CAPS_pubmethodOnUserPreferencesChanged2(VIEWPREFERENCES2[], FRAMEPREFERENCES2[], LANGPREFERENCES2[], FONTCOLORPREFERENCES2[])

Called when a user preference has been changed.

System_CAPS_pubmethodToString()

(Inherited from Object.)

The base class manages preferences specific to your language service as well as general preferences the user can affect from the Tools -> Options -> Text Editor category.

The following registry entries are specific to language services and are already reflected in properties in the base class. These registry entries are stored in the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\<X.Y>\Languages\Language Services\<Language Name>.

<X.Y> is the version of Visual Studio (for example, 8.0 or 8.0Exp).

<Language Name> is the name of your language.

Registry entry

Type

Value

Description

CodeSense

DWORD

<0 or 1>

1 indicates support for IntelliSense.

MatchBraces

DWORD

<0 or 1>

1 indicates support for matching braces.

QuickInfo

DWORD

<0 or 1>

1 indicates support for the Quick Info IntelliSense operation.

ShowMatchingBraces

DWORD

<0 or 1>

1 indicates that the text included in the span for a matching pair of language elements is shown in the status bar.

MatchBracesAtCaret

DWORD

<0 or 1>

1 indicates that matching braces can be shown while typing a matching brace.

MaxErrorMessages

DWORD

<number>

The maximum number of error messages that can be put into the Error List Options window from the parser.

CodeSenseDelay

DWORD

<number>

The amount of time in milliseconds the user must hold the cursor over an identifier before triggering an IntelliSense operation.

EnableAsyncCompletion

DWORD

<0 or 1>

1 indicates support for asynchronous or background parsing.

EnableCommenting

DWORD

<0 or 1>

1 indicates support for commenting and uncommenting code in a single operation.

EnableFormatSelection

DWORD

<0 or 1>

1 indicates support for formatting the source text.

AutoOutlining

DWORD

<0 or 1>

1 indicates support for automatic outlining (this requires parser support for hidden regions).

MaxRegions

DWORD

<number>

The maximum number of hidden regions that can be handled in a single file.

Notes to Implementers:

If you have any language-specific properties in addition to those already supported by the base class, you have to derive a class from LanguagePreferences and return an instance of your class from the GetLanguagePreferences method. Be sure to call the Initialize method before returning your language preferences instance. In addition, you must override InitUserPreferences, OnUserPreferencesChanged2, and Apply methods to support accessing your specified properties.

It is assumed that a single instance of the LanguagePreferences object is maintained for your language service. In this way, any changes the user makes to the properties are dynamically updated in your preferences and from there, throughout the language service.

Notes to Callers:

An instance of this class is returned from the LanguageService method GetLanguagePreferences. A number of properties are referenced throughout the managed package framework version of the language service classes.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft