Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
289,100
IElementType (@Nullable ASTNode node) { return node == null ? null : node.getElementType(); }
getElementType
289,101
IElementType (@Nullable PsiElement element) { return element == null ? null : element instanceof StubBasedPsiElement ? ((StubBasedPsiElement<?>)element).getElementType() : element instanceof PsiFile ? ((PsiFile)element).getFileElementType() : getElementType(element.getNode()); }
getElementType
289,102
FileASTNode () { throw createException(); }
getNode
289,103
PsiDirectory () { throw createException(); }
getParent
289,104
VirtualFile () { throw createException(); }
getVirtualFile
289,105
PsiDirectory () { throw createException(); }
getContainingDirectory
289,106
long () { throw createException(); }
getModificationStamp
289,107
PsiFile () { throw createException(); }
getOriginalFile
289,108
FileType () { throw createException(); }
getFileType
289,109
FileViewProvider () { throw createException(); }
getViewProvider
289,110
void () { throw createException(); }
subtreeChanged
289,111
boolean () { throw createException(); }
isDirectory
289,112
String () { throw createException(); }
getName
289,113
boolean (@NotNull PsiElementProcessor<? super PsiFileSystemItem> processor) { throw createException(); }
processChildren
289,114
void (boolean requestFocus) { throw createException(); }
navigate
289,115
boolean () { throw createException(); }
canNavigate
289,116
boolean () { throw createException(); }
canNavigateToSource
289,117
String () { return "NULL_PSI_FILE"; }
toString
289,118
T (@NotNull H h) { T result = getCachedValueOrNull(h); if (result != null) { return result; } result = myFunction.fun(h); final long count = getModificationCount(h); h.putUserData(this, new SoftReference<>(new Pair<>(count, result))); return result; }
getValue
289,119
long (@NotNull PsiElement element) { PsiFile file = element.getContainingFile(); long nonPhysicalStamp = file == null || file.isPhysical() ? 0 : file.getModificationStamp(); PsiElement root = file != null ? file : element; return nonPhysicalStamp + root.getManager().getModificationTracker().getModificationCount(); }
getModificationCount
289,120
boolean () { return ourGlobalContext.consumer != null; }
isProfiling
289,121
void () { ThreadContext context = ourContext.get(); places.clear(); if (context.topFrame != this) { LOG.warn("unexpected frame: " + (context.topFrame == null ? "null" : context.topFrame.id) + ", expected: " + id , new Throwable()); } context.topFrame = parent; if (parent == null) { ourContext.remove(); // also releases ThreadContext.consumer reference } if (context.consumer == null || context.epoch != ourGlobalContext.epoch) return; context.consumer.onFrameExit(id, start, timeComputed, currentTime()); long cur = currentTime(); ourFrameOverhead.total.addAndGet(cur - start); if (timeComputed != 0) { ourFrameOverhead.overhead.addAndGet(cur - timeComputed); } }
close
289,122
Frame () { return new Frame(); }
newFrame
289,123
void (@NotNull CachedValueProvider.Result<?> result, @Nullable Object original) { long time = currentTime(); ThreadContext context = ourContext.get(); if (context.consumer == null || context.epoch != ourGlobalContext.epoch) return; Frame frame = context.topFrame; if (frame == null) return; EventPlace place = original == null ? place(CachedValueProfiler::findComputationPlace) : original instanceof CachedValueProvider.Result ? frame.places.get(original) : original instanceof Function ? place(CachedValueProfiler::findCallerPlace) : null; if (place == null) return; frame.places.put(result, place); ourFrameOverhead.overhead.addAndGet(currentTime() - time); }
onResultCreated
289,124
EventPlace (Function<? super Throwable, ? extends StackTraceElement> function) { // Use async stack trace processing to reduce overhead. // Both plain Throwable#getStackTrace and StackWalker API are slower. Throwable throwable = new Throwable(); return new EventPlace() { @Override public StackTraceElement getStackFrame() { return function.apply(throwable); } @Override public StackTraceElement @Nullable [] getStackTrace() { return throwable.getStackTrace(); } }; }
place
289,125
StackTraceElement () { return function.apply(throwable); }
getStackFrame
289,126
StackTraceElement (Throwable stackTraceHolder) { StackTraceElement[] stackTrace = stackTraceHolder.getStackTrace(); for (int idx = 2, len = stackTrace.length; idx < len; idx++) { String className = stackTrace[idx].getClassName(); if (className.startsWith("com.intellij.util.CachedValue")) continue; if (className.startsWith("com.intellij.psi.util.CachedValue")) continue; if (className.startsWith("com.intellij.psi.impl.PsiCachedValue")) continue; if (className.startsWith("com.intellij.openapi.util.Recursion")) continue; if (className.startsWith("com.intellij.psi.impl.PsiParameterizedCachedValue")) continue; return stackTrace[idx]; } return new StackTraceElement("unknown", "unknown", "", -1); }
findCallerPlace
289,127
long () { return System.nanoTime(); }
currentTime
289,128
void () { long time = currentTime(); ThreadContext context = ourContext.get(); if (context.consumer == null || context.epoch != ourGlobalContext.epoch) return; if (epoch != context.epoch) return; context.consumer.onValueInvalidated(context.topFrame == null ? 0 : context.topFrame.id, place, used, time); ourTrackerOverhead.overhead.addAndGet(currentTime() - time); }
onValueInvalidated
289,129
void () { long time = currentTime(); used = time; ThreadContext context = ourContext.get(); if (context.consumer == null || context.epoch != ourGlobalContext.epoch) return; if (epoch != context.epoch) return; context.consumer.onValueUsed(context.topFrame == null ? 0 : context.topFrame.id, place, computed, time); ourTrackerOverhead.count.incrementAndGet(); ourTrackerOverhead.overhead.addAndGet(currentTime() - time); }
onValueUsed
289,130
void () { long time = currentTime(); ThreadContext context = ourContext.get(); if (context.consumer == null || context.epoch != ourGlobalContext.epoch) return; if (epoch != context.epoch) return; context.consumer.onValueRejected(context.topFrame == null ? 0 : context.topFrame.id, place, start, computed, time); ourTrackerOverhead.overhead.addAndGet(currentTime() - time); }
onValueRejected
289,131
CachedValuesManager (@NotNull Project project) { return project.getService(CachedValuesManager.class); }
getManager
289,132
String () { return provider.toString(); }
toString
289,133
int () { int hashCode = myHashCode; if (hashCode == 0) { // benign race myHashCode = hashCode = calcHashCode(); } return hashCode; }
hashCode
289,134
int () { return myDefaultHashCode; }
calcHashCode
289,135
boolean (@NotNull SearchScope scope) { return scope == GlobalSearchScope.EMPTY_SCOPE || scope == LocalSearchScope.EMPTY; }
isEmptyScope
289,136
String () { return getNameText(); }
getDisplayName
289,137
boolean (final @NotNull VirtualFile file) { return true; }
contains
289,138
boolean () { return true; }
isSearchInLibraries
289,139
boolean () { return true; }
isForceSearchingInLibrarySources
289,140
boolean (final @NotNull Module aModule) { return true; }
isSearchInModuleContent
289,141
Collection<UnloadedModuleDescription> () { Project project = getProject(); return project != null ? FileIndexFacade.getInstance(project).getUnloadedModuleDescriptions() : Collections.emptySet(); }
getUnloadedModulesBelongingToScope
289,142
GlobalSearchScope (@NotNull SearchScope scope) { return this; }
union
289,143
SearchScope (@NotNull SearchScope scope2) { return scope2; }
intersectWith
289,144
boolean () { return myIgnoreInjectedPsi; }
isIgnoreInjectedPsi
289,145
String () { return myDisplayName == null ? super.getDisplayName() : myDisplayName; }
getDisplayName
289,146
boolean (Object o) { if (this == o) return true; if (!(o instanceof LocalSearchScope)) return false; LocalSearchScope other = (LocalSearchScope)o; if (other.myIgnoreInjectedPsi != myIgnoreInjectedPsi) return false; if (other.myScope.length != myScope.length) return false; if (!Comparing.strEqual(myDisplayName, other.myDisplayName)) { return false; // scopes like "Current file" and "Changed files" should be different even if empty } for (PsiElement scopeElement : myScope) { for (PsiElement thatScopeElement : other.myScope) { if (!Comparing.equal(scopeElement, thatScopeElement)) return false; } } return true; }
equals
289,147
int () { int result = 0; result += myIgnoreInjectedPsi ? 1 : 0; for (PsiElement element : myScope) { result += element.hashCode(); } return result; }
calcHashCode
289,148
LocalSearchScope (@NotNull LocalSearchScope scope2) { if (equals(scope2)) return this; return intersection(this, scope2); }
intersectWith
289,149
LocalSearchScope (@NotNull LocalSearchScope scope1, @NotNull LocalSearchScope scope2) { List<PsiElement> result = new ArrayList<>(); for (PsiElement element1 : scope1.myScope) { for (PsiElement element2 : scope2.myScope) { PsiElement element = intersectScopeElements(element1, element2); if (element != null) { result.add(element); } } } return new LocalSearchScope(PsiUtilCore.toPsiElementArray(result), null, scope1.myIgnoreInjectedPsi || scope2.myIgnoreInjectedPsi); }
intersection
289,150
SearchScope (@NotNull SearchScope scope2) { if (scope2 instanceof LocalSearchScope) { return intersectWith((LocalSearchScope)scope2); } LocalSearchScope nonPhysicalScope = tryIntersectNonPhysicalWith((GlobalSearchScope)scope2); if (nonPhysicalScope != null) return nonPhysicalScope; return ((GlobalSearchScope)scope2).intersectWith(this); }
intersectWith
289,151
String () { return Arrays.stream(myScope).map(String::valueOf).collect(Collectors.joining(", ", "LocalSearchScope: [", "]")); }
toString
289,152
SearchScope (@NotNull SearchScope scope) { if (scope instanceof LocalSearchScope) return union((LocalSearchScope)scope); return ((GlobalSearchScope)scope).union(this); }
union
289,153
boolean (@NotNull VirtualFile file) { return isInScope(file); }
contains
289,154
SearchScope (@NotNull LocalSearchScope scope2) { if (equals(scope2)) return this; PsiElement[] elements1 = getScope(); PsiElement[] elements2 = scope2.getScope(); boolean[] united = new boolean[elements2.length]; List<PsiElement> result = new ArrayList<>(); loop1: for (PsiElement element1 : elements1) { for (int j = 0; j < elements2.length; j++) { PsiElement element2 = elements2[j]; PsiElement unionElement = scopeElementsUnion(element1, element2); if (unionElement != null && unionElement.getContainingFile() != null) { result.add(unionElement); united[j] = true; break loop1; } } result.add(element1); } for (int i = 0; i < united.length; i++) { boolean b = united[i]; if (!b) { result.add(elements2[i]); } } return new LocalSearchScope(PsiUtilCore.toPsiElementArray(result)); }
union
289,155
PsiElement (@NotNull PsiElement element1, @NotNull PsiElement element2) { if (PsiTreeUtil.isAncestor(element1, element2, false)) return element1; if (PsiTreeUtil.isAncestor(element2, element1, false)) return element2; return PsiTreeUtil.findCommonParent(element1, element2); }
scopeElementsUnion
289,156
boolean (@NotNull VirtualFile file) { return ArrayUtil.indexOf(myVirtualFiles, file) != -1; }
isInScope
289,157
boolean (@NotNull PsiFile file, @NotNull TextRange range) { for (PsiElement element : getScope()) { if (file == element.getContainingFile() && element.getTextRange().contains(range)) { return true; } } return false; }
containsRange
289,158
LocalSearchScope (@NotNull LocalSearchScope scope, FileType @NotNull ... fileTypes) { if (fileTypes.length == 0) throw new IllegalArgumentException("empty fileTypes"); if (scope == EMPTY) { return EMPTY; } return ReadAction.compute(() -> { PsiElement[] elements = scope.getScope(); List<PsiElement> result = new ArrayList<>(elements.length); for (PsiElement element : elements) { PsiFile containingFile = element.getContainingFile(); FileType fileType = containingFile.getFileType(); if (ArrayUtil.contains(fileType, fileTypes)) { result.add(element); } } return result.isEmpty() ? EMPTY : new LocalSearchScope(PsiUtilCore.toPsiElementArray(result), scope.getDisplayName(), scope.isIgnoreInjectedPsi()); }); }
getScopeRestrictedByFileTypes
289,159
LocalSearchScope (@NotNull LocalSearchScope scope, @NotNull LanguageMatcher matcher) { if (scope == EMPTY) { return EMPTY; } return ReadAction.compute(() -> { List<PsiElement> result = ContainerUtil.filter( scope.getScope(), element -> matcher.matchesLanguage(element.getContainingFile().getLanguage()) ); return result.isEmpty() ? EMPTY : new LocalSearchScope(PsiUtilCore.toPsiElementArray(result), scope.getDisplayName(), scope.isIgnoreInjectedPsi()); }); }
getScopeRestrictedByFileLanguage
289,160
GlobalSearchScope (@NotNull List<? extends VirtualFile> roots) { if (roots.isEmpty()) { return EMPTY_SCOPE; } return new NonClasspathDirectoriesScope(roots); }
compose
289,161
boolean (@NotNull VirtualFile file) { return VfsUtilCore.isUnder(file, myRoots); }
contains
289,162
boolean (@NotNull Module aModule) { return false; }
isSearchInModuleContent
289,163
boolean () { return false; }
isSearchInLibraries
289,164
boolean (Object o) { if (this == o) return true; if (!(o instanceof NonClasspathDirectoriesScope)) return false; NonClasspathDirectoriesScope that = (NonClasspathDirectoriesScope)o; if (!myRoots.equals(that.myRoots)) return false; return true; }
equals
289,165
int () { return myRoots.hashCode(); }
calcHashCode
289,166
String () { if (myRoots.size() == 1) { VirtualFile root = myRoots.iterator().next(); return CoreBundle.message("scope.display.name.directory.0", root.getName()); } return CoreBundle.message("scope.display.name.directories.0", StringUtil.join(myRoots, file -> "'" + file.getName() + "'", ", ")); }
getDisplayName
289,167
int (@NotNull VirtualFile file1, @NotNull VirtualFile file2) { return 0; }
compare
289,168
boolean (@NotNull Module aModule, boolean testSources) { return isSearchInModuleContent(aModule); }
isSearchInModuleContent
289,169
boolean (@NotNull VirtualFile file) { return contains(file); }
accept
289,170
boolean () { return false; }
isForceSearchingInLibrarySources
289,171
Collection<UnloadedModuleDescription> () { return Collections.emptySet(); }
getUnloadedModulesBelongingToScope
289,172
GlobalSearchScope (@NotNull GlobalSearchScope scope) { if (scope == this) return this; if (scope instanceof IntersectionScope && ((IntersectionScope)scope).containsScope(this)) { return scope; } return new IntersectionScope(this, scope); }
intersectWith
289,173
SearchScope (@NotNull SearchScope scope2) { if (scope2 instanceof LocalSearchScope) { return intersectWith((LocalSearchScope)scope2); } return intersectWith((GlobalSearchScope)scope2); }
intersectWith
289,174
LocalSearchScope (@NotNull LocalSearchScope localScope2) { PsiElement[] elements2 = localScope2.getScope(); List<PsiElement> result = new ArrayList<>(elements2.length); for (final PsiElement element2 : elements2) { if (PsiSearchScopeUtil.isInScope(this, element2)) { result.add(element2); } } return result.isEmpty() ? LocalSearchScope.EMPTY : new LocalSearchScope(result.toArray(PsiElement.EMPTY_ARRAY), null, localScope2.isIgnoreInjectedPsi()); }
intersectWith
289,175
GlobalSearchScope (@NotNull SearchScope scope) { if (scope instanceof GlobalSearchScope) return uniteWith((GlobalSearchScope)scope); return union((LocalSearchScope)scope); }
union
289,176
GlobalSearchScope (final @NotNull LocalSearchScope scope) { PsiElement[] localScopeElements = scope.getScope(); if (localScopeElements.length == 0) { return this; } return new GlobalSearchScope(localScopeElements[0].getProject()) { @Override public boolean contains(@NotNull VirtualFile file) { return GlobalSearchScope.this.contains(file) || scope.isInScope(file); } @Override public int compare(@NotNull VirtualFile file1, @NotNull VirtualFile file2) { return GlobalSearchScope.this.contains(file1) && GlobalSearchScope.this.contains(file2) ? GlobalSearchScope.this.compare(file1, file2) : 0; } @Override public boolean isSearchInModuleContent(@NotNull Module aModule) { return GlobalSearchScope.this.isSearchInModuleContent(aModule); } @Override public boolean isSearchInLibraries() { return GlobalSearchScope.this.isSearchInLibraries(); } @Override public @NotNull Collection<UnloadedModuleDescription> getUnloadedModulesBelongingToScope() { return GlobalSearchScope.this.getUnloadedModulesBelongingToScope(); } @Override public @NonNls String toString() { return "UnionToLocal: (" + GlobalSearchScope.this + ", " + scope + ")"; } }; }
union
289,177
boolean (@NotNull VirtualFile file) { return GlobalSearchScope.this.contains(file) || scope.isInScope(file); }
contains
289,178
int (@NotNull VirtualFile file1, @NotNull VirtualFile file2) { return GlobalSearchScope.this.contains(file1) && GlobalSearchScope.this.contains(file2) ? GlobalSearchScope.this.compare(file1, file2) : 0; }
compare
289,179
boolean (@NotNull Module aModule) { return GlobalSearchScope.this.isSearchInModuleContent(aModule); }
isSearchInModuleContent
289,180
boolean () { return GlobalSearchScope.this.isSearchInLibraries(); }
isSearchInLibraries
289,181
Collection<UnloadedModuleDescription> () { return GlobalSearchScope.this.getUnloadedModulesBelongingToScope(); }
getUnloadedModulesBelongingToScope
289,182
GlobalSearchScope (@NotNull GlobalSearchScope scope) { return UnionScope.create(new GlobalSearchScope[]{this, scope}); }
uniteWith
289,183
GlobalSearchScope (@NotNull Collection<? extends GlobalSearchScope> scopes) { if (scopes.isEmpty()) { throw new IllegalArgumentException("Empty scope collection"); } if (scopes.size() == 1) { return scopes.iterator().next(); } return UnionScope.create(scopes.toArray(EMPTY_ARRAY)); }
union
289,184
GlobalSearchScope (GlobalSearchScope @NotNull [] scopes) { if (scopes.length == 0) { throw new IllegalArgumentException("Empty scope array"); } if (scopes.length == 1) { return scopes[0]; } return UnionScope.create(scopes); }
union
289,185
GlobalSearchScope (@NotNull Project project) { return ProjectScope.getAllScope(project); }
allScope
289,186
GlobalSearchScope (@NotNull Project project) { return ProjectScope.getProjectScope(project); }
projectScope
289,187
GlobalSearchScope (@NotNull Project project) { return ProjectScope.getEverythingScope(project); }
everythingScope
289,188
GlobalSearchScope (final @NotNull GlobalSearchScope scope) { return new NotScope(scope); }
notScope
289,189
boolean (@NotNull VirtualFile file) { return !myBaseScope.contains(file); }
contains
289,190
boolean () { return true; // not (in library A) is perfectly fine to find classes in another library B. }
isSearchInLibraries
289,191
boolean (@NotNull Module aModule, boolean testSources) { return true; // not (some files in module A) is perfectly fine to find classes in another part of module A. }
isSearchInModuleContent
289,192
boolean (@NotNull Module aModule) { return true; // not (some files in module A) is perfectly fine to find classes in another part of module A. }
isSearchInModuleContent
289,193
String () { return "NOT: (" + myBaseScope + ")"; }
toString
289,194
GlobalSearchScope (@NotNull Module module) { return module.getModuleScope(); }
moduleScope
289,195
GlobalSearchScope (@NotNull Module module) { return module.getModuleWithLibrariesScope(); }
moduleWithLibrariesScope
289,196
GlobalSearchScope (@NotNull Module module) { return module.getModuleWithDependenciesScope(); }
moduleWithDependenciesScope
289,197
GlobalSearchScope (@NotNull Module module, final boolean includeTests) { return module.getModuleRuntimeScope(includeTests); }
moduleRuntimeScope
289,198
GlobalSearchScope (@NotNull Module module) { return moduleWithDependenciesAndLibrariesScope(module, true); }
moduleWithDependenciesAndLibrariesScope
289,199
GlobalSearchScope (@NotNull Module module, boolean includeTests) { return module.getModuleWithDependenciesAndLibrariesScope(includeTests); }
moduleWithDependenciesAndLibrariesScope