java.lang.Object
com.intellij.lang.BracePair
Defines a single pair of braces which need to be matched when editing code in a custom language.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBracePair(@NotNull IElementType leftBrace, @NotNull IElementType rightBrace, boolean structural) Creates a new brace pair instance. -
Method Summary
Modifier and TypeMethodDescription@NotNull IElementTypeReturns the lexer token type for the left brace in the pair.@NotNull IElementTypeReturns the lexer token type for the right brace in the pair.booleanReturns true if the brace is structural.@NonNls StringtoString()
-
Constructor Details
-
BracePair
public BracePair(@NotNull @NotNull IElementType leftBrace, @NotNull @NotNull IElementType rightBrace, boolean structural) Creates a new brace pair instance.- Parameters:
leftBrace- the lexer token type for the left brace in the pair.rightBrace- the lexer token type for the right brace in the pair.structural- if true, the brace is considered structural (seeisStructural()for details)
-
-
Method Details
-
getLeftBraceType
Returns the lexer token type for the left brace in the pair.- Returns:
- token type
-
getRightBraceType
Returns the lexer token type for the right brace in the pair.- Returns:
- token type
-
isStructural
public boolean isStructural()Returns true if the brace is structural. Structural braces have higher priority than regular braces: they are matched with each other even if there are unmatched braces of other types between them, and an opening non-structural brace is not matched with a closing one if one of them is outside a pair of matched structural braces and another is outside. In Java code, the curly braces are structural.- Returns:
- true if the brace is structural, false otherwise.
-
toString
-