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) { resultInfo = info; if (provider instanceof PreferrableNameSuggestionProvider && !((PreferrableNameSuggestionProvider)provider).shouldCheckOthers()) { break; } } } return resultInfo; }
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)) { validators.add(pair(validator, context)); } } return validators.isEmpty() ? null : newName -> ContainerUtil.and(validators, p -> p.first.isInputValid(newName, element, p.second)); }
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, searchScope, false, searchInStringsAndComments, searchForTextOccurrences, info -> false ); }
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 = PsiSearchHelper.getInstance(element.getProject()).getUseScope(element); if (!(useScope instanceof LocalSearchScope)) { useScope = searchScope.intersectWith(useScope); } if (searchInCode) { Collection<PsiReference> refs = elementProcessor.findReferences(element, useScope, searchInStringsAndComments); for (final PsiReference ref : refs) { if (ref == null) { LOG.error("null reference from processor " + elementProcessor); continue; } PsiElement referenceElement = ref.getElement(); if (!processor.process(elementProcessor.createUsageInfo(element, ref, referenceElement))) return false; } } final PsiElement searchForInComments = elementProcessor.getElementToSearchInStringsAndComments(element); if (searchInStringsAndComments && searchForInComments != null) { String stringToSearch = ElementDescriptionUtil.getElementDescription(searchForInComments, NonCodeSearchDescriptionLocation.STRINGS_AND_COMMENTS); if (stringToSearch.length() > 0) { final String stringToReplace = getStringToReplace(element, newName, false, elementProcessor); UsageInfoFactory factory = new NonCodeUsageInfoFactory(searchForInComments, stringToReplace); if (!TextOccurrencesUtilBase.processUsagesInStringsAndComments(processor, searchForInComments, searchScope, stringToSearch, factory)) return false; } } if (searchForTextOccurrences && searchForInComments != null) { String stringToSearch = ElementDescriptionUtil.getElementDescription(searchForInComments, NonCodeSearchDescriptionLocation.NON_JAVA); if (stringToSearch.length() > 0) { final String stringToReplace = getStringToReplace(element, newName, true, elementProcessor); if (!processTextOccurrences(searchForInComments, searchScope, stringToSearch, stringToReplace, processor)) return false; } final Pair<String, String> additionalStringToSearch = elementProcessor.getTextOccurrenceSearchStrings(searchForInComments, newName); if (additionalStringToSearch != null && additionalStringToSearch.first.length() > 0) { if (!processTextOccurrences(searchForInComments, searchScope, additionalStringToSearch.first, additionalStringToSearch.second, processor )) return false; } } return true; }
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, int endOffset) { TextRange textRange = usage.getTextRange(); int start = textRange == null ? 0 : textRange.getStartOffset(); return NonCodeUsageInfo.create(usage.getContainingFile(), start + startOffset, start + endOffset, element, stringToReplace); } }; if (searchScope instanceof GlobalSearchScope) { return FindUsagesHelper.processTextOccurrences(element, stringToSearch, (GlobalSearchScope)searchScope, factory, processor); } else { return true; } }
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(virtualFile.getPresentableUrl()).append("\n"); } message.append(RefactoringBundle.message("these.package.prefixes.will.be.changed")); } }
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 = theProcessor.getQualifiedNameAfterRename(element, newName, nonJava); if (result != null) { return result; } } if (element instanceof PsiNamedElement) { return newName; } else { LOG.error("Unknown element type : " + element); return null; } }
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 (listener instanceof UndoRefactoringElementListener) { ((UndoRefactoringElementListener)listener).undoElementMovedOrRenamed(element, fqn); } } @Override public void redo() { } }; UndoManager.getInstance(element.getProject()).undoableActionPerformed(action); } }
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; } ApplicationManager.getApplication().invokeLater(() -> { final String helpID = RenamePsiElementProcessorBase.forPsiElement(element).getHelpID(element); String message = e.getMessage(); if (StringUtil.isEmpty(message)) { message = RefactoringBundle.message("rename.not.supported"); } CommonRefactoringUtil.showErrorMessage(RefactoringBundle.message("rename.title"), message, helpID, project); }); }
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((UnresolvableCollisionUsageInfo)usageInfo); iterator.remove(); } } return result.isEmpty() ? null : result; }
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 element = usage.getElement(); if (element == null) continue; element = CodeInsightUtilCore.forcePsiPostprocessAndRestoreElement(element, true); if (element == null) continue; final ProperTextRange rangeInElement = usage.getRangeInElement(); if (rangeInElement == null) continue; final PsiFile containingFile = element.getContainingFile(); Document document = containingFile.getViewProvider().getDocument(); if (document != null) { psiDocumentManager.commitDocument(document); } final Segment segment = usage.getSegment(); LOG.assertTrue(segment != null); TextRange replaceRange = TextRange.create(segment); // re-map usages to upper host from injected document to avoid duplicated replacements while (document instanceof DocumentWindow documentWindow) { replaceRange = documentWindow.injectedToHost(replaceRange); document = documentWindow.getDelegate(); } int fileOffset = replaceRange.getStartOffset(); Int2ObjectMap<UsageOffset> offsetMap = docsToOffsetsMap.get(document); if (offsetMap == null) { offsetMap = new Int2ObjectOpenHashMap<>(); docsToOffsetsMap.put(document, offsetMap); } final UsageOffset substitution = new UsageOffset(fileOffset, fileOffset + rangeInElement.getLength(), usage.newText); final UsageOffset duplicate = offsetMap.get(fileOffset); if (duplicate != null) { if (!duplicate.equals(substitution)) { LOG.warn("ATTENTION! Unequal renaming in the same place in the document, possibly due to injection (read more in CPP-17316):\n" + " document: " + document + "\n" + " element: " + element + "\n" + " first rename: " + substitution.newText + "(" + substitution.startOffset + ", " + substitution.endOffset + ")\n" + " second rename: " + duplicate.newText + "(" + duplicate.startOffset + ", " + duplicate.endOffset + ")"); } } else { offsetMap.put(fileOffset, substitution); } } for (Document document : docsToOffsetsMap.keySet()) { Map<Integer, UsageOffset> offsetMap = docsToOffsetsMap.get(document); LOG.assertTrue(offsetMap != null, document); UsageOffset[] offsets = offsetMap.values().toArray(new UsageOffset[0]); Arrays.sort(offsets); for (int i = offsets.length - 1; i >= 0; i--) { UsageOffset usageOffset = offsets[i]; document.replaceString(usageOffset.startOffset, usageOffset.endOffset, usageOffset.newText); } psiDocumentManager.commitDocument(document); } }
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); } if (psiElement instanceof PsiFile || psiElement instanceof PsiDirectory) { return newName.indexOf('\\') < 0 && newName.indexOf('/') < 0; } if (psiElement instanceof PomTargetPsiElement) { return !StringUtil.isEmptyOrSpaces(newName); } final PsiFile file = psiElement.getContainingFile(); final Language elementLanguage = psiElement.getLanguage(); final Language fileLanguage = file == null ? null : file.getLanguage(); Language language = fileLanguage == null ? elementLanguage : fileLanguage.isKindOf(elementLanguage) ? fileLanguage : elementLanguage; return LanguageNamesValidation.isIdentifier(language, newName.trim(), project); }
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 = DEFAULT_NAME.getData(dataContext); if (newName != null) { rename(element, project, element, editor, newName); return; } } editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE); final PsiElement nameSuggestionContext = InjectedLanguageUtilBase.findElementAtNoCommit(file, editor.getCaretModel().getOffset()); invoke(element, project, nameSuggestionContext, editor, shouldCheckInProject()); }
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 (ApplicationManager.getApplication().isUnitTestMode()) { final String newName = DEFAULT_NAME.getData(dataContext); LOG.assertTrue(newName != null); rename(element, project, element, editor, newName); } else { invoke(element, project, element, editor, shouldCheckInProject()); } }
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 != null && nameSuggestionContext.isPhysical() && (contextFile == null || !ScratchUtil.isScratch(contextFile)) && !PsiManager.getInstance(project).isInProject(nameSuggestionContext)) { final String message = RefactoringBundle.message("dialog.message.selected.element.used.from.non.project.files"); if (ApplicationManager.getApplication().isUnitTestMode()) throw new CommonRefactoringUtil.RefactoringErrorHintException(message); if (!MessageDialogBuilder.yesNo(RefactoringBundle.getCannotRefactorMessage(null), message, UIUtil.getWarningIcon()).ask(project)) { return; } } rename(element, project, nameSuggestionContext, editor); }
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)) return; RenameRefactoringDialog dialog = processor.createDialog(project, substituted, nameSuggestionContext, editor); if (defaultName == null && ApplicationManager.getApplication().isUnitTestMode()) { String[] strings = dialog.getSuggestedNames(); if (strings != null && strings.length > 0) { Arrays.sort(strings); defaultName = strings[0]; } else { defaultName = "undefined"; // need to avoid show dialog in test } } if (defaultName != null) { try { dialog.performRename(defaultName); } finally { dialog.close(); // to avoid dialog leak } } else { dialog.show(); } }
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)) return true; } return false; }
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 variable = iterator.next(); RenameUtil.assertNonCompileElement(variable); final boolean success = findUsagesForElement(variable, result, searchInStringsAndComments, searchInNonJavaFiles, unresolvedUsages, allRenames); if (!success) { iterator.remove(); } } }
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 LinkedHashMap<PsiNamedElement, String> renames = new LinkedHashMap<>(myRenames); if (allRenames != null) { for (PsiElement psiElement : allRenames.keySet()) { if (psiElement instanceof PsiNamedElement) { renames.put((PsiNamedElement)psiElement, allRenames.get(psiElement)); } } } final UsageInfo[] usages = RenameUtil.findUsages(element, newName, searchInStringsAndComments, searchInNonJavaFiles, renames); for (final UsageInfo usage : usages) { if (usage instanceof UnresolvableCollisionUsageInfo) { if (unresolvedUsages != null) { unresolvedUsages.add((UnresolvableCollisionUsageInfo)usage); } return false; } } ContainerUtil.addAll(result, usages); } return true; }
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.containsKey(element) && name != null) { String newName = suggestNameForElement(element, suggester, newClassName, oldClassName); if (!newName.equals(name)) { myRenames.put(element, newName); } else { myRenames.put(element, null); } } if (myRenames.get(element) == null) { myElements.remove(varIndex); } } }
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); if (newCanonicalName.isEmpty()) { LOG.error("oldClassName = " + oldClassName + ", newClassName = " + newClassName + ", name = " + name + ", canonicalName = " + canonicalName + ", newCanonicalName = " + newCanonicalName); } return canonicalNameToName(newCanonicalName, element); }
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>, String> replacements = calculateReplacements(propertyWords, matches); if (replacements.isEmpty()) return propertyName; return calculateNewName(replacements, propertyWords, propertyName); }
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>, String> entry : replacements.entrySet()) { final int first = entry.getKey().getFirst().intValue(); final int last = entry.getKey().getSecond().intValue(); for (int i = currentWord; i < first; i++) { resultingWords.append(calculateBetween(wordIndices, i, propertyName)); final String propertyWord = propertyWords[i]; appendWord(resultingWords, propertyWord); } resultingWords.append(calculateBetween(wordIndices, first, propertyName)); appendWord(resultingWords, entry.getValue()); currentWord = last + 1; } for (; currentWord < propertyWords.length; currentWord++) { resultingWords.append(calculateBetween(wordIndices, currentWord, propertyName)); appendWord(resultingWords, propertyWords[currentWord]); } resultingWords.append(calculateBetween(wordIndices, propertyWords.length, propertyName)); if (resultingWords.isEmpty()) return propertyName; return decapitalizeProbably(resultingWords.toString(), propertyName); }
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--) { match = checkMatch(j, i, propertyWord); } if (match != null) { matches.put(match.oldClassNameIndex, i); classNameIndex = match.oldClassNameIndex - 1; } } return matches; }
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.createNodeText(element) : presentation.getPresentableText(); myLocationText = presentation == null ? null : StringUtil.nullize(presentation.getLocationString()); if (myIcon == null) { if (element instanceof PsiMetaOwner psiMetaOwner) { final PsiMetaData metaData = psiMetaOwner.getMetaData(); if (metaData instanceof PsiPresentableMetaData psiPresentableMetaData) { if (myIcon == null) myIcon = psiPresentableMetaData.getIcon(); } } else if (element instanceof PsiFile psiFile) { final VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile != null) { myIcon = VirtualFilePresentation.getIcon(virtualFile); } } } } }
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(String.format("Error while stopping span %s ", spanName), e); } } }
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