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 this 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 a new instance of the StructureMatcher
class.
public StructureMatcher()
Properties
CanMatchAngleBraces
Gets or sets 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 isfalse
.
CanMatchCurlyBraces
Gets or sets 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 istrue
.
CanMatchParentheses
Gets or sets whether parentheses can be matched.
public bool CanMatchParentheses { get; set; }
Property Value
- bool:
true
if parentheses can be matched; otherwise,false
. The default value istrue
.
CanMatchSquareBraces
Gets or sets 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 istrue
.
CloseAngleBraceTokenId
Gets 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?:
The optional token ID value used to ensure that a close angle brace character is valid for structure matching.
Remarks
Leave the value null
if token validation is not required for angle braces.
CloseCurlyBraceTokenId
Gets 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?:
The optional token ID value used to ensure that a close curly brace character is valid for structure matching.
Remarks
Leave the value null
if token validation is not required for curly braces.
CloseParenthesisTokenId
Gets 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?:
The optional token ID value used to ensure that a close parenthesis character is valid for structure matching.
Remarks
Leave the value null
if token validation is not required for parentheses.
CloseSquareBraceTokenId
Gets 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?:
The optional token ID value used to ensure that a close square brace character is valid for structure matching.
Remarks
Leave the value null
if token validation is not required for square braces.
OpenAngleBraceTokenId
Gets the optional token ID value used to ensure that an open angle brace character is valid for structure matching.
public int? OpenAngleBraceTokenId { get; set; }
Property Value
- int?:
The optional token ID value used to ensure that an open angle brace character is valid for structure matching.
Remarks
Leave the value null
if token validation is not required for angle braces.
OpenCurlyBraceTokenId
Gets the optional token ID value used to ensure that an open curly brace character is valid for structure matching.
public int? OpenCurlyBraceTokenId { get; set; }
Property Value
- int?:
The optional token ID value used to ensure that an open curly brace character is valid for structure matching.
Remarks
Leave the value null
if token validation is not required for curly braces.
OpenParenthesisTokenId
Gets the optional token ID value used to ensure that an open parenthesis character is valid for structure matching.
public int? OpenParenthesisTokenId { get; set; }
Property Value
- int?:
The optional token ID value used to ensure that an open parenthesis character is valid for structure matching.
Remarks
Leave the value null
if token validation is not required for parentheses.
OpenSquareBraceTokenId
Gets the optional token ID value used to ensure that an open square brace character is valid for structure matching.
public int? OpenSquareBraceTokenId { get; set; }
Property Value
- int?:
The optional token ID value used to ensure that an open square brace character is valid for structure matching.
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.