WORDEXTFLAGS Enumeration

Specifies options for determining the extent of a word.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

声明
<FlagsAttribute> _
Public Enumeration WORDEXTFLAGS
[FlagsAttribute]
public enum WORDEXTFLAGS
[FlagsAttribute]
public enum class WORDEXTFLAGS
[<FlagsAttribute>]
type WORDEXTFLAGS
public enum WORDEXTFLAGS

Members

Member name Description
WORDEXT_MOVETYPE_MASK Flag to mask WORDEXT_PREVIOUS and WORDEXT_NEXT.
WORDEXT_CURRENT Finds a word or token containing a specified position, if any such word or token exists.
WORDEXT_PREVIOUS Finds the nearest word or token whose last character is less than a specified position.
WORDEXT_NEXT Finds the nearest word or token whose first character is greater than a specified position.
WORDEXT_NEAREST Finds the word or token nearest to a specified position.
WORDEXT_FINDWORD Finds words only. See Remarks.
WORDEXT_FINDTOKEN Finds words and tokens. See Remarks.
WORDEXT_FINDEXPRESSION Find simple expressions, like *pFoo.

Remarks

For the WORDEXT_FINDWORD value, "FINDWORD" refers any of the following:

  • keyword

  • identifier

  • number

For the WORDEXT_FINDTOKEN value, "FINDTOKEN" refers to any of the following:

  • keyword, identifier, or number

  • operator (for example, ++ or %)

  • delimiter (for example, quotation marks (") or comment marks (// or /))

  • white space

Thus, by specifying a value of WORDEXT_FINDWORD, you return a word extent that corresponds to a keyword, a number, or an identifier. For example, if the text were "a[1]," the "a" or the "1" could be returned, but the whole expression would not be returned. However, if you specify a value of WORDEXT_FINDTOKEN, then you would return any keyword, number, or identifier, or you would return operators, delimiters, or white space. Thus, if the text were "a[1] ", any single character of the string could match, but any larger portion of the string would not.

备注

The term "token" is not related to a language token in compiler terminology.

COM Signature

From textmgr.idl:

typedef enum _wordextflags
{
   WORDEXT_MOVETYPE_MASK  = 0x0003,
   WORDEXT_CURRENT        = 0x0000,
   WORDEXT_PREVIOUS       = 0x0001,
   WORDEXT_NEXT           = 0x0002,
   WORDEXT_NEAREST        = 0x0003,
   WORDEXT_FINDWORD       = 0x0000,
   WORDEXT_FINDTOKEN      = 0x0004,
   WORDEXT_FINDEXPRESSION = 0x0008,
} WORDEXTFLAGS;

See Also

Reference

Microsoft.VisualStudio.TextManager.Interop Namespace