public class JavaBraceMatcher extends java.lang.Object implements PairedBraceMatcher
| Constructor and Description |
|---|
JavaBraceMatcher() |
| Modifier and Type | Method and Description |
|---|---|
int |
getCodeConstructStart(PsiFile file,
int openingBraceOffset)
Returns the start offset of the code construct which owns the opening structural brace at the specified offset.
|
BracePair [] |
getPairs()
Returns the array of definitions for brace pairs that need to be matched when
editing code in the language.
|
boolean |
isPairedBracesAllowedBeforeType(IElementType lbraceType,
IElementType contextType)
Returns
true if paired rbrace should be inserted after lbrace of given type when lbrace is encountered before contextType token. |
public BracePair [] getPairs()
PairedBraceMatchergetPairs in interface PairedBraceMatcherpublic boolean isPairedBracesAllowedBeforeType(IElementType lbraceType, IElementType contextType)
PairedBraceMatchertrue if paired rbrace should be inserted after lbrace of given type when lbrace is encountered before contextType token.
It is safe to always return true, then paired brace will be inserted anyway.isPairedBracesAllowedBeforeType in interface PairedBraceMatcherlbraceType - lbrace for which information is queriedcontextType - token type that follows lbracepublic int getCodeConstructStart(PsiFile file, int openingBraceOffset)
PairedBraceMatchergetCodeConstructStart in interface PairedBraceMatcherfile - the file in which brace matching is performed.openingBraceOffset - the offset of an opening structural brace.