Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
289,200
GlobalSearchScope (@NotNull Module module) { return module.getModuleWithDependentsScope(); }
moduleWithDependentsScope
289,201
GlobalSearchScope (@NotNull Module module) { return module.getModuleTestsWithDependentsScope(); }
moduleTestsWithDependentsScope
289,202
GlobalSearchScope (@NotNull PsiFile psiFile) { VirtualFile virtualFile = psiFile.getVirtualFile(); return new FileScope(psiFile.getProject(), virtualFile != null ? BackedVirtualFile.getOriginFileIfBacked(virtualFile) : null, null); }
fileScope
289,203
GlobalSearchScope (@NotNull Project project, final @Nullable VirtualFile virtualFile) { return fileScope(project, virtualFile, null); }
fileScope
289,204
GlobalSearchScope (@NotNull Project project, @Nullable VirtualFile virtualFile, final @Nullable @Nls String displayName) { return new FileScope(project, virtualFile, displayName); }
fileScope
289,205
GlobalSearchScope (@NotNull Project project, @NotNull Collection<? extends VirtualFile> files) { return filesScope(project, files, null); }
filesScope
289,206
GlobalSearchScope (@NotNull Project project, @NotNull Supplier<? extends Collection<? extends VirtualFile>> files) { return new LazyFilesScope(project, files); }
filesScope
289,207
GlobalSearchScope (@NotNull Project project, @NotNull Collection<? extends VirtualFile> files) { if (files.isEmpty()) return EMPTY_SCOPE; return new FilesScope(project, files, false); }
filesWithoutLibrariesScope
289,208
GlobalSearchScope (@NotNull Project project, @NotNull Collection<? extends VirtualFile> files) { if (files.isEmpty()) return EMPTY_SCOPE; return new FilesScope(project, files, true); }
filesWithLibrariesScope
289,209
GlobalSearchScope (@NotNull Project project, @NotNull Collection<? extends VirtualFile> files, final @Nullable @Nls String displayName) { if (files.isEmpty()) return EMPTY_SCOPE; return files.size() == 1? fileScope(project, files.iterator().next(), displayName) : new FilesScope(project, files) { @Override public @NotNull String getDisplayName() { return displayName == null ? super.getDisplayName() : displayName; } }; }
filesScope
289,210
String () { return displayName == null ? super.getDisplayName() : displayName; }
getDisplayName
289,211
GlobalSearchScope (@NotNull GlobalSearchScope scope) { return containsScope(scope) ? this : new IntersectionScope(this, scope); }
intersectWith
289,212
boolean (@NotNull GlobalSearchScope scope) { if (myScope1.equals(scope) || myScope2.equals(scope) || equals(scope)) return true; if (myScope1 instanceof IntersectionScope && ((IntersectionScope)myScope1).containsScope(scope)) return true; return myScope2 instanceof IntersectionScope && ((IntersectionScope)myScope2).containsScope(scope); }
containsScope
289,213
String () { return CoreBundle.message("psi.search.scope.intersection", myScope1.getDisplayName(), myScope2.getDisplayName()); }
getDisplayName
289,214
boolean (@NotNull VirtualFile file) { return myScope1.contains(file) && myScope2.contains(file); }
contains
289,215
int (@NotNull VirtualFile file1, @NotNull VirtualFile file2) { int res1 = myScope1.compare(file1, file2); int res2 = myScope2.compare(file1, file2); if (res1 == 0) return res2; if (res2 == 0) return res1; if (res1 > 0 == res2 > 0) return res1; return 0; }
compare
289,216
boolean (@NotNull Module aModule) { return myScope1.isSearchInModuleContent(aModule) && myScope2.isSearchInModuleContent(aModule); }
isSearchInModuleContent
289,217
boolean (final @NotNull Module aModule, final boolean testSources) { return myScope1.isSearchInModuleContent(aModule, testSources) && myScope2.isSearchInModuleContent(aModule, testSources); }
isSearchInModuleContent
289,218
boolean () { return myScope1.isSearchInLibraries() && myScope2.isSearchInLibraries(); }
isSearchInLibraries
289,219
Collection<UnloadedModuleDescription> () { return ContainerUtil.intersection(myScope1.getUnloadedModulesBelongingToScope(), myScope2.getUnloadedModulesBelongingToScope()); }
getUnloadedModulesBelongingToScope
289,220
boolean (Object o) { if (this == o) return true; if (!(o instanceof IntersectionScope)) return false; IntersectionScope that = (IntersectionScope)o; return myScope1.equals(that.myScope1) && myScope2.equals(that.myScope2); }
equals
289,221
int () { return 31 * myScope1.hashCode() + myScope2.hashCode(); }
calcHashCode
289,222
GlobalSearchScope (GlobalSearchScope @NotNull [] scopes) { if (scopes.length == 2) { GlobalSearchScope unionScope = tryCreateUnionFor2Scopes(scopes); if (unionScope != null) return unionScope; } Set<GlobalSearchScope> result = new HashSet<>(scopes.length); Project project = null; for (GlobalSearchScope scope : scopes) { if (scope == EMPTY_SCOPE) continue; Project scopeProject = scope.getProject(); if (scopeProject != null) project = scopeProject; if (scope instanceof UnionScope) { ContainerUtil.addAll(result, ((UnionScope)scope).myScopes); } else { result.add(scope); } } if (result.isEmpty()) return EMPTY_SCOPE; if (result.size() == 1) return result.iterator().next(); return new UnionScope(project, result.toArray(EMPTY_ARRAY)); }
create
289,223
GlobalSearchScope (GlobalSearchScope scope0, GlobalSearchScope scope1, Project project) { GlobalSearchScope[] scopes0 = ((UnionScope)scope0).myScopes; if (ArrayUtil.contains(scope1, scopes0)) { return scope0; } else { return new UnionScope(project, ArrayUtil.append(scopes0, scope1)); } }
unionWithUnionScope
289,224
String () { return CoreBundle.message("psi.search.scope.union", myScopes[0].getDisplayName(), myScopes[1].getDisplayName()); }
getDisplayName
289,225
boolean (final @NotNull VirtualFile file) { return ContainerUtil.find(myScopes, scope -> scope.contains(file)) != null; }
contains
289,226
Collection<UnloadedModuleDescription> () { Set<UnloadedModuleDescription> result = new LinkedHashSet<>(); for (GlobalSearchScope scope : myScopes) { result.addAll(scope.getUnloadedModulesBelongingToScope()); } return result; }
getUnloadedModulesBelongingToScope
289,227
int (final @NotNull VirtualFile file1, final @NotNull VirtualFile file2) { final int[] result = {0}; ContainerUtil.process(myScopes, scope -> { // ignore irrelevant scopes - they don't know anything about the files if (!scope.contains(file1) || !scope.contains(file2)) return true; int cmp = scope.compare(file1, file2); if (result[0] == 0) { result[0] = cmp; return true; } if (cmp == 0) { return true; } if (result[0] > 0 == cmp > 0) { return true; } // scopes disagree about the order - abort the voting result[0] = 0; return false; }); return result[0]; }
compare
289,228
boolean (final @NotNull Module module) { return ContainerUtil.find(myScopes, scope -> scope.isSearchInModuleContent(module)) != null; }
isSearchInModuleContent
289,229
boolean (final @NotNull Module module, final boolean testSources) { return ContainerUtil.find(myScopes, scope -> scope.isSearchInModuleContent(module, testSources)) != null; }
isSearchInModuleContent
289,230
boolean () { return ContainerUtil.find(myScopes, GlobalSearchScope::isSearchInLibraries) != null; }
isSearchInLibraries
289,231
boolean (Object o) { if (this == o) return true; if (!(o instanceof UnionScope)) return false; UnionScope that = (UnionScope)o; return ContainerUtil.newHashSet(myScopes).equals(ContainerUtil.newHashSet(that.myScopes)); }
equals
289,232
int () { return Arrays.hashCode(myScopes); }
calcHashCode
289,233
GlobalSearchScope (@NotNull GlobalSearchScope scope) { if (scope instanceof UnionScope) { GlobalSearchScope[] newScopes = ArrayUtil.mergeArrays(myScopes, ((UnionScope)scope).myScopes); return create(newScopes); } return super.uniteWith(scope); }
uniteWith
289,234
GlobalSearchScope (@NotNull GlobalSearchScope scope, FileType @NotNull ... fileTypes) { if (scope == EMPTY_SCOPE) { return EMPTY_SCOPE; } if (fileTypes.length == 0) throw new IllegalArgumentException("empty fileTypes"); return new FileTypeRestrictionScope(scope, fileTypes); }
getScopeRestrictedByFileTypes
289,235
boolean (@NotNull VirtualFile file) { if (!super.contains(file)) return false; for (FileType otherFileType : myFileTypes) { if (FileTypeRegistry.getInstance().isFileOfType(file, otherFileType)) return true; } return false; }
contains
289,236
GlobalSearchScope (@NotNull GlobalSearchScope scope) { if (scope instanceof FileTypeRestrictionScope) { FileTypeRestrictionScope restrict = (FileTypeRestrictionScope)scope; if (restrict.myBaseScope == myBaseScope) { List<FileType> intersection = new ArrayList<>(Arrays.asList(restrict.myFileTypes)); intersection.retainAll(Arrays.asList(myFileTypes)); return new FileTypeRestrictionScope(myBaseScope, intersection.toArray(FileType.EMPTY_ARRAY)); } } return super.intersectWith(scope); }
intersectWith
289,237
GlobalSearchScope (@NotNull GlobalSearchScope scope) { if (scope instanceof FileTypeRestrictionScope) { FileTypeRestrictionScope restrict = (FileTypeRestrictionScope)scope; if (restrict.myBaseScope == myBaseScope) { return new FileTypeRestrictionScope(myBaseScope, ArrayUtil.mergeArrays(myFileTypes, restrict.myFileTypes)); } } return super.uniteWith(scope); }
uniteWith
289,238
boolean (Object o) { if (this == o) return true; if (!(o instanceof FileTypeRestrictionScope)) return false; if (!super.equals(o)) return false; FileTypeRestrictionScope that = (FileTypeRestrictionScope)o; return Arrays.equals(myFileTypes, that.myFileTypes); }
equals
289,239
int () { int result = super.calcHashCode(); result = 31 * result + Arrays.hashCode(myFileTypes); return result; }
calcHashCode
289,240
String () { return "Restricted by file types: " + Arrays.asList(myFileTypes) + " in (" + myBaseScope + ")"; }
toString
289,241
boolean (@NotNull VirtualFile file) { return false; }
contains
289,242
boolean (@NotNull Module aModule) { return false; }
isSearchInModuleContent
289,243
boolean () { return false; }
isSearchInLibraries
289,244
GlobalSearchScope (final @NotNull GlobalSearchScope scope) { return this; }
intersectWith
289,245
GlobalSearchScope (final @NotNull GlobalSearchScope scope) { return scope; }
uniteWith
289,246
String () { return "EMPTY"; }
toString
289,247
Collection<VirtualFile> () { return Collections.singleton(myVirtualFile); }
getFilesIfCollection
289,248
boolean (@NotNull VirtualFile file) { return Comparing.equal(myVirtualFile, file); }
contains
289,249
boolean (@NotNull Module aModule) { return aModule == myModule; }
isSearchInModuleContent
289,250
boolean () { return myModule == null; }
isSearchInLibraries
289,251
String () { return "File: " + myVirtualFile; }
toString
289,252
String () { return myDisplayName != null ? myDisplayName : super.getDisplayName(); }
getDisplayName
289,253
boolean (Object o) { if (this == o) return true; if (o == null || o.getClass() != getClass()) return false; FileScope files = (FileScope)o; return Objects.equals(myVirtualFile, files.myVirtualFile) && Objects.equals(myDisplayName, files.myDisplayName) && Objects.equals(myModule, files.myModule); }
equals
289,254
int () { return Objects.hash(myVirtualFile, myModule, myDisplayName); }
calcHashCode
289,255
boolean (int fileId) { return myVirtualFile instanceof VirtualFileWithId && ((VirtualFileWithId)myVirtualFile).getId() == fileId; }
contains
289,256
boolean (final @NotNull VirtualFile file) { return getFiles().contains(file); }
contains
289,257
boolean (@NotNull Module aModule) { return true; }
isSearchInModuleContent
289,258
boolean () { return hasFilesOutOfProjectRoots(); }
isSearchInLibraries
289,259
boolean (Object o) { return this == o || o instanceof AbstractFilesScope && getFiles().equals(((AbstractFilesScope)o).getFiles()); }
equals
289,260
int () { return getFiles().hashCode(); }
calcHashCode
289,261
boolean () { Boolean result = myHasFilesOutOfProjectRoots; if (result == null) { Project project = getProject(); myHasFilesOutOfProjectRoots = result = project != null && !project.isDefault() && ContainerUtil.find(getFiles(), file -> FileIndexFacade.getInstance(project).getModuleForFile(file) != null) == null; } return result; }
hasFilesOutOfProjectRoots
289,262
boolean (int fileId) { return ((VirtualFileSetEx)getFiles()).containsId(fileId); }
contains
289,263
VirtualFileSet () { return myFiles; }
getFiles
289,264
String () { return "Files: [" + StringUtil.join(myFiles, ", ") + "]; search in libraries: " + (myHasFilesOutOfProjectRoots != null ? myHasFilesOutOfProjectRoots : "unknown"); }
toString
289,265
VirtualFileSet () { if (myFiles == null) { synchronized (this) { if (myFiles == null) { VirtualFileSet fileSet = VfsUtilCore.createCompactVirtualFileSet(myFilesSupplier.get()); fileSet.freeze(); myFilesSupplier = null; myFiles = fileSet; } } } return myFiles; }
getFiles
289,266
String () { return "Files: [" + (myFiles == null ? "(not loaded yet)" : StringUtil.join(myFiles, ", ")) + "]; search in libraries: " + (myHasFilesOutOfProjectRoots != null ? myHasFilesOutOfProjectRoots : "unknown"); }
toString
289,267
GlobalSearchScope (@NotNull Project project) { return ALL_SCOPE_KEY.getValue(project); }
getAllScope
289,268
GlobalSearchScope (@NotNull Project project) { return PROJECT_SCOPE_KEY.getValue(project); }
getProjectScope
289,269
GlobalSearchScope (@NotNull Project project) { return LIBRARIES_SCOPE_KEY.getValue(project); }
getLibrariesScope
289,270
GlobalSearchScope (@NotNull Project project) { return CONTENT_SCOPE_KEY.getValue(project); }
getContentScope
289,271
GlobalSearchScope (@NotNull Project project) { return EVERYTHING_SCOPE_KEY.getValue(project); }
getEverythingScope
289,272
boolean (@NotNull VirtualFile file) { return super.contains(file) && matchesLanguage(file); }
contains
289,273
boolean (@NotNull VirtualFile file) { Language baseLanguage = LanguageUtil.getLanguageForPsi(myProject, file); if (baseLanguage instanceof TemplateLanguage) { FileViewProvider viewProvider = PsiManager.getInstance(myProject).findViewProvider(file); if (viewProvider == null) { return false; } return ContainerUtil.or( viewProvider.getLanguages(), fileLanguage -> ContainerUtil.or(myLanguageMatchers, matcher -> matcher.matchesLanguage(fileLanguage)) ); } else if (baseLanguage != null) { return ContainerUtil.or(myLanguageMatchers, matcher -> matcher.matchesLanguage(baseLanguage)); } else { return false; } }
matchesLanguage
289,274
GlobalSearchScope (@NotNull GlobalSearchScope scope) { if (scope instanceof FileLanguageGlobalScope) { FileLanguageGlobalScope other = (FileLanguageGlobalScope)scope; if (myBaseScope == other.myBaseScope) { Collection<LanguageMatcher> intersection = ContainerUtil.intersection(myLanguageMatchers, other.myLanguageMatchers); if (intersection.isEmpty()) { return GlobalSearchScope.EMPTY_SCOPE; } else { return new FileLanguageGlobalScope(myProject, myBaseScope, intersection); } } } return super.intersectWith(scope); }
intersectWith
289,275
GlobalSearchScope (@NotNull GlobalSearchScope scope) { if (scope instanceof FileLanguageGlobalScope) { FileLanguageGlobalScope other = (FileLanguageGlobalScope)scope; if (myBaseScope == other.myBaseScope) { Collection<LanguageMatcher> intersection = ContainerUtil.union(myLanguageMatchers, other.myLanguageMatchers); return new FileLanguageGlobalScope(myProject, myBaseScope, intersection); } } return super.uniteWith(scope); }
uniteWith
289,276
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; FileLanguageGlobalScope scope = (FileLanguageGlobalScope)o; if (!myProject.equals(scope.myProject)) return false; if (!myLanguageMatchers.equals(scope.myLanguageMatchers)) return false; return true; }
equals
289,277
int () { int result = super.calcHashCode(); result = 31 * result + myProject.hashCode(); result = 31 * result + myLanguageMatchers.hashCode(); return result; }
calcHashCode
289,278
String () { return "(restricted by file languages: " + myLanguageMatchers + " in " + myBaseScope + ")"; }
toString
289,279
boolean (@NotNull VirtualFile file) { return getDelegate().contains(file); }
contains
289,280
int (@NotNull VirtualFile file1, @NotNull VirtualFile file2) { return getDelegate().compare(file1, file2); }
compare
289,281
boolean (@NotNull Module aModule) { return getDelegate().isSearchInModuleContent(aModule); }
isSearchInModuleContent
289,282
boolean (@NotNull Module aModule, boolean testSources) { return getDelegate().isSearchInModuleContent(aModule, testSources); }
isSearchInModuleContent
289,283
boolean () { return getDelegate().isSearchInLibraries(); }
isSearchInLibraries
289,284
Collection<UnloadedModuleDescription> () { return getDelegate().getUnloadedModulesBelongingToScope(); }
getUnloadedModulesBelongingToScope
289,285
String () { return getDelegate().getDisplayName(); }
getDisplayName
289,286
String () { return getClass().getName() + "[" + getDelegate() + "]"; }
toString
289,287
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DelegatingGlobalSearchScope that = (DelegatingGlobalSearchScope)o; if (!getDelegate().equals(that.getDelegate())) return false; if (!myEquality.equals(that.myEquality)) return false; return true; }
equals
289,288
int () { int result = getDelegate().calcHashCode(); result = 31 * result + myEquality.hashCode(); return result; }
calcHashCode
289,289
GlobalSearchScope () { return myBaseScope; }
getDelegate
289,290
GlobalSearchScope () { GlobalSearchScope delegate = getDelegate(); return delegate instanceof DelegatingGlobalSearchScope ? ((DelegatingGlobalSearchScope)delegate).unwrap() : delegate; }
unwrap
289,291
ProjectScopeBuilder (Project project) { return project.getService(ProjectScopeBuilder.class); }
getInstance
289,292
GlobalSearchScope (final @NotNull SearchScope scope, @NotNull Project project) { if (scope instanceof GlobalSearchScope) { return (GlobalSearchScope)scope; } return ReadAction.compute(() -> GlobalSearchScope.filesScope(project, getLocalScopeFiles((LocalSearchScope)scope))); }
toGlobalSearchScope
289,293
Set<VirtualFile> (final @NotNull LocalSearchScope scope) { return ReadAction.compute(() -> { Set<VirtualFile> files = new LinkedHashSet<>(); for (PsiElement element : scope.getScope()) { PsiFile file = element.getContainingFile(); if (file != null) { ContainerUtil.addIfNotNull(files, file.getVirtualFile()); ContainerUtil.addIfNotNull(files, file.getNavigationElement().getContainingFile().getVirtualFile()); } } return files; }); }
getLocalScopeFiles
289,294
Collection<T> () { return myCollection; }
getCollection
289,295
boolean (@NotNull T element) { myCollection.add(element); return true; }
execute
289,296
boolean (@NotNull T element) { return !myFilter.isAccepted(element) || super.execute(element); }
execute
289,297
boolean (@NotNull T element) { if (myCount.get() == myLimit){ myOverflow = true; return false; } myCount.incrementAndGet(); return super.execute(element); }
execute
289,298
boolean () { return myOverflow; }
isOverflow
289,299
boolean () { return myFoundElement != null; }
isFound