Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
292,200
PatternContext () { final Language dialect = getDialect(); return (dialect == null) ? null : StructuralSearchUtil.findPatternContextByID(myPatternContextId, dialect); }
getPatternContext
292,201
void (PatternContext patternContext) { myPatternContextId = (patternContext == null) ? null : patternContext.getId(); }
setPatternContext
292,202
boolean (PsiElement element) { return !(element instanceof PsiWhiteSpace) && !(element instanceof PsiErrorElement); }
isMatchNode
292,203
List<MatchPredicate> (@NotNull MatchVariableConstraint constraint, @NotNull String name, @NotNull MatchOptions options) { return Collections.emptyList(); }
getCustomPredicates
292,204
List<PatternContext> () { return Collections.emptyList(); }
getPatternContexts
292,205
String () { return PATTERN_PLACEHOLDER; }
getPlaceholderVarName
292,206
String (@NotNull String pattern, @Nullable Language language, @Nullable String contextId) { return getPlaceholderVarName(); }
getContext
292,207
String (@NotNull String contextConstraint, @NotNull Project project) { Configuration configuration = ConfigurationManager.getInstance(project).findConfigurationByName(contextConstraint); return configuration != null ? configuration.getMatchOptions().getSearchPattern() : getPlaceholderVarName(); }
getContextByConstraint
292,208
PsiCodeFragment (@NotNull Project project, @NotNull String text, @Nullable String contextId) { return null; }
createCodeFragment
292,209
String (@NotNull PsiFile fragment) { return fragment.getText(); }
getCodeFragmentText
292,210
LanguageFileType (@NotNull PsiElement context) { return null; }
detectFileType
292,211
StructuralReplaceHandler (@NotNull Project project, @NotNull ReplaceOptions replaceOptions) { return null; }
getReplaceHandler
292,212
boolean () { return false; }
supportsShortenFQNames
292,213
boolean () { return false; }
supportsUseStaticImports
292,214
void (@NotNull CompiledPattern pattern) {}
checkSearchPattern
292,215
void (@NotNull Project project, @NotNull ReplaceOptions options) { if (isReplaceSupported()) return; final LanguageFileType fileType = options.getMatchOptions().getFileType(); if (fileType == null) return; final String fileTypeName = StringUtil.toLowerCase(fileType.getName()); throw new UnsupportedPatternException(SSRB...
checkReplacementPattern
292,216
boolean () { if (myReplaceSupported != null) return myReplaceSupported; Class<?> declaringClass = ReflectionUtil.getMethodDeclaringClass(getClass(), "getReplaceHandler", Project.class, ReplaceOptions.class); return myReplaceSupported = !StructuralSearchProfile.class.equals(declaringClass); }
isReplaceSupported
292,217
boolean (@NotNull PsiErrorElement error) { return false; }
shouldShowProblem
292,218
boolean (@NotNull PsiElement element) { return false; }
canBeVarDelimiter
292,219
String (@NotNull PsiElement match, int start, int end) { final String matchText = match.getText(); if (start == 0 && end == -1) return matchText; return matchText.substring(start, end == -1 ? matchText.length() : end); }
getText
292,220
String (@NotNull PsiElement element) { if (element instanceof PsiNamedElement) { final String name = ((PsiNamedElement)element).getName(); if (name != null) { return name; } } return element.getText(); }
getTypedVarString
292,221
String (@NotNull PsiElement element) { return getTypedVarString(element); }
getMeaningfulText
292,222
String (@NotNull PsiElement element, @NotNull String previousText) { return null; }
getAlternativeText
292,223
PsiElement (@NotNull PsiElement node) { return node; }
updateCurrentNode
292,224
PsiElement (@NotNull PsiElement node) { return node; }
extendMatchedByDownUp
292,225
LanguageFileType (@Nullable LanguageFileType fileType) { return fileType; }
getDefaultFileType
292,226
void (@NotNull PsiElement node, @NotNull ReplaceOptions options, @NotNull ReplacementBuilder builder) {}
provideAdditionalReplaceOptions
292,227
void (@NotNull ParameterInfo info, @NotNull MatchResult match, @NotNull StringBuilder result, @NotNull ReplacementInfo replacementInfo) { if (info.getName().equals(match.getName())) { final String replacementString; boolean removeSemicolon = false; if (match.hasChildren() && !match.isScopeMatch()) { // compound matches...
handleSubstitution
292,228
void (@NotNull ParameterInfo info, @NotNull StringBuilder result) { if (info.isHasCommaBefore()) { result.delete(info.getBeforeDelimiterPos(), info.getBeforeDelimiterPos() + 1); } else if (info.isHasCommaAfter()) { result.delete(info.getAfterDelimiterPos(), info.getAfterDelimiterPos() + 1); } else if (info.getStartInde...
handleNoSubstitution
292,229
boolean (@Nullable PsiElement element) { return false; }
isIdentifier
292,230
Collection<String> () { return Collections.emptySet(); }
getReservedWords
292,231
boolean (@NotNull PsiElement match) { return false; }
isDocCommentOwner
292,232
PsiElement (@NotNull PsiElement element) { if (isIdentifier(element)) { final PsiElement parent = element.getParent(); if (parent != null) return parent; } return element; }
getPresentableElement
292,233
boolean (@NotNull String constraintName, @Nullable PsiElement variableNode, boolean completePattern, boolean target) { switch (constraintName) { case UIUtil.MINIMUM_ZERO: if (target) return false; case UIUtil.MAXIMUM_UNLIMITED: case UIUtil.TEXT: case UIUtil.REFERENCE: return !completePattern; } return false; }
isApplicableConstraint
292,234
boolean (@NotNull String constraintName, @NotNull List<? extends PsiElement> nodes, boolean completePattern, boolean target) { if (nodes.isEmpty()) { return isApplicableConstraint(constraintName, (PsiElement)null, completePattern, target); } boolean result = true; for (PsiElement node : nodes) { result &= isApplicableC...
isApplicableConstraint
292,235
boolean (@NotNull Configuration configuration) { return !configuration.isPredefined(); }
isApplicableContextConfiguration
292,236
Matcher (@NotNull Project project, @NotNull LanguageFileType fileType, @NotNull String constraint) { if (StringUtil.isQuotedString(constraint)) { // keep old configurations working, also useful for testing final MatchOptions matchOptions = new MatchOptions(); matchOptions.setFileType(fileType); matchOptions.fillSearchC...
buildMatcher
292,237
void (Project project, MatchOptions options) { PatternCompiler.compilePattern(project, options, true, true); }
validate
292,238
boolean (@NotNull NodeIterator matchedNodes) { final MatchContext matchContext = getMatchContext(); final CompiledPattern pattern = matchContext.getPattern(); final NodeIterator patternNodes = pattern.getNodes(); try { while (true) { final PsiElement patternNode = patternNodes.current(); if (patternNode == null) { retu...
checkIfShouldAttemptToMatch
292,239
void (NodeIterator matchedNodes) { try { visitor.matchContext(matchedNodes); } finally { matchedNodes.reset(); } }
processMatchesInElement
292,240
boolean (@NotNull PsiElement element) { final MatchContext matchContext = getMatchContext(); matchContext.clear(); final CollectingMatchResultSink sink = new CollectingMatchResultSink(); matchContext.setSink(new DuplicateFilteringResultSink(sink)); final CompiledPattern compiledPattern = matchContext.getPattern(); if (...
matchNode
292,241
void () { final MatchContext matchContext = getMatchContext(); final MatchOptions options = matchContext.getOptions(); final CompiledPattern compiledPattern = matchContext.getPattern(); SearchScope searchScope = compiledPattern.getScope(); final boolean ourOptimizedScope = searchScope != null; if (!ourOptimizedScope) s...
findMatches
292,242
MatchContext () { return visitor.getMatchContext(); }
getMatchContext
292,243
Project () { return project; }
getProject
292,244
void () { ended = true; }
stop
292,245
void () { suspended = true; }
pause
292,246
void () { if (!suspended) return; suspended = false; PsiManager.getInstance(project).runInBatchFilesMode(() -> { executeNext(); return null; }); }
resume
292,247
boolean () { return suspended; }
isSuspended
292,248
boolean () { return ended; }
isEnded
292,249
void () { assert project != null; if (tasks != null) { taskQueueEndAction.run(); tasks = null; } }
clearSchedule
292,250
void (@NotNull PsiElement element) { final MatchContext context = getMatchContext(); final MatchingStrategy strategy = context.getPattern().getStrategy(); if (strategy.continueMatching(element)) { visitor.matchContext(SingleNodeIterator.create(element)); return; } if (context.getOptions().isSearchInjectedCode()) { for ...
match
292,251
List<PsiElement> () { final PsiElement file = this.file; this.file = null; return new SmartList<>(file); }
getPsiElementsToProcess
292,252
List<PsiElement> () { assert project != null; return ReadAction.compute( () -> { if (!myFile.isValid()) { // file may be been deleted since search started return Collections.emptyList(); } final PsiFile file = PsiManager.getInstance(project).findFile(myFile); if (file == null) { return Collections.emptyList(); } final ...
getPsiElementsToProcess
292,253
void () { assert project != null; final List<PsiElement> files = getPsiElementsToProcess(); final MatchContext matchContext = getMatchContext(); final ProgressIndicator progress = matchContext.getSink().getProgressIndicator(); if (progress != null) progress.setFraction((double)scannedFilesCount/totalFilesToScan); ++sca...
run
292,254
void (@NotNull ReplacementInfo info) {}
prepare
292,255
void (@NotNull PsiElement affectedElement, @NotNull ReplaceOptions options) {}
postProcess
292,256
void (@NotNull AnActionEvent event) { triggerAction(null, new SearchContext(event.getDataContext()), true); }
actionPerformed
292,257
DialogWrapper () { return myDialog; }
getDialog
292,258
void (DialogWrapper dialog) { if (dialog != null && (dialog.isDisposed() || dialog.isModal())) { return; } myDialog = dialog; }
setDialog
292,259
StructuralSearchPlugin (@NotNull Project project) { return project.getService(StructuralSearchPlugin.class); }
getInstance
292,260
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
292,261
void (@NotNull AnActionEvent event) { triggerAction(null, new SearchContext(event.getDataContext()), false); }
actionPerformed
292,262
void (Configuration config, @NotNull SearchContext searchContext, boolean replace) { final Project project = searchContext.getProject(); PsiDocumentManager.getInstance(project).commitAllDocuments(); final DialogWrapper dialog = StructuralSearchPlugin.getInstance(project).getDialog(); if (dialog != null) { assert !dialo...
triggerAction
292,263
VirtualFile () { return pointer.getVirtualFile(); }
getFile
292,264
int () { PsiElement element = getElement(); return element == null ? -1 : element.getTextRange().getStartOffset(); }
getOffset
292,265
int () { PsiElement element = getElement(); return element == null ? 0 : element.getTextRange().getEndOffset(); }
getLength
292,266
PsiElement () { return pointer.getElement(); }
getElement
292,267
boolean (Object o) { if (!(o instanceof SmartPsiPointer ref)) { return false; } return ref.pointer.equals(pointer); }
equals
292,268
int () { PsiElement element = getElement(); return element == null ? 0 : element.hashCode(); }
hashCode
292,269
void (@NotNull MatchResult result) { matches.add(result); }
newMatch
292,270
List<MatchResult> () { return matches; }
getMatches
292,271
void (@NotNull MatchResult result) { if (!duplicates.add(result.getMatchRef())) { return; } delegate.newMatch(result); }
newMatch
292,272
void (@NotNull PsiFile element) { delegate.processFile(element); }
processFile
292,273
void (@NotNull MatchingProcess matchingProcess) { delegate.setMatchingProcess(matchingProcess); }
setMatchingProcess
292,274
void () { duplicates.clear(); delegate.matchingFinished(); }
matchingFinished
292,275
ProgressIndicator () { return delegate.getProgressIndicator(); }
getProgressIndicator
292,276
ReplaceOptions () { return new ReplaceOptions(this); }
copy
292,277
void (@NotNull String replacement) { this.replacement = replacement; }
setReplacement
292,278
boolean () { return toShortenFQN; }
isToShortenFQN
292,279
void (boolean shortedFQN) { this.toShortenFQN = shortedFQN; }
setToShortenFQN
292,280
boolean () { return myToReformatAccordingToStyle; }
isToReformatAccordingToStyle
292,281
MatchOptions () { return matchOptions; }
getMatchOptions
292,282
void (boolean reformatAccordingToStyle) { myToReformatAccordingToStyle = reformatAccordingToStyle; }
setToReformatAccordingToStyle
292,283
boolean () { return myToUseStaticImport; }
isToUseStaticImport
292,284
void (boolean useStaticImport) { myToUseStaticImport = useStaticImport; }
setToUseStaticImport
292,285
Set<String> () { return TemplateImplUtil.parseVariableNames(replacement); }
getUsedVariableNames
292,286
void () { variableDefs.keySet().removeIf(key -> !getUsedVariableNames().contains(key)); }
removeUnusedVariables
292,287
void (Element element) { matchOptions.readExternal(element); Attribute attribute = element.getAttribute(REFORMAT_ATTR_NAME); try { myToReformatAccordingToStyle = attribute == null || attribute.getBooleanValue(); } catch(DataConversionException ignored) {} attribute = element.getAttribute(SHORTEN_FQN_ATTR_NAME); try { t...
readExternal
292,288
void (Element element) { matchOptions.writeExternal(element); element.setAttribute(REFORMAT_ATTR_NAME,String.valueOf(myToReformatAccordingToStyle)); element.setAttribute(SHORTEN_FQN_ATTR_NAME,String.valueOf(toShortenFQN)); if (myToUseStaticImport) { element.setAttribute(USE_STATIC_IMPORT_ATTR_NAME, String.valueOf(true)...
writeExternal
292,289
boolean (Object o) { if (this == o) return true; if (!(o instanceof ReplaceOptions replaceOptions)) return false; if (myToReformatAccordingToStyle != replaceOptions.myToReformatAccordingToStyle) return false; if (toShortenFQN != replaceOptions.toShortenFQN) return false; if (myToUseStaticImport != replaceOptions.myToUs...
equals
292,290
int () { int result = replacement.hashCode(); result = 29 * result + (toShortenFQN ? 1 : 0); result = 29 * result + (myToReformatAccordingToStyle ? 1 : 0); result = 29 * result + (myToUseStaticImport ? 1 : 0); result = 29 * result + matchOptions.hashCode(); result = 29 * result + variableDefs.hashCode(); return result;...
hashCode
292,291
ReplacementVariableDefinition (@NotNull String name) { return variableDefs != null ? variableDefs.get(name): null; }
getVariableDefinition
292,292
void (@NotNull ReplacementVariableDefinition definition) { variableDefs.put(definition.getName(), definition); }
addVariableDefinition
292,293
ReplacementVariableDefinition (@NotNull String name) { final ReplacementVariableDefinition definition = new ReplacementVariableDefinition(name); variableDefs.put(name, definition); return definition; }
addNewVariableDefinition
292,294
Collection<ReplacementVariableDefinition> () { return variableDefs.values(); }
getVariableDefinitions
292,295
void () { variableDefs.clear(); }
clearVariableDefinitions
292,296
void (@NotNull Usage usage, @NotNull MatchResult result) { usage2ReplacementInfo.put(usage, replacer.buildReplacement(result)); }
addReplaceUsage
292,297
boolean (@NotNull UsageInfo2UsageAdapter info) { final PsiElement element = info.getUsageInfo().getElement(); return element != null && element.isValid(); }
isValid
292,298
void () { super.configureActions(); myUsageView.addButtonToLowerPane(() -> replace(myUsageView.getSortedUsages()), SSRBundle.message("do.replace.all.button")); myUsageView.addButtonToLowerPane(() -> replace(myUsageView.getSelectedUsages()), SSRBundle.message("replace.selected.button")); final Runnable previewReplacemen...
configureActions
292,299
void (@NotNull Collection<? extends Usage> usages) { final Set<Usage> excluded = myUsageView.getExcludedUsages(); usages = usages.stream().filter(u -> !excluded.contains(u)).filter(u -> isValid((UsageInfo2UsageAdapter)u)).collect(Collectors.toList()); final List<VirtualFile> files = ContainerUtil.map(usages, i -> ((Usa...
replace