TokenTriggers Enumeration
Specifies a set of triggers that can be fired from an IScanner language parser.
This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'宣告
<FlagsAttribute> _
Public Enumeration TokenTriggers
[FlagsAttribute]
public enum TokenTriggers
Members
Member name | Description | |
---|---|---|
None | Used when no triggers are set. This is the default. | |
MemberSelect | A character that indicates that the start of a member selection has been parsed. In C#, this could be a period following a class name. In XML, this could be a < (the member select is a list of possible tags). | |
MatchBraces | The opening or closing part of a language pair has been parsed. For example, in C#, a { or } has been parsed. In XML, a < or > has been parsed. | |
MethodTip | This is a mask for the flags used to govern the IntelliSense Method Tip operation. This mask is used to isolate the values Parameter, ParameterStart, ParameterNext, and ParameterEnd. | |
ParameterStart | A character that marks the start of a parameter list has been parsed. For example, in C#, this could be an open parenthesis, "(". | |
ParameterNext | A character that separates parameters in a list has been parsed. For example, in C#, this could be a comma, ",". | |
ParameterEnd | A character that marks the end of a parameter list has been parsed. For example, in C#, this could be a close parenthesis, ")". | |
Parameter | A parameter in a method's parameter list has been parsed. |
Remarks
Triggers provide a way for the language service's IScanner scanner to signal the caller about certain language elements that may be of interest to IntelliSense support. These triggers can be returned all the time; however, they are used only in certain parsing operation contexts (see the ParseReason enumeration for more information about the different types of parsing operations).
For example, the user types a closing brace and the scanner is called to examine the line the brace is on. The brace is parsed and the scanner sets the trigger for that token to MatchBraces. The caller sees this trigger and calls the ParseSource method parser with the parse reason HighlightBraces. This causes the parser to look for the matching opening brace and return the location of both braces. The editor can then highlight the two braces.