In This Article

IStructureMatcher Interface

Provides the base requirements for a class that can locate matching structural text ranges for an offset, such as finding matching brackets.

public interface IStructureMatcher

Remarks

This interface type can be registered with an ISyntaxLanguage using the RegisterService(Object, Object) method. Once an object that implements this interface is registered with the language for this interface type, its features can be used by the language.

Methods

Match(TextSnapshotOffset, IStructureMatchOptions)

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

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.