Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
286,900
void (@NlsContexts.ListItem String targetsNodeText) { myTargetsNodeText = targetsNodeText; }
setTargetsNodeText
286,901
boolean () { return myShowCancelButton; }
isShowCancelButton
286,902
void (boolean showCancelButton) { myShowCancelButton = showCancelButton; }
setShowCancelButton
286,903
void (@NotNull @NlsContexts.ListItem String nonCodeUsagesString) { myNonCodeUsagesString = nonCodeUsagesString; }
setNonCodeUsagesString
286,904
void (@NotNull @NlsContexts.ListItem String codeUsagesString) { myCodeUsagesString = codeUsagesString; }
setCodeUsagesString
286,905
boolean () { return myOpenInNewTab; }
isOpenInNewTab
286,906
void (boolean openInNewTab) { myOpenInNewTab = openInNewTab; }
setOpenInNewTab
286,907
int () { return myRerunHash; }
getRerunHash
286,908
void (int rerunHash) { myRerunHash = rerunHash; }
setRerunHash
286,909
boolean () { return myCodeUsages; }
isCodeUsages
286,910
void (final boolean codeUsages) { myCodeUsages = codeUsages; }
setCodeUsages
286,911
void (final @NlsContexts.TabTitle String tabName) { myTabName = tabName; }
setTabName
286,912
void (final @NlsContexts.TabTitle String toolwindowTitle) { myToolwindowTitle = toolwindowTitle; }
setToolwindowTitle
286,913
boolean () { return myDetachedMode; }
isDetachedMode
286,914
void (boolean detachedMode) { myDetachedMode = detachedMode; }
setDetachedMode
286,915
void (@NlsContexts.ListItem String dynamicCodeUsagesString) { myDynamicCodeUsagesString = dynamicCodeUsagesString; }
setDynamicUsagesString
286,916
boolean () { return myMergeDupLinesAvailable; }
isMergeDupLinesAvailable
286,917
void (boolean mergeDupLinesAvailable) { myMergeDupLinesAvailable = mergeDupLinesAvailable; }
setMergeDupLinesAvailable
286,918
boolean () { return myCodeUsages || myUsageTypeFilteringAvailable; }
isUsageTypeFilteringAvailable
286,919
void (boolean usageTypeFilteringAvailable) { myUsageTypeFilteringAvailable = usageTypeFilteringAvailable; }
setUsageTypeFilteringAvailable
286,920
boolean () { return myExcludeAvailable; }
isExcludeAvailable
286,921
void (boolean excludeAvailable) { myExcludeAvailable = excludeAvailable; }
setExcludeAvailable
286,922
void (Pattern searchPattern) { mySearchPattern = searchPattern; }
setSearchPattern
286,923
Pattern () { return mySearchPattern; }
getSearchPattern
286,924
void (boolean caseSensitive) { myCaseSensitive = caseSensitive; }
setCaseSensitive
286,925
boolean () { return myCaseSensitive; }
isCaseSensitive
286,926
void (boolean preserveCase) { myPreserveCase = preserveCase; }
setPreserveCase
286,927
boolean () { return myPreserveCase; }
isPreserveCase
286,928
void (Pattern replacePattern) { }
setReplacePattern
286,929
void (String replaceString) { myReplaceString = replaceString; }
setReplaceString
286,930
String () { return myReplaceString; }
getReplaceString
286,931
boolean () { return myReplaceMode; }
isReplaceMode
286,932
void (boolean replaceMode) { myReplaceMode = replaceMode; }
setReplaceMode
286,933
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UsageViewPresentation that = (UsageViewPresentation)o; return myCodeUsages == that.myCodeUsages && myDetachedMode == that.myDetachedMode && myMergeDupLinesAvailable == that.myMergeDupLinesAvailable && myOpenInNewTab == that.myOpenInNewTab && myShowCancelButton == that.myShowCancelButton && myShowReadOnlyStatusAsRed == that.myShowReadOnlyStatusAsRed && myUsageTypeFilteringAvailable == that.myUsageTypeFilteringAvailable && myExcludeAvailable == that.myExcludeAvailable && myReplaceMode == that.myReplaceMode && Objects.equals(myCodeUsagesString, that.myCodeUsagesString) && Objects.equals(myDynamicCodeUsagesString, that.myDynamicCodeUsagesString) && Objects.equals(myNonCodeUsagesString, that.myNonCodeUsagesString) && Objects.equals(myScopeText, that.myScopeText) && Objects.equals(myTabName, that.myTabName) && Objects.equals(myTabText, that.myTabText) && Objects.equals(myTargetsNodeText, that.myTargetsNodeText) && Objects.equals(myToolwindowTitle, that.myToolwindowTitle) && Objects.equals(myUsagesString, that.myUsagesString) && Objects.equals(mySearchString, that.mySearchString) && arePatternsEqual(mySearchPattern, that.mySearchPattern) && Objects.equals(myReplaceString, that.myReplaceString); }
equals
286,934
boolean (Pattern p1, Pattern p2) { if (p1 == null) return p2 == null; if (p2 == null) return false; return Objects.equals(p1.pattern(), p2.pattern()) && p1.flags() == p2.flags(); }
arePatternsEqual
286,935
int (Pattern pattern) { if (pattern == null) return 0; String s = pattern.pattern(); return (s != null ? s.hashCode() : 0) * 31 + pattern.flags(); }
getHashCode
286,936
int () { int result = Objects.hash( myTabText, myScopeText, myUsagesString, mySearchString, myTargetsNodeText, myNonCodeUsagesString, myCodeUsagesString, myShowReadOnlyStatusAsRed, myShowCancelButton, myOpenInNewTab, myCodeUsages, myUsageTypeFilteringAvailable, myExcludeAvailable, myTabName, myToolwindowTitle, myDetachedMode, myDynamicCodeUsagesString, myMergeDupLinesAvailable, myReplaceMode, myReplaceString ); result = 31 * result + getHashCode(mySearchPattern); return result; }
hashCode
286,937
UsageViewPresentation () { UsageViewPresentation copyInstance = new UsageViewPresentation(); copyInstance.myTabText = myTabText; copyInstance.myScopeText = myScopeText; copyInstance.myUsagesString = myUsagesString; copyInstance.mySearchString = mySearchString; copyInstance.myTargetsNodeText = myTargetsNodeText; copyInstance.myNonCodeUsagesString = myNonCodeUsagesString; copyInstance.myCodeUsagesString = myCodeUsagesString; copyInstance.myShowReadOnlyStatusAsRed = myShowReadOnlyStatusAsRed; copyInstance.myShowCancelButton = myShowCancelButton; copyInstance.myOpenInNewTab = myOpenInNewTab; copyInstance.myCodeUsages = myCodeUsages; copyInstance.myUsageTypeFilteringAvailable = myUsageTypeFilteringAvailable; copyInstance.myTabName = myTabName; copyInstance.myToolwindowTitle = myToolwindowTitle; copyInstance.myDetachedMode = myDetachedMode; copyInstance.myDynamicCodeUsagesString = myDynamicCodeUsagesString; copyInstance.myMergeDupLinesAvailable = myMergeDupLinesAvailable; copyInstance.myExcludeAvailable = myExcludeAvailable; copyInstance.mySearchPattern = mySearchPattern; copyInstance.myReplaceString = myReplaceString; copyInstance.myReplaceMode = myReplaceMode; return copyInstance; }
copy
286,938
PsiElement (@NotNull PsiElement element) { return EP_NAME.getExtensionList().stream() .map(provider -> provider.getAppropriateParentFrom(element)) .filter(Objects::nonNull) .findFirst() .orElse(null); }
findAppropriateParentFrom
286,939
void (final @NotNull Processor<? super Usage> processor, @NotNull Project project) { final Ref<UsageInfo[]> refUsages = new Ref<>(); final Ref<Boolean> dumbModeOccurred = new Ref<>(); ApplicationManager.getApplication().runReadAction(() -> { try { refUsages.set(findUsages()); } catch (IndexNotReadyException e) { dumbModeOccurred.set(true); } }); if (!dumbModeOccurred.isNull()) { DumbService.getInstance(project).showDumbModeNotificationForFunctionality( UsageViewBundle.message("notification.usage.search.is.not.available.until.indices.are.ready"), DumbModeBlockedFunctionality.UsageInfoSearcherAdapter); return; } final Usage[] usages = ReadAction.compute(() -> UsageInfo2UsageAdapter.convert(refUsages.get())); for (final Usage usage : usages) { ApplicationManager.getApplication().runReadAction(() -> { processor.process(usage); }); } }
processUsages
286,940
Icon () { return myIcon; }
getIcon
286,941
T () { return myElementPointer.getElement(); }
getElement
286,942
String () { return myName; }
getPresentableGroupText
286,943
FileStatus () { return isValid() ? NavigationItemFileStatus.get(getElement()) : null; }
getFileStatus
286,944
boolean () { final T element = getElement(); return element != null && element.isValid(); }
isValid
286,945
boolean () { return isValid(); }
canNavigate
286,946
boolean () { return canNavigate(); }
canNavigateToSource
286,947
int (@NotNull final UsageGroup o) { String name; if (o instanceof NamedPresentably) { name = ((NamedPresentably)o).getPresentableName(); } else { name = o.getPresentableGroupText(); } return myName.compareToIgnoreCase(name); }
compareTo
286,948
boolean (final Object obj) { if (!(obj instanceof PsiElementUsageGroupBase group)) return false; if (isValid() && group.isValid()) { return getElement().getManager().areElementsEquivalent(getElement(), group.getElement()); } return Objects.equals(myName, ((PsiElementUsageGroupBase<?>)obj).myName); }
equals
286,949
int () { return myName.hashCode(); }
hashCode
286,950
String () { return myName; }
getPresentableName
286,951
ChunkExtractor (@NotNull PsiFile file) { return ourExtractors.get().getValue().get(file); }
getExtractor
286,952
int (List<? extends RangeMarker> rangeMarkers) { LOG.assertTrue(!rangeMarkers.isEmpty()); int minStart = Integer.MAX_VALUE; for (RangeMarker rangeMarker : rangeMarkers) { if (!rangeMarker.isValid()) continue; int startOffset = rangeMarker.getStartOffset(); if (startOffset < minStart) minStart = startOffset; } return minStart == Integer.MAX_VALUE ? -1 : minStart; }
getStartOffset
286,953
void (@NotNull UsageInfo2UsageAdapter usageInfo2UsageAdapter, @NotNull CharSequence chars, int start, int end, boolean selectUsageWithBold, @NotNull List<? super @NotNull TextChunk> result) { processTokens(chars, start, end, (startOffset, endOffset, textAttributesKeys) -> { processIntersectingRange(usageInfo2UsageAdapter, chars, startOffset, endOffset, textAttributesKeys, selectUsageWithBold, result); return true; }); }
appendTextChunks
286,954
void (@NotNull CharSequence chars, int start, int end, @NotNull TokenHighlightProcessor tokenHighlightProcessor) { Lexer lexer = myHighlighter.getHighlightingLexer(); SyntaxHighlighterOverEditorHighlighter highlighter = myHighlighter; LOG.assertTrue(start <= end); int i = StringUtil.indexOf(chars, '\n', start, end); if (i != -1) end = i; if (myDocumentStamp != myDocument.getModificationStamp()) { highlighter.restart(chars); myDocumentStamp = myDocument.getModificationStamp(); } else if (lexer.getTokenType() == null || lexer.getTokenStart() > start) { highlighter.resetPosition(0); // todo restart from nearest position with initial state } boolean isBeginning = true; for (; lexer.getTokenType() != null; lexer.advance()) { int hiStart = lexer.getTokenStart(); int hiEnd = lexer.getTokenEnd(); if (hiStart >= end) { break; } hiStart = Math.max(hiStart, start); hiEnd = Math.min(hiEnd, end); if (hiStart >= hiEnd) { continue; } if (isBeginning) { String text = chars.subSequence(hiStart, hiEnd).toString(); if (text.trim().isEmpty()) { continue; } } isBeginning = false; IElementType tokenType = lexer.getTokenType(); TextAttributesKey[] tokenHighlights = highlighter.getTokenHighlights(tokenType); if (!tokenHighlightProcessor.process(hiStart, hiEnd, tokenHighlights)) { return; } } }
processTokens
286,955
void (@NotNull UsageInfo2UsageAdapter usageInfo2UsageAdapter, @NotNull CharSequence chars, int hiStart, int hiEnd, TextAttributesKey @NotNull [] tokenHighlights, boolean selectUsageWithBold, @NotNull List<? super @NotNull TextChunk> result) { TextAttributes originalAttrs = convertAttributes(tokenHighlights); if (selectUsageWithBold) { originalAttrs.setFontType(Font.PLAIN); } int[] lastOffset = {hiStart}; usageInfo2UsageAdapter.processRangeMarkers(segment -> { int usageStart = segment.getStartOffset(); int usageEnd = segment.getEndOffset(); if (rangeIntersect(lastOffset[0], hiEnd, usageStart, usageEnd)) { addChunk(chars, lastOffset[0], Math.max(lastOffset[0], usageStart), originalAttrs, false, result); addChunk(chars, Math.max(lastOffset[0], usageStart), Math.min(hiEnd, usageEnd), originalAttrs, selectUsageWithBold, result); lastOffset[0] = usageEnd; return usageEnd <= hiEnd; } return true; }); if (lastOffset[0] < hiEnd) { addChunk(chars, lastOffset[0], hiEnd, originalAttrs, false, result); } }
processIntersectingRange
286,956
boolean (TextAttributesKey @NotNull ... keys) { for (TextAttributesKey key : keys) { if (key == DefaultLanguageHighlighterColors.DOC_COMMENT || key == DefaultLanguageHighlighterColors.LINE_COMMENT || key == DefaultLanguageHighlighterColors.BLOCK_COMMENT) { return true; } if (key == null) { continue; } TextAttributesKey fallbackAttributeKey = key.getFallbackAttributeKey(); if (fallbackAttributeKey != null && isHighlightedAsComment(fallbackAttributeKey)) { return true; } } return false; }
isHighlightedAsComment
286,957
boolean (TextAttributesKey @NotNull ... keys) { for (TextAttributesKey key : keys) { if (key == DefaultLanguageHighlighterColors.STRING || key == DefaultLanguageHighlighterColors.VALID_STRING_ESCAPE || key == DefaultLanguageHighlighterColors.INVALID_STRING_ESCAPE) { return true; } if (key == null) { continue; } TextAttributesKey fallbackAttributeKey = key.getFallbackAttributeKey(); if (fallbackAttributeKey != null && isHighlightedAsString(fallbackAttributeKey)) { return true; } } return false; }
isHighlightedAsString
286,958
void (@NotNull CharSequence chars, int start, int end, @NotNull TextAttributes originalAttrs, boolean bold, @NotNull List<? super @NotNull TextChunk> result) { if (start < end) { TextAttributes attrs = bold ? TextAttributes.merge(originalAttrs, new TextAttributes(null, null, null, null, Font.BOLD)) : originalAttrs; result.add(new TextChunk(attrs, new String(CharArrayUtil.fromSequence(chars, start, end)))); } }
addChunk
286,959
boolean (int s1, int e1, int s2, int e2) { return s2 < s1 && s1 < e2 || s2 < e1 && e1 < e2 || s1 < s2 && s2 < e1 || s1 < e2 && e2 < e1 || s1 == s2 && e1 == e2; }
rangeIntersect
286,960
TextAttributes (TextAttributesKey @NotNull [] keys) { TextAttributes attrs = myColorsScheme.getAttributes(HighlighterColors.TEXT); for (TextAttributesKey key : keys) { TextAttributes attrs2 = myColorsScheme.getAttributes(key); if (attrs2 != null) { attrs = TextAttributes.merge(attrs, attrs2); } } attrs = attrs.clone(); return attrs; }
convertAttributes
286,961
void (@NotNull List<? super TextChunk> result, int lineNumber) { result.add(new TextChunk(UsageTreeColors.NUMBER_OF_USAGES_ATTRIBUTES.toTextAttributes(), String.valueOf(lineNumber + 1))); }
appendPrefix
286,962
boolean (@NotNull MergeableUsage other) { boolean merged = super.merge(other); if (merged && other instanceof ReadWriteAccessUsageInfo2UsageAdapter) { Access newRwAccess = mergeRwAccess(rwAccess(), ((ReadWriteAccessUsageInfo2UsageAdapter)other).rwAccess()); myRwAccess = (byte)newRwAccess.ordinal(); } return merged; }
merge
286,963
void () { super.reset(); myRwAccess = myInitialRwAccess; }
reset
286,964
Access () { return Access.values()[myRwAccess]; }
rwAccess
286,965
boolean () { return rwAccess() != Access.Read; }
isAccessedForWriting
286,966
boolean () { return rwAccess() != Access.Write; }
isAccessedForReading
286,967
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReadWriteAccessUsageInfo2UsageAdapter adapter = (ReadWriteAccessUsageInfo2UsageAdapter)o; return myInitialRwAccess == adapter.myInitialRwAccess && myRwAccess == adapter.myRwAccess && this.getUsageInfo().equals(((ReadWriteAccessUsageInfo2UsageAdapter)o).getUsageInfo()); }
equals
286,968
int () { return Objects.hash(myInitialRwAccess, myRwAccess, getUsageInfo()); }
hashCode
286,969
Access (@NotNull Access left, @NotNull Access right) { return left == right ? left : Access.ReadWrite; }
mergeRwAccess
286,970
Access (boolean accessedForReading, boolean accessedForWriting) { if (accessedForReading && accessedForWriting) { return Access.ReadWrite; } else if (accessedForReading) { return Access.Read; } else if (accessedForWriting) { return Access.Write; } else { throw new IllegalArgumentException("At least one of 'accessedForReading' or 'accessedForWriting' must be 'true'"); } }
getRwAccess
286,971
List<String> (@NotNull String path1, @NotNull String path2) { List<String> result = new ArrayList<>(); List<String> path1Arr = pathToPathList(path1); List<String> path2Arr = pathToPathList(path2); if (path1Arr.size() > path2Arr.size()) { path1Arr = pathToPathList(path2); path2Arr = pathToPathList(path1); } List<String> arrayList = new ArrayList<>(); for (int i = 0; i < path1Arr.size(); i++) { if (path1Arr.get(i).equals(path2Arr.get(i))) { arrayList.add(path1Arr.get(i)); } else { break; } } if (arrayList.isEmpty()) return arrayList; String commonPath = pathListToPath(arrayList); result.add(commonPath); String rel1 = getRelativePath(path1, commonPath); String rel2 = getRelativePath(path2, commonPath); if (!rel1.isEmpty()) { result.add(rel1); } if (!rel2.isEmpty()) { result.add(rel2); } return result; }
findLongestCommonParent
286,972
List<String> (@NotNull String parentTextOrig) { if (parentTextOrig.contains("!")) { int index = parentTextOrig.indexOf('!'); String zip = parentTextOrig.substring(1, index + 1); String rest = parentTextOrig.substring(index + 1); List<String> subPaths = new ArrayList<>(); subPaths.add(zip); subPaths.addAll(ContainerUtil.filter(rest.split("/"), s -> !s.isEmpty())); return subPaths; } return ContainerUtil.filter(parentTextOrig.split("/"), s -> !s.isEmpty()); }
pathToPathList
286,973
String (@NotNull List<String> textArr) { Optional<String> path = textArr.stream().reduce((s1, s2) -> s1 + "/" + s2); return path.map(s -> "/" + s).orElse(""); }
pathListToPath
286,974
String (@NotNull String fullPath, @NotNull String path) { if (path.length() >= fullPath.length()) { return ""; } return fullPath.substring(path.length()); }
getRelativePath
286,975
boolean (@NotNull List<String> path, @NotNull List<String> path1) { if (path1.size() > path.size()) { return false; } for (int i = 0; i < path1.size(); i++) { if (!path.get(i).equals(path1.get(i))) { return false; } } return true; }
listStartsWith
286,976
boolean () { return myShowNotFoundMessage; }
isShowNotFoundMessage
286,977
void (final boolean showNotFoundMessage) { myShowNotFoundMessage = showNotFoundMessage; }
setShowNotFoundMessage
286,978
boolean () { return myShowPanelIfOnlyOneUsage; }
isShowPanelIfOnlyOneUsage
286,979
void (final boolean showPanelIfOnlyOneUsage) { myShowPanelIfOnlyOneUsage = showPanelIfOnlyOneUsage; }
setShowPanelIfOnlyOneUsage
286,980
Runnable () { return mySearchWithProjectFiles; }
searchIncludingProjectFileUsages
286,981
void (@NotNull Runnable searchWithProjectFiles) { mySearchWithProjectFiles = searchWithProjectFiles; }
projectFileUsagesFound
286,982
void (@NotNull Collection<VirtualFile> largeFiles) { myLargeFiles = largeFiles; }
setLargeFilesWereNotScanned
286,983
Collection<VirtualFile> () { return myLargeFiles == null ? Collections.emptyList() : myLargeFiles; }
getLargeFiles
286,984
boolean () { return myShowFindOptionsPrompt; }
isShowFindOptionsPrompt
286,985
UsageViewPresentation () { return myUsageViewPresentation; }
getUsageViewPresentation
286,986
void (boolean showFindOptionsPrompt) { myShowFindOptionsPrompt = showFindOptionsPrompt; }
setShowFindOptionsPrompt
286,987
void (boolean canceled) { myCanceled = canceled; }
setCanceled
286,988
boolean () { return myCanceled; }
isCanceled
286,989
TextAttributes () { return TextAttributes.fromFlyweight(myAttributes); }
getAttributes
286,990
String () { return getText(); }
toString
286,991
UsageType () { return null; }
getType
286,992
SimpleTextAttributes () { SimpleTextAttributes simples = SimpleTextAttributes.fromTextAttributes(getAttributes()); simples = new SimpleTextAttributes(null, simples.getFgColor(), simples.getWaveColor(), simples.getStyle()); return simples; }
getSimpleAttributesIgnoreBackground
286,993
TextAttributes () { return UsageTreeColorsScheme.getInstance().getScheme().getAttributes(HighlighterColors.TEXT); }
defaultAttributes
286,994
Object (@NotNull TextChunk @NotNull [] chunks) { return replaceDefaultAttributeChunksWithStrings(compactSequentialChunksWithSameAttributes(chunks)); }
compact
286,995
Object (@NotNull List<@NotNull TextChunk> chunks) { AttributesFlyweight defaultFlyweight = defaultAttributes().getFlyweight(); if (ContainerUtil.and(chunks, chunk -> !chunk.myAttributes.equals(defaultFlyweight))) { return chunks.size() == 1 ? chunks.get(0) // TextChunk : chunks.toArray(EMPTY_ARRAY); // TextChunk[] with non-default attributes } List<Object> result = ContainerUtil.map(chunks, chunk -> chunk.myAttributes.equals(defaultFlyweight) ? chunk.myText : chunk); return result.size() == 1 ? result.get(0) // String : ArrayUtil.toObjectArray(result); // Object[] with String or TextChunk elements }
replaceDefaultAttributeChunksWithStrings
286,996
CompletableFuture<UsageInfo[]> () { return CompletableFuture.completedFuture(getMergedInfos()); }
getMergedInfosAsync
286,997
int (@NotNull Document document, int startOffset) { if (document.getTextLength() == 0) return 0; if (startOffset >= document.getTextLength()) return document.getLineCount(); return document.getLineNumber(startOffset); }
getLineNumber
286,998
Color () { VirtualFile file = getFile(); if (file == null) { return null; } return EditorTabPresentationUtil.getFileBackgroundColor(getProject(), file); }
computeBackgroundColor
286,999
UsagePresentation () { return this; }
getPresentation