Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
286,600
boolean (RenamePsiElementProcessorBase processor) { return false; }
isApplicable
286,601
SuggestedNameInfo (PsiElement psiElement, PsiElement nameSuggestionContext, Set<String> result) { SuggestedNameInfo resultInfo = null; for (NameSuggestionProvider provider : EP_NAME.getExtensionList()) { SuggestedNameInfo info = provider.getSuggestedNames(psiElement, nameSuggestionContext, result); if (info != null) { ...
suggestNames
286,602
Condition<String> (PsiElement element) { List<Pair<RenameInputValidator, ProcessingContext>> validators = new ArrayList<>(); for (RenameInputValidator validator : RenameInputValidator.EP_NAME.getExtensionList()) { ProcessingContext context = new ProcessingContext(); if (validator.getPattern().accepts(element, context))...
getInputValidator
286,603
boolean () { return true; }
shouldCheckOthers
286,604
boolean (@NotNull PsiElement element, String newName, @NotNull SearchScope searchScope, boolean searchInStringsAndComments, boolean searchForTextOccurrences) { RenamePsiElementProcessorBase elementProcessor = RenamePsiElementProcessorBase.forPsiElement(element); return !processUsages(element, elementProcessor, newName,...
hasNonCodeUsages
286,605
boolean ( @NotNull PsiElement element, @NotNull RenamePsiElementProcessorBase elementProcessor, String newName, @NotNull SearchScope searchScope, boolean searchInCode, boolean searchInStringsAndComments, boolean searchForTextOccurrences, @NotNull Processor<? super UsageInfo> processor ) { SearchScope useScope = PsiSear...
processUsages
286,606
boolean ( @NotNull PsiElement element, @NotNull SearchScope searchScope, @NotNull String stringToSearch, String stringToReplace, @NotNull Processor<? super UsageInfo> processor ) { UsageInfoFactory factory = new UsageInfoFactory() { @Override public UsageInfo createUsageInfo(@NotNull PsiElement usage, int startOffset, ...
processTextOccurrences
286,607
UsageInfo (@NotNull PsiElement usage, int startOffset, int endOffset) { TextRange textRange = usage.getTextRange(); int start = textRange == null ? 0 : textRange.getStartOffset(); return NonCodeUsageInfo.create(usage.getContainingFile(), start + startOffset, start + endOffset, element, stringToReplace); }
createUsageInfo
286,608
void (final VirtualFile[] virtualFiles, StringBuffer message, final String qualifiedName) { if (virtualFiles.length > 0) { message.append(RefactoringBundle.message("package.occurs.in.package.prefixes.of.the.following.source.folders.n", qualifiedName)); for (final VirtualFile virtualFile : virtualFiles) { message.append...
buildPackagePrefixChangedMessage
286,609
String (PsiElement element, String newName, boolean nonJava, final RenamePsiElementProcessorBase theProcessor) { if (element instanceof PsiMetaOwner psiMetaOwner) { final PsiMetaData metaData = psiMetaOwner.getMetaData(); if (metaData != null) { return metaData.getName(); } } if (theProcessor != null) { String result =...
getStringToReplace
286,610
void (PsiElement element, @Nullable RefactoringElementListener listener) { final String fqn = element instanceof PsiFile ? ((PsiFile)element).getVirtualFile().getPath() : FqnUtil.elementToFqn(element, null); if (fqn != null) { UndoableAction action = new BasicUndoableAction() { @Override public void undo() { if (listen...
registerUndoableRename
286,611
void () { if (listener instanceof UndoRefactoringElementListener) { ((UndoRefactoringElementListener)listener).undoElementMovedOrRenamed(element, fqn); } }
undo
286,612
void () { }
redo
286,613
void (final IncorrectOperationException e, final PsiElement element, final Project project) { // may happen if the file or package cannot be renamed. e.g. locked by another application if (ApplicationManager.getApplication().isUnitTestMode()) { throw new RuntimeException(e); //LOG.error(e); //return; } ApplicationManag...
showErrorMessage
286,614
List<UnresolvableCollisionUsageInfo> (Set<UsageInfo> usages) { final List<UnresolvableCollisionUsageInfo> result = new ArrayList<>(); for (Iterator<UsageInfo> iterator = usages.iterator(); iterator.hasNext();) { UsageInfo usageInfo = iterator.next(); if (usageInfo instanceof UnresolvableCollisionUsageInfo) { result.add...
removeConflictUsages
286,615
void (UsageInfo[] usages, MultiMap<PsiElement, @DialogMessage String> conflicts) { for (UsageInfo usage : usages) { if (usage instanceof UnresolvableCollisionUsageInfo) { conflicts.putValue(usage.getElement(), ((UnresolvableCollisionUsageInfo)usage).getDescription()); } } }
addConflictDescriptions
286,616
void (@NotNull Project project, NonCodeUsageInfo @NotNull [] usages) { Map<Document, Int2ObjectMap<UsageOffset>> docsToOffsetsMap = CollectionFactory.createSmallMemoryFootprintMap(); final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project); for (NonCodeUsageInfo usage : usages) { PsiElement...
renameNonCodeUsages
286,617
boolean (final Project project, final PsiElement psiElement, final String newName) { if (newName == null || newName.length() == 0) { return false; } final Condition<String> inputValidator = RenameInputValidatorRegistry.getInputValidator(psiElement); if (inputValidator != null) { return inputValidator.value(newName); } ...
isValidName
286,618
void (PsiElement element) { LOG.assertTrue(!(element instanceof PsiCompiledElement), element); }
assertNonCompileElement
286,619
int (@NotNull final UsageOffset o) { return startOffset - o.startOffset; }
compareTo
286,620
String (@NotNull PsiElement element) { return ElementDescriptionUtil.getElementDescription(element, UsageViewTypeLocation.INSTANCE); }
getUsageViewType
286,621
void (@NotNull Project project, Editor editor, PsiFile file, @NotNull DataContext dataContext) { PsiElement element = getElement(dataContext); if (element == null) { element = CommonRefactoringUtil.getElementAtCaret(editor, file); } if (ApplicationManager.getApplication().isUnitTestMode()) { final String newName = DEFA...
invoke
286,622
void (@NotNull Project project, PsiElement @NotNull [] elements, DataContext dataContext) { PsiElement element = elements.length == 1 ? elements[0] : null; if (element == null) element = getElement(dataContext); LOG.assertTrue(element != null); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (Application...
invoke
286,623
boolean () { return true; }
shouldCheckInProject
286,624
void (@NotNull PsiElement element, @NotNull Project project, PsiElement nameSuggestionContext, @Nullable Editor editor) { invoke(element, project, nameSuggestionContext, editor, true); }
invoke
286,625
void (@NotNull PsiElement element, @NotNull Project project, PsiElement nameSuggestionContext, @Nullable Editor editor, boolean checkInProject) { if (!canRename(project, editor, element)) { return; } VirtualFile contextFile = PsiUtilCore.getVirtualFile(nameSuggestionContext); if (checkInProject && nameSuggestionContext...
invoke
286,626
void (@NotNull Project project, @Nullable Editor editor, @NotNull @NlsContexts.DialogMessage String message) { CommonRefactoringUtil.showErrorHint(project, editor, message, RefactoringBundle.message("rename.title"), null); }
showErrorMessage
286,627
void (@NotNull PsiElement element, @NotNull Project project, PsiElement nameSuggestionContext, Editor editor) { rename(element, project, nameSuggestionContext, editor, null); }
rename
286,628
void (@NotNull PsiElement element, @NotNull Project project, PsiElement nameSuggestionContext, Editor editor, String defaultName) { RenamePsiElementProcessorBase processor = RenamePsiElementProcessorBase.forPsiElement(element); rename(element, project, nameSuggestionContext, editor, defaultName, processor); }
rename
286,629
void (@NotNull PsiElement element, @NotNull Project project, PsiElement nameSuggestionContext, Editor editor, String defaultName, RenamePsiElementProcessorBase processor) { PsiElement substituted = processor.substituteElementToRename(element, editor); if (substituted == null || !canRename(project, editor, substituted))...
rename
286,630
boolean (@NotNull DataContext dataContext) { return !isVetoed(getElement(dataContext)); }
isAvailableOnDataContext
286,631
boolean (PsiElement element) { if (element == null || element instanceof SyntheticElement || element instanceof PsiNamedElement namedElement && namedElement.getName() == null) { return true; } for(Condition<? super PsiElement> condition: VETO_RENAME_CONDITION_EP.getExtensionList()) { if (condition.value(element)) retur...
isVetoed
286,632
PsiElement (@NotNull DataContext dataContext) { PsiElement[] elementArray = CommonRefactoringUtil.getPsiElementArray(dataContext); if (elementArray.length != 1) { return null; } return elementArray[0]; }
getElement
286,633
boolean () { return ContainerUtil.exists(myRenames.values(), Objects::nonNull) && ContainerUtil.exists(myRenames.keySet(), obj -> !(obj instanceof SyntheticElement)); }
hasAnythingToRename
286,634
void (List<UsageInfo> result, final boolean searchInStringsAndComments, final boolean searchInNonJavaFiles) { findUsages(result, searchInStringsAndComments, searchInNonJavaFiles, null); }
findUsages
286,635
void (List<UsageInfo> result, final boolean searchInStringsAndComments, final boolean searchInNonJavaFiles, List<? super UnresolvableCollisionUsageInfo> unresolvedUsages) { findUsages(result, searchInStringsAndComments, searchInNonJavaFiles, unresolvedUsages, null); }
findUsages
286,636
void (List<UsageInfo> result, final boolean searchInStringsAndComments, final boolean searchInNonJavaFiles, List<? super UnresolvableCollisionUsageInfo> unresolvedUsages, Map<PsiElement, String> allRenames) { for (Iterator<PsiNamedElement> iterator = myElements.iterator(); iterator.hasNext();) { final PsiNamedElement v...
findUsages
286,637
boolean (PsiNamedElement element, List<? super UsageInfo> result, final boolean searchInStringsAndComments, final boolean searchInNonJavaFiles, List<? super UnresolvableCollisionUsageInfo> unresolvedUsages, Map<PsiElement, String> allRenames) { final String newName = getNewName(element); if (newName != null) { final Li...
findUsagesForElement
286,638
List<PsiNamedElement> () { return Collections.unmodifiableList(myElements); }
getElements
286,639
String (PsiNamedElement namedElement) { return myRenames.get(namedElement); }
getNewName
286,640
void (PsiNamedElement element, String replacement) { LOG.assertTrue(myRenames.put(element, replacement) != null); }
setRename
286,641
void (PsiNamedElement element) { LOG.assertTrue(myRenames.remove(element) != null); }
doNotRename
286,642
void (final String oldClassName, String newClassName) { final NameSuggester suggester = new NameSuggester(oldClassName, newClassName); for (int varIndex = myElements.size() - 1; varIndex >= 0; varIndex--) { final PsiNamedElement element = myElements.get(varIndex); final String name = element.getName(); if (!myRenames.c...
suggestAllNames
286,643
String (PsiNamedElement element, NameSuggester suggester, String newClassName, String oldClassName) { String name = element.getName(); if (oldClassName.equals(name)) { return newClassName; } String canonicalName = nameToCanonicalName(name, element); final String newCanonicalName = suggester.suggestName(canonicalName); ...
suggestNameForElement
286,644
String (@NonNls String canonicalName, PsiNamedElement element) { return canonicalName; }
canonicalNameToName
286,645
String (@NonNls String name, PsiNamedElement element) { return name; }
nameToCanonicalName
286,646
boolean () { return true; }
allowChangeSuggestedName
286,647
boolean () { return false; }
isSelectedByDefault
286,648
int (String patternWord, int newIndex) { for (int i = newIndex; i >= 0; i--) { final String s = myNewClassName[i]; if (s.equals(patternWord)) return i; } return -1; }
findInNewBackwardsFromIndex
286,649
String (final String propertyName) { if (myOldClassNameAsGiven.equals(propertyName)) return myNewClassNameAsGiven; final String[] propertyWords = NameUtilCore.splitNameIntoWords(propertyName); Int2IntMap matches = calculateMatches(propertyWords); if (matches.isEmpty()) return propertyName; TreeMap<Pair<Integer, Integer...
suggestName
286,650
String (TreeMap<Pair<Integer, Integer>, String> replacements, final String[] propertyWords, String propertyName) { StringBuffer resultingWords = new StringBuffer(); int currentWord = 0; final Pair<int[], int[]> wordIndices = calculateWordPositions(propertyName, propertyWords); for (final Map.Entry<Pair<Integer, Integer...
calculateNewName
286,651
void (StringBuffer resultingWords, String propertyWord) { if (!resultingWords.isEmpty()) { final char lastChar = resultingWords.charAt(resultingWords.length() - 1); if (Character.isLetterOrDigit(lastChar)) { propertyWord = StringUtil.capitalize(propertyWord); } } resultingWords.append(propertyWord); }
appendWord
286,652
String (final Pair<int[], int[]> wordIndices, int i, String propertyName) { final int thisWordStart = wordIndices.getFirst()[i]; final int prevWordEnd = wordIndices.getSecond()[i]; return propertyName.substring(prevWordEnd + 1, thisWordStart); }
calculateBetween
286,653
String (String propertyWord, @NotNull String newClassNameWords) { return decapitalizeProbably(newClassNameWords, propertyWord); }
suggestReplacement
286,654
String (@NotNull String word, String originalWord) { if (originalWord.isEmpty()) return word; if (Character.isLowerCase(originalWord.charAt(0))) { return StringUtil.decapitalize(word); } return word; }
decapitalizeProbably
286,655
boolean (Int2IntMap matches, int first, int last) { for (int i = first; i <= last; i++) { if (!matches.containsKey(i)) return false; } return true; }
containsAllBetween
286,656
Int2IntMap (final String[] propertyWords) { int classNameIndex = myOldClassName.length - 1; Int2IntMap matches = new Int2IntOpenHashMap(); for (int i = propertyWords.length - 1; i >= 0; i--) { final String propertyWord = propertyWords[i]; Match match = null; for (int j = classNameIndex; j >= 0 && match == null; j--) { ...
calculateMatches
286,657
record (int oldClassNameIndex, int propertyNameIndex, String propertyWord) { }
Match
286,658
Match (final int oldClassNameIndex, final int propertyNameIndex, final String propertyWord) { if (propertyWord.equalsIgnoreCase(myOldClassName[oldClassNameIndex])) { return new Match(oldClassNameIndex, propertyNameIndex, propertyWord); } else { return null; } }
checkMatch
286,659
FindInProjectSettings (Project project) { return project.getService(FindInProjectSettings.class); }
getInstance
286,660
FindManager (Project project) { return project.getService(FindManager.class); }
getInstance
286,661
String () { PsiElement element = getElement(); return element instanceof NavigationItem ? ((NavigationItem)element).getName() : null; }
getName
286,662
ItemPresentation () { return this; }
getPresentation
286,663
void (boolean requestFocus) { PsiElement element = getElement(); if (element instanceof Navigatable && ((Navigatable)element).canNavigate()) { ((Navigatable)element).navigate(requestFocus); } }
navigate
286,664
boolean () { PsiElement element = getElement(); return element instanceof Navigatable && ((Navigatable)element).canNavigate(); }
canNavigate
286,665
boolean () { PsiElement element = getElement(); return element instanceof Navigatable && ((Navigatable)element).canNavigateToSource(); }
canNavigateToSource
286,666
PsiElement () { return getElement(); }
getTargetElement
286,667
String () { return getPresentableText(); }
toString
286,668
void () { PsiElement element = getElement(); if (element != null) { RefactoringUiService.getInstance().startFindUsages(element, myOptions); } }
findUsages
286,669
PsiElement () { return myPointer.getElement(); }
getElement
286,670
void (@NotNull FileEditor editor) { PsiElement element = getElement(); FindManager.getInstance(element.getProject()).findUsagesInEditor(element, editor); }
findUsagesInEditor
286,671
void (@NotNull PsiFile file, @NotNull Editor editor, boolean clearHighlights) { PsiElement target = getElement(); RefactoringUiService.getInstance().highlightUsageReferences(file, target, editor, clearHighlights); }
highlightUsages
286,672
boolean () { return getElement() != null; }
isValid
286,673
boolean () { return isValid() && !getElement().isWritable(); }
isReadOnly
286,674
VirtualFile[] () { if (!isValid()) return null; final PsiFile psiFile = getElement().getContainingFile(); if (psiFile == null) return null; final VirtualFile virtualFile = psiFile.getVirtualFile(); return virtualFile == null ? null : new VirtualFile[]{virtualFile}; }
getFiles
286,675
Object (@NotNull String dataId) { if (PlatformCoreDataKeys.BGT_DATA_PROVIDER.is(dataId)) { return (DataProvider)this::getSlowData; } else if (UsageView.USAGE_SCOPE.is(dataId)) { return myOptions.searchScope; } return null; }
getData
286,676
KeyboardShortcut () { return UsageViewUtil.getShowUsagesWithSettingsShortcut(); }
getShortcut
286,677
void () { PsiElement element = getElement(); if (element != null) { RefactoringUiService.getInstance().findUsages(myPointer.getProject(), element, null, null, true, null); } }
showSettings
286,678
void () { PsiElement element = getElement(); if (element != null) { update(element, element.getContainingFile()); } }
update
286,679
void (@NotNull PsiElement element, PsiFile file) { if (file == null ? element.isValid() : file.isValid()) { final ItemPresentation presentation = ((NavigationItem)element).getPresentation(); myIcon = presentation == null ? null : presentation.getIcon(true); myPresentableText = presentation == null ? UsageViewUtil.creat...
update
286,680
String () { return myPresentableText; }
getPresentableText
286,681
Icon (boolean open) { return myIcon; }
getIcon
286,682
Project () { return myPointer.getProject(); }
getProject
286,683
Context (String spanName) { return Context.current().with(getOrStartSpan(spanName)); }
getSpanContext
286,684
Span (@NotNull String spanName) { return getOrStartSpan(spanName, (builder) -> builder); }
getOrStartSpan
286,685
Span (@NotNull String spanName, @NotNull String parentSpanName) { getOrStartSpan(parentSpanName); return getOrStartSpan(spanName, (builder) -> builder.setParent(getSpanContext(parentSpanName))); }
getOrStartSpan
286,686
Span (@NotNull String spanName, Function<SpanBuilder, SpanBuilder> action) { return spans.computeIfAbsent(spanName, (name) -> action.apply(tracer.spanBuilder(spanName, TracerLevel.DEFAULT)).startSpan()); }
getOrStartSpan
286,687
Span (@NotNull String spanName, @NotNull String parentSpanName) { getOrStartSpan(parentSpanName); return startNewSpan(spanName, (builder) -> builder.setParent(getSpanContext(parentSpanName))); }
startNewSpan
286,688
Span (@NotNull String spanName, Function<SpanBuilder, SpanBuilder> action) { return spans.put(spanName, action.apply(tracer.spanBuilder(spanName, TracerLevel.DEFAULT)).startSpan()); }
startNewSpan
286,689
void (@NotNull String spanName) { endSpan(spanName, (span) -> span); }
endSpan
286,690
void (@NotNull String spanName, Function<Span, Span> action) { if (!spans.containsKey(spanName)) { LOG.error(String.format("Span with name %s isn't started yet, but was called to stop", spanName)); } var span = spans.get(spanName); if (span != null) { try { action.apply(span).end(); } catch (Exception e) { LOG.error(St...
endSpan
286,691
Meter () { return TelemetryManager.getInstance().getMeter(rootScopeName); }
getMeter
286,692
String () { return threadName; }
getThreadName
286,693
void () { Thread thread = Thread.currentThread(); threadId = thread.getId(); threadName = thread.getName(); }
updateThreadName
286,694
long () { return threadId; }
getThreadId
286,695
ActivityImpl (@NotNull String name) { return new ActivityImpl(name, System.nanoTime(), this, pluginId, category); }
startChild
286,696
String () { return name; }
getName
286,697
long () { return start; }
getStart
286,698
long () { return end; }
getEnd
286,699
void (long end) { assert this.end == 0 : "not started or already ended"; this.end = end; }
setEnd