In This Article

StructureMatcher Class

Represents a default implementation of an IStructureMatcher that is capable of matching common bracket delimiters.

public class StructureMatcher : IStructureMatcher
Inheritance:
object object
Implements:
IStructureMatcher

Remarks

Instances of object can be registered with an ISyntaxLanguage using the RegisterService(object, object) method. Once an instance is registered with the language for the IStructureMatcher interface type, its features can be used by the language.

Constructors

StructureMatcher()

Initializes an instance of the class.

public StructureMatcher()

Properties

CanMatchAngleBraces

Indicates whether angle braces can be matched.

public bool CanMatchAngleBraces { get; set; }

Property Value

bool:

true if angle braces can be matched; otherwise, false. The default value is false.

CanMatchCurlyBraces

Indicates whether curly braces can be matched.

public bool CanMatchCurlyBraces { get; set; }

Property Value

bool:

true if curly braces can be matched; otherwise, false. The default value is true.

CanMatchParentheses

Indicates whether parentheses can be matched.

public bool CanMatchParentheses { get; set; }

Property Value

bool:

true if parentheses can be matched; otherwise, false. The default value is true.

CanMatchSquareBraces

Indicates whether square braces can be matched.

public bool CanMatchSquareBraces { get; set; }

Property Value

bool:

true if square braces can be matched; otherwise, false. The default value is true.

CloseAngleBraceTokenId

The optional token ID value used to ensure that a close angle brace character is valid for structure matching.

public int? CloseAngleBraceTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for angle braces.

CloseCurlyBraceTokenId

The optional token ID value used to ensure that a close curly brace character is valid for structure matching.

public int? CloseCurlyBraceTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for curly braces.

CloseParenthesisTokenId

The optional token ID value used to ensure that a close parenthesis character is valid for structure matching.

public int? CloseParenthesisTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for parentheses.

CloseSquareBraceTokenId

The optional token ID value used to ensure that a close square brace character is valid for structure matching.

public int? CloseSquareBraceTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for square braces.

OpenAngleBraceTokenId

The optional tokenID value used to ensure that an open angle brace character is valid for structure matching.

public int? OpenAngleBraceTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for angle braces.

OpenCurlyBraceTokenId

The optional tokenID value used to ensure that an open curly brace character is valid for structure matching.

public int? OpenCurlyBraceTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for curly braces.

OpenParenthesisTokenId

The optional tokenID value used to ensure that an open parenthesis character is valid for structure matching.

public int? OpenParenthesisTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for parentheses.

OpenSquareBraceTokenId

The optional tokenID value used to ensure that an open square brace character is valid for structure matching.

public int? OpenSquareBraceTokenId { get; set; }

Property Value

int?

Remarks

Leave the value null if token validation is not required for square braces.

Methods

Match(TextSnapshotOffset, IStructureMatchOptions?)

Attempts to locate structural text, such as bracket pairs, at the specified offset.

public virtual IStructureMatchResultSet? Match(TextSnapshotOffset snapshotOffset, IStructureMatchOptions? options)
Parameter Type Description
snapshotOffset TextSnapshotOffset

The TextSnapshotOffset to examine.

options IStructureMatchOptions

The IStructureMatchOptions to use.

Returns

IStructureMatchResultSet:

An IStructureMatchResultSet that contains the results that were found, if any.

Remarks

When the result set is empty, no structural delimiter was next to the specified offset. When the result set contains a single result, a structural delimiter such as a bracket was found next to the specified offset, but no matching structural delimiter was found. The result set may contain multiple entries in cases such as when a language wishes to flag #if...#else...#endif blocks as a structure.

Inherited Members

Extension Methods