public class BraceMatchingUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
BraceMatchingUtil.BraceHighlightingAndNavigationContext
Describes a brace matching/navigation context computed by
computeHighlightingAndNavigationContext(com.intellij.openapi.editor.Editor, com.intellij.psi.PsiFile) |
Modifier and Type | Field and Description |
---|---|
static int |
UNDEFINED_TOKEN_GROUP |
Modifier and Type | Method and Description |
---|---|
static BraceMatchingUtil.BraceHighlightingAndNavigationContext |
computeHighlightingAndNavigationContext(Editor editor,
PsiFile file) |
static BraceMatchingUtil.BraceHighlightingAndNavigationContext |
computeHighlightingAndNavigationContext(Editor editor,
PsiFile file,
int offset)
Computes context that should be used to highlight and navigate matching braces
|
static int |
findLeftLParen(HighlighterIterator iterator,
IElementType lparenTokenType,
java.lang.CharSequence fileText,
FileType fileType) |
static int |
findLeftmostLParen(HighlighterIterator iterator,
IElementType lparenTokenType,
java.lang.CharSequence fileText,
FileType fileType) |
static int |
findRightmostRParen(HighlighterIterator iterator,
IElementType rparenTokenType,
java.lang.CharSequence fileText,
FileType fileType) |
static boolean |
findStructuralLeftBrace(FileType fileType,
HighlighterIterator iterator,
java.lang.CharSequence fileText) |
static BraceMatcher |
getBraceMatcher(FileType fileType,
HighlighterIterator iterator) |
static BraceMatcher |
getBraceMatcher(FileType fileType,
IElementType type) |
static BraceMatcher |
getBraceMatcher(FileType fileType,
Language lang) |
static FileType |
getFileType(PsiFile file,
int offset) |
static int |
getMatchedBraceOffset(Editor editor,
boolean forward,
PsiFile file) |
static boolean |
isLBraceToken(HighlighterIterator iterator,
java.lang.CharSequence fileText,
FileType fileType) |
static boolean |
isPairBraces(IElementType tokenType1,
IElementType tokenType2,
FileType fileType) |
static boolean |
isPairedBracesAllowedBeforeTypeInFileType(IElementType lbraceType,
IElementType tokenType,
FileType fileType) |
static boolean |
isRBraceToken(HighlighterIterator iterator,
java.lang.CharSequence fileText,
FileType fileType) |
static boolean |
isStructuralBraceToken(FileType fileType,
HighlighterIterator iterator,
java.lang.CharSequence text) |
static boolean |
matchBrace(java.lang.CharSequence fileText,
FileType fileType,
HighlighterIterator iterator,
boolean forward) |
static boolean |
matchBrace(java.lang.CharSequence fileText,
FileType fileType,
HighlighterIterator iterator,
boolean forward,
boolean isStrict) |
public static final int UNDEFINED_TOKEN_GROUP
public static boolean isPairedBracesAllowedBeforeTypeInFileType(IElementType lbraceType, IElementType tokenType, FileType fileType)
public static int getMatchedBraceOffset(Editor editor, boolean forward, PsiFile file)
public static BraceMatchingUtil.BraceHighlightingAndNavigationContext computeHighlightingAndNavigationContext(Editor editor, PsiFile file)
public static BraceMatchingUtil.BraceHighlightingAndNavigationContext computeHighlightingAndNavigationContext(Editor editor, PsiFile file, int offset)
offset
- offset we are computing for. Some implementations may need to compute this not only for caret position, but for other offsets, e.g. skipping spaces behind or ahead.public static boolean matchBrace(java.lang.CharSequence fileText, FileType fileType, HighlighterIterator iterator, boolean forward)
public static boolean matchBrace(java.lang.CharSequence fileText, FileType fileType, HighlighterIterator iterator, boolean forward, boolean isStrict)
public static boolean findStructuralLeftBrace(FileType fileType, HighlighterIterator iterator, java.lang.CharSequence fileText)
public static boolean isStructuralBraceToken(FileType fileType, HighlighterIterator iterator, java.lang.CharSequence text)
public static boolean isLBraceToken(HighlighterIterator iterator, java.lang.CharSequence fileText, FileType fileType)
public static boolean isRBraceToken(HighlighterIterator iterator, java.lang.CharSequence fileText, FileType fileType)
public static boolean isPairBraces(IElementType tokenType1, IElementType tokenType2, FileType fileType)
public static int findLeftmostLParen(HighlighterIterator iterator, IElementType lparenTokenType, java.lang.CharSequence fileText, FileType fileType)
public static int findLeftLParen(HighlighterIterator iterator, IElementType lparenTokenType, java.lang.CharSequence fileText, FileType fileType)
public static int findRightmostRParen(HighlighterIterator iterator, IElementType rparenTokenType, java.lang.CharSequence fileText, FileType fileType)
public static BraceMatcher getBraceMatcher(FileType fileType, HighlighterIterator iterator)
public static BraceMatcher getBraceMatcher(FileType fileType, IElementType type)
public static BraceMatcher getBraceMatcher(FileType fileType, Language lang)