Freigeben über


TokenTriggers Enum

Definition

TokenTriggers: If a character has (a) trigger(s) associated with it, it may fire one or both of the following triggers: MemberSelect - a member selection tip window MatchBraces - highlight matching braces or the following trigger: MethodTip - a method tip window

The following triggers exist for speed reasons: the (fast) lexer determines when a (slow) parse might be needed. The Trigger.MethodTip trigger is subdivided in 4 other triggers. It is the best to be as specific as possible; it is better to return Trigger.ParamStart than Trigger.Param (or Trigger.MethodTip)

This enumeration supports a bitwise combination of its member values.

public enum class TokenTriggers
public enum class TokenTriggers
enum TokenTriggers
[System.Flags]
public enum TokenTriggers
[<System.Flags>]
type TokenTriggers = 
Public Enum TokenTriggers
Inheritance
TokenTriggers
Attributes

Fields

Name Value Description
None 0

Used when no triggers are set. This is the default.

MemberSelect 1

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 2

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.

ParameterStart 16

A character that marks the start of a parameter list has been parsed. For example, in C#, this could be an open parenthesis, "(".

ParameterNext 32

A character that separates parameters in a list has been parsed. For example, in C#, this could be a comma, ",".

ParameterEnd 64

A character that marks the end of a parameter list has been parsed. For example, in C#, this could be a close parenthesis, ")".

Parameter 128

A parameter in a method's parameter list has been parsed.

MethodTip 240

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.

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.

Applies to