LanguagePreferences Class

Provides support for language service-specific preferences.

This API is not CLS-compliant. The CLS-compliant alternative is [None].

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

声明
<GuidAttribute("934a92fd-b63a-49c7-9284-11aec8c1e03f")> _
<ComVisibleAttribute(True)> _
<CLSCompliantAttribute(False)> _
Public Class LanguagePreferences _
    Implements IVsTextManagerEvents2, IDisposable
用法
Dim instance As LanguagePreferences
[GuidAttribute("934a92fd-b63a-49c7-9284-11aec8c1e03f")]
[ComVisibleAttribute(true)]
[CLSCompliantAttribute(false)]
public class LanguagePreferences : IVsTextManagerEvents2, 
    IDisposable
[GuidAttribute(L"934a92fd-b63a-49c7-9284-11aec8c1e03f")]
[ComVisibleAttribute(true)]
[CLSCompliantAttribute(false)]
public ref class LanguagePreferences : IVsTextManagerEvents2, 
    IDisposable
[<GuidAttribute("934a92fd-b63a-49c7-9284-11aec8c1e03f")>]
[<ComVisibleAttribute(true)>]
[<CLSCompliantAttribute(false)>]
type LanguagePreferences =  
    class
        interface IVsTextManagerEvents2
        interface IDisposable
    end
public class LanguagePreferences implements IVsTextManagerEvents2, IDisposable

Remarks

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.

Inheritance Hierarchy

System.Object
  Microsoft.VisualStudio.Package.LanguagePreferences

Thread Safety

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

See Also

Reference

LanguagePreferences Members

Microsoft.VisualStudio.Package Namespace