Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
293,000
void (@NotNull String criteria, @NotNull MatchOptions options) { final StringBuilder pattern = new StringBuilder(); int anonymousTypedVarsCount = 0; boolean targetFound = false; final MatchVariableConstraint context = options.addNewVariableConstraint(Configuration.CONTEXT_VAR_NAME); final int length = criteria.length()...
transformCriteria
293,001
int (@NotNull String criteria, int index, @NotNull StringBuilder pattern) { final int length = criteria.length(); if (index + 1 < length && criteria.charAt(index + 1) == '\'') { // ignore next ' pattern.append('\''); return index + 1; } else if (index + 2 < length && criteria.charAt(index + 2) == '\'') { // eat simple ...
handleCharacterLiteral
293,002
int (int index, @NotNull String criteria, @NotNull MatchVariableConstraint constraint) { final int length = criteria.length(); char ch = criteria.charAt(index); if (ch == '!') { constraint.setInvertRegExp(true); ++index; if (index >= length) throw new MalformedPatternException(SSRBundle.message("error.expected.conditio...
handleTypedVarCondition
293,003
int (int index, @NotNull String criteria, @NotNull MatchVariableConstraint constraint) { final int length = criteria.length(); int endIndex = index; while (endIndex < length && !Character.isWhitespace(criteria.charAt(endIndex))) { ++endIndex; } if (endIndex == index) { if (criteria.charAt(index - 1) == ':') { throw new...
handleRegExp
293,004
void (@NotNull MatchVariableConstraint constraint, @NotNull String condition) { final int length = condition.length(); final StringBuilder text = new StringBuilder(); boolean invert = false; boolean optionExpected = true; for (int i = 0; i < length; i++) { char c = condition.charAt(i); if (Character.isWhitespace(c)) { ...
parseCondition
293,005
void (@NotNull MatchVariableConstraint constraint, @NotNull String option, @NotNull String argument, boolean invert) { argument = argument.trim(); if (option.equals(REF)) { constraint.setReferenceConstraint(argument); constraint.setInvertReference(invert); } else if (option.equals(REGEX) || option.equals(REGEXW)) { if ...
handleOption
293,006
void (@NotNull String regex) { try { Pattern.compile(regex); } catch (PatternSyntaxException e) { throw new MalformedPatternException(SSRBundle.message("invalid.regular.expression", e.getMessage())); } }
checkRegex
293,007
String (@NotNull String s) { final StringBuilder result = new StringBuilder(); boolean escaped = false; for (int i = 0, length = s.length(); i < length; i++) { final int c = s.codePointAt(i); if (c == '\\' && !escaped) { escaped = true; } else { escaped = false; result.appendCodePoint(c); } } return result.toString(); ...
unescape
293,008
boolean () { return true; }
doOptimizing
293,009
void (@NotNull String word, @NotNull String prefix) { myWords.add(prefix + word); myTransactionStarted = true; }
append
293,010
void (@NotNull String word) { append(word, "in code:"); }
doAddSearchWordInCode
293,011
void (@NotNull String word) { append(word, "in text:"); }
doAddSearchWordInText
293,012
void (@NotNull String word) { append(word, "in comments:"); }
doAddSearchWordInComments
293,013
void (@NotNull String word) { append(word, "in literals:"); }
doAddSearchWordInLiterals
293,014
void () { if (!myTransactionStarted) return; myTransactionStarted = false; super.endTransaction(); Collections.sort(myWords); // to ensure stable ordering builder.append('['); boolean bar = false; for (String word : myWords) { if (bar) builder.append('|'); else bar = true; builder.append(word); } this.builder.append(']...
endTransaction
293,015
boolean () { return false; }
isScannedSomething
293,016
Set<VirtualFile> () { assert !myTransactionStarted; return Collections.emptySet(); }
getFilesSetToScan
293,017
String () { assert !myTransactionStarted; final String plan = builder.toString(); builder.setLength(0); return plan; }
getSearchPlan
293,018
void () { mySearchHelper.clear(); }
clear
293,019
OptimizingSearchHelper () { return mySearchHelper; }
getSearchHelper
293,020
CompiledPattern () { return myPattern; }
getPattern
293,021
MatchOptions () { return myOptions; }
getOptions
293,022
Project () { return myProject; }
getProject
293,023
void () { scanned.clear(); scannedText.clear(); scannedComments.clear(); scannedLiterals.clear(); }
clear
293,024
void (@NotNull String word) { if (doOptimizing() && scanned.add(word)) { doAddSearchWordInCode(word); } }
addWordToSearchInCode
293,025
void (@NotNull String word) { if (doOptimizing() && scannedText.add(word)) { doAddSearchWordInText(word); } }
addWordToSearchInText
293,026
void (@NotNull String word) { if (doOptimizing() && scannedComments.add(word)) { doAddSearchWordInComments(word); } }
addWordToSearchInComments
293,027
void (@NotNull String word) { if (doOptimizing() && scannedLiterals.add(word)) { doAddSearchWordInLiterals(word); } }
addWordToSearchInLiterals
293,028
void () { scanRequest++; }
endTransaction
293,029
boolean () { return !scanned.isEmpty() || !scannedText.isEmpty() || !scannedComments.isEmpty() || !scannedLiterals.isEmpty(); }
isScannedSomething
293,030
void (@NotNull PsiElement element) { collectNode(element, element.getUserData(CompiledPattern.HANDLER_KEY)); super.visitElement(element); if (element instanceof LeafElement) { collectNode(element, pattern.getHandler(pattern.getTypedVarString(element))); } }
visitElement
293,031
void (PsiElement element, MatchingHandler handler) { if (handler instanceof DelegatingHandler) { handler = ((DelegatingHandler)handler).getDelegate(); } if (handler instanceof SubstitutionHandler){ pattern.putVariableNode(((SubstitutionHandler)handler).getName(), element); } }
collectNode
293,032
void (CompiledPattern pattern, PsiElement element) { element.accept(new PsiRecursiveElementWalkingVisitor() { @Override public void visitElement(@NotNull PsiElement element) { if (element.getUserData(CompiledPattern.HANDLER_KEY) != null) { return; } super.visitElement(element); if (!(element instanceof LeafElement)) { ...
checkForUnknownVariables
293,033
void (@NotNull PsiElement element) { if (element.getUserData(CompiledPattern.HANDLER_KEY) != null) { return; } super.visitElement(element); if (!(element instanceof LeafElement)) { return; } final String text = element.getText(); if (!pattern.isTypedVar(text)) { for (String prefix : pattern.getTypedVarPrefixes()) { if ...
visitElement
293,034
String () { return ourLastSearchPlan; }
getLastSearchPlan
293,035
void (@NotNull PsiElement element) { super.visitElement(element); if (element instanceof LeafElement) { final String text = element.getText(); for (Pattern pattern : substitutionPatterns) { final Matcher matcher = pattern.matcher(text); while (matcher.find()) { result.add(element.getTextRange().getStartOffset() + match...
visitElement
293,036
Boolean (PsiElement element, final int offset, final int patternEndOffset, final int[] varEndOffsets, final boolean strict) { final IntList errorOffsets = new IntArrayList(); final boolean[] containsErrorTail = {false}; final IntSet varEndOffsetsSet = new IntOpenHashSet(varEndOffsets); element.accept(new PsiRecursiveEl...
checkErrorElements
293,037
void (@NotNull PsiErrorElement element) { super.visitErrorElement(element); final int startOffset = element.getTextRange().getStartOffset(); if ((strict || !varEndOffsetsSet.contains(startOffset)) && startOffset != patternEndOffset) { errorOffsets.add(startOffset); } if (startOffset == offset) { containsErrorTail[0] = ...
visitErrorElement
293,038
String (int varIndex) { return myPrefix; }
getPrefix
293,039
String (int varIndex) { if (varIndex >= myPrefixes.length) return null; return myPrefixes[varIndex]; }
getPrefix
293,040
void (@NotNull MatchOptions options, @NotNull MatchVariableConstraint constraint, @NotNull SubstitutionHandler handler) { final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByFileType(options.getFileType()); assert profile != null; for (MatchPredicate matchPredicate : profile.getCustomPredicates(con...
addExtensionPredicates
293,041
void (SubstitutionHandler handler, @NotNull MatchPredicate predicate) { handler.setPredicate(handler.getPredicate() == null ? predicate : new AndPredicate(handler.getPredicate(), predicate)); }
addPredicate
293,042
boolean (final PsiElement start) { // XmlElements can also appear under languages which are not a kind of XMLLanguage e.g. TypeScript JSX // assume here that when the user specifies to search for generic XML, these elements should also be found if (myLanguage != XMLLanguage.INSTANCE && !start.getLanguage().isKindOf(myL...
continueMatching
293,043
boolean (PsiElement element, PsiElement elementToMatchWith) { return false; }
shouldSkip
293,044
NodeIterator (@Nullable PsiElement element) { return (element == null) ? SingleNodeIterator.EMPTY : new SsrFilteringNodeIterator(element); }
create
293,045
NodeIterator (PsiElement @NotNull [] elements) { return new SsrFilteringNodeIterator(new ArrayBackedNodeIterator(elements)); }
create
293,046
boolean () { return index < myList.size(); }
hasNext
293,047
PsiElement () { if (index >= myList.size()) return null; return myList.get(index); }
current
293,048
void () { index++; }
advance
293,049
void () { index--; }
rewind
293,050
void () { index = 0; }
reset
293,051
boolean (@NotNull PsiElement patternNode, @Nullable PsiElement matchNode) { if (patternNode instanceof LeafElement && matchNode instanceof LeafElement) { return ((LeafElement)patternNode).getElementType() == ((LeafElement)matchNode).getElementType(); } return matchNode != null && patternNode.getClass() == matchNode.get...
accepts
293,052
NodeFilter () { return NodeFilterHolder.INSTANCE; }
getInstance
293,053
boolean (PsiElement element) { if (element == null) return false; final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByPsiElement(element); return profile != null && !profile.isMatchNode(element); }
accepts
293,054
boolean (PsiElement element) { return first.accepts(element) || second.accepts(element); }
accepts
293,055
boolean (PsiElement element) { return element instanceof XmlTagChild || XmlUtil.isXmlToken(element, XmlTokenType.XML_DATA_CHARACTERS); }
accepts
293,056
NodeFilter () { return INSTANCE; }
getInstance
293,057
void (@Nullable NodeFilter filter) { this.filter = filter; }
setFilter
293,058
boolean (PsiElement patternNode, PsiElement matchedNode, @NotNull MatchContext context) { return (patternNode == null) ? matchedNode == null : canMatch(patternNode, matchedNode, context); }
match
293,059
boolean (@NotNull PsiElement patternNode, final PsiElement matchedNode, @NotNull MatchContext context) { return (filter != null) ? filter.accepts(matchedNode) : DefaultFilter.accepts(patternNode, matchedNode); }
canMatch
293,060
boolean (@NotNull NodeIterator patternNodes, @NotNull NodeIterator matchNodes, @NotNull MatchContext context) { final MatchingStrategy strategy = context.getPattern().getStrategy(); final PsiElement currentPatternNode = patternNodes.current(); final PsiElement currentMatchNode = matchNodes.current(); skipIfNecessary(ma...
matchSequentially
293,061
void (@NotNull NodeIterator matchNodes, PsiElement patternNode) { if (patternNode instanceof PsiComment) return; while (matchNodes.current() instanceof PsiComment) matchNodes.advance(); }
skipComments
293,062
void (@NotNull NodeIterator nodes, PsiElement elementToMatchWith, @NotNull MatchingStrategy strategy) { while (nodes.hasNext() && strategy.shouldSkip(nodes.current(), elementToMatchWith)) { nodes.advance(); } }
skipIfNecessary
293,063
boolean (@NotNull NodeIterator matchNodes) { skipComments(matchNodes, null); return !matchNodes.hasNext(); }
isMatchSequentiallySucceeded
293,064
void (@NotNull PsiElement element) { // We do not reset certain handlers because they are also bound to higher level nodes // e.g. Identifier handler in name is also bound to PsiMethod if (pattern.isToResetHandler(element)) { final MatchingHandler handler = pattern.getHandlerSimple(element); if (handler != null) { hand...
visitElement
293,065
boolean (@NotNull NodeIterator patternNodes, @NotNull NodeIterator matchedNodes, @NotNull MatchContext context) { if (patternNodes.hasNext() && !matchedNodes.hasNext()) { return validateSatisfactionOfHandlers(patternNodes, context); } Set<PsiElement> matchedElements = null; while (patternNodes.hasNext()) { final PsiEle...
matchInAnyOrder
293,066
boolean (@NotNull NodeIterator patternNodes, @NotNull MatchContext context) { for (; patternNodes.hasNext(); patternNodes.advance()) { if (!context.getPattern().getHandler(patternNodes.current()).validate(context, 0)) { return false; } } return true; }
validateSatisfactionOfHandlers
293,067
boolean (@NotNull MatchContext context, int matchedOccurs) { return matchedOccurs == 1; }
validate
293,068
NodeFilter () { return filter; }
getFilter
293,069
boolean (@NotNull PsiElement patternElement, @NotNull PsiElement matchedElement) { return true; }
shouldAdvanceThePatternFor
293,070
boolean (PsiElement patternElement, PsiElement matchedElement) { return true; }
shouldAdvanceTheMatchFor
293,071
void () { //pinnedElement = null; }
reset
293,072
PsiElement () { return pinnedElement; }
getPinnedNode
293,073
void (@NotNull PsiElement pinnedElement) { this.pinnedElement = pinnedElement; }
setPinnedElement
293,074
boolean (final PsiElement patternNode, final PsiElement matchedNode, final @NotNull MatchContext matchContext) { return myDelegate.match(patternNode, matchedNode, matchContext); }
match
293,075
boolean (@NotNull PsiElement patternNode, PsiElement matchedNode, @NotNull MatchContext context) { return myDelegate.canMatch(patternNode, matchedNode, context); }
canMatch
293,076
boolean (final @NotNull NodeIterator patternNodes, final @NotNull NodeIterator matchNodes, final @NotNull MatchContext context) { return myDelegate.matchSequentially(patternNodes, matchNodes, context); }
matchSequentially
293,077
boolean (final @NotNull NodeIterator matchNodes) { return true; }
isMatchSequentiallySucceeded
293,078
boolean (final PsiElement patternElement, final PsiElement matchedElement) { return myDelegate.shouldAdvanceTheMatchFor(patternElement, matchedElement); }
shouldAdvanceTheMatchFor
293,079
MatchingHandler () { return myDelegate; }
getDelegate
293,080
boolean (PsiElement patternNode, PsiElement matchedNode, @NotNull MatchContext context) { if (!super.match(patternNode,matchedNode,context)) { return false; } return context.getMatcher().match( patternNode.getFirstChild(), matchedNode ); }
match
293,081
boolean (PsiElement patternNode, PsiElement matchedNode, @NotNull MatchContext matchContext) { final boolean matched = delegate.match(patternNode, matchedNode, matchContext); if (matched) { matchContext.addMatchedNode(matchedNode); } if ((!matched || matchContext.getOptions().isRecursiveSearch()) && matchContext.getPat...
match
293,082
boolean (@NotNull PsiElement patternNode, PsiElement matchedNode, @NotNull MatchContext context) { return delegate.canMatch(patternNode, matchedNode, context); }
canMatch
293,083
boolean (@NotNull NodeIterator patternNodes, @NotNull NodeIterator matchNodes, @NotNull MatchContext context) { return delegate.matchSequentially(patternNodes, matchNodes, context); }
matchSequentially
293,084
boolean (@NotNull NodeIterator matchNodes) { return true; }
isMatchSequentiallySucceeded
293,085
boolean (PsiElement patternElement, PsiElement matchedElement) { return delegate.shouldAdvanceTheMatchFor(patternElement, matchedElement); }
shouldAdvanceTheMatchFor
293,086
MatchingHandler () { return delegate; }
getDelegate
293,087
boolean () { return subtype; }
isSubtype
293,088
boolean () { return strictSubtype; }
isStrictSubtype
293,089
void (boolean strictSubtype) { this.strictSubtype = strictSubtype; }
setStrictSubtype
293,090
void (boolean subtype) { this.subtype = subtype; }
setSubtype
293,091
void (boolean repeatedVar) { myRepeatedVar = repeatedVar; }
setRepeatedVar
293,092
void (@NotNull MatchPredicate handler) { predicate = handler; }
setPredicate
293,093
MatchPredicate () { return predicate; }
getPredicate
293,094
boolean (@NotNull PsiElement match, int start, int end, @NotNull MatchResult result, @NotNull MatchContext matchContext) { if (!myRepeatedVar) { return true; } if (start == 0 && end == -1 && result.getStart() == 0 && result.getEnd() == -1) { return matchContext.getMatcher().match(match, result.getMatch()); } else { fin...
validateOneMatch
293,095
boolean (PsiElement match, @NotNull MatchContext context) { return validate(match, 0, -1, context); }
validate
293,096
boolean (PsiElement match, int start, int end, @NotNull MatchContext context) { if (match == null || predicate != null && !predicate.match(match, start, end, context)) { return false; } MatchResult result = context.hasResult() ? context.getResult().findChild(name) : null; if (result == null && myNestedResult != null) {...
validate
293,097
boolean (PsiElement node, PsiElement match, @NotNull MatchContext context) { if (!super.match(node, match, context)) return false; return matchHandler == null ? context.getMatcher().match(node, match): matchHandler.match(node, match, context); }
match
293,098
void (@NotNull PsiElement match, @NotNull MatchContext context) { addResult(match, 0, -1, context); }
addResult
293,099
void (@NotNull PsiElement match, int start, int end, @NotNull MatchContext context) { if (totalMatchedOccurs == -1) { final MatchResultImpl matchResult = context.getResult(); final MatchResultImpl substitution = matchResult.getChild(name); if (substitution == null) { matchResult.addChild(createMatch(match, start, end) ...
addResult