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()
PairedBraceMatcher
getPairs
in interface PairedBraceMatcher
public boolean isPairedBracesAllowedBeforeType(IElementType lbraceType, IElementType contextType)
PairedBraceMatcher
true
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 PairedBraceMatcher
lbraceType
- lbrace for which information is queriedcontextType
- token type that follows lbracepublic int getCodeConstructStart(PsiFile file, int openingBraceOffset)
PairedBraceMatcher
getCodeConstructStart
in interface PairedBraceMatcher
file
- the file in which brace matching is performed.openingBraceOffset
- the offset of an opening structural brace.