Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
267,200
Language () { return null; }
getLanguage
267,201
ReferenceInjector (@NotNull String id) { return ContainerUtil.find(EXTENSION_POINT_NAME.getExtensionList(), injector -> id.equals(injector.getId())); }
findById
267,202
InjectedEditorWindowTracker () { return ApplicationManager.getApplication().getService(InjectedEditorWindowTracker.class); }
getInstance
267,203
NonCodeUsageInfo (PsiElement newElement) { return new NonCodeUsageInfo(newElement, getRangeInElement().getStartOffset(), getRangeInElement().getEndOffset(), getReferencedElement(), newText); }
replaceElement
267,204
void (final PsiElement element, PsiReference reference, final PsiElement referencedElement) { final Project project = element.getProject(); myReferencedElement = referencedElement; if (referencedElement != null) { myReferencedElementPointer = SmartPointerManager.getInstance(project).createSmartPsiElementPointer(referen...
init
267,205
boolean (PsiElement element) { return element instanceof PsiDirectoryContainer && element.getContainingFile() == null; }
isPackage
267,206
void (@NotNull PsiElement newElement) { elementRenamedOrMoved(newElement); }
elementMoved
267,207
void (@NotNull PsiElement newElement) { elementRenamedOrMoved(newElement); }
elementRenamed
267,208
void (@NotNull PsiElement newElement) {}
elementMoved
267,209
void (@NotNull PsiElement newElement) {}
elementRenamed
267,210
void (boolean searchInLibraries) { LOG.assertTrue(myFilesSet == null, "don't modify AnalysisScope after it has been used"); mySearchInLibraries = searchInLibraries; }
setSearchInLibraries
267,211
void (boolean includeTestSource) { LOG.assertTrue(myFilesSet == null, "don't modify AnalysisScope after it has been used"); myIncludeTestSource = includeTestSource; }
setIncludeTestSource
267,212
void (boolean analyzeInjectedCode) { LOG.assertTrue(myFilesSet == null, "don't modify AnalysisScope after it has been used"); myAnalyzeInjectedCode = analyzeInjectedCode; }
setAnalyzeInjectedCode
267,213
boolean (@NotNull VirtualFile virtualFile) { GlobalSearchScope filter = myFilter; if (filter != null && !filter.contains(virtualFile)) { return true; } return !myIncludeTestSource && ReadAction.compute(() -> TestSourcesFilter.isTestSources(virtualFile, myProject)); }
isFilteredOut
267,214
FileIndex () { return myModule == null ? ProjectRootManager.getInstance(myProject).getFileIndex() : ModuleRootManager.getInstance(myModule).getFileIndex(); }
getFileIndex
267,215
String (@NotNull PsiFileSystemItem item) { VirtualFile virtualFile = item.getVirtualFile(); LOG.assertTrue(virtualFile != null, item); return ProjectUtilCore.displayUrlRelativeToProject(virtualFile, virtualFile.getPresentableUrl(), item.getProject(), true, false); }
displayProjectRelativePath
267,216
boolean (@NotNull PsiElement psiElement) { VirtualFile file = psiElement.getContainingFile().getVirtualFile(); return file != null && contains(file); }
contains
267,217
boolean (@NotNull VirtualFile file) { if (myFilesSet == null) { if (myType == CUSTOM) { // optimization if (myScope != null) return myScope.contains(file); } if (myType == PROJECT) { //optimization ProjectFileIndex index = ProjectRootManager.getInstance(myProject).getFileIndex(); return index.isInContent(file) && !isFi...
contains
267,218
VirtualFileSet () { VirtualFileSet fileSet = VfsUtilCore.createCompactVirtualFileSet(); switch (myType) { case FILE -> { fileSet.add(((PsiFileSystemItem)myElement).getVirtualFile()); fileSet.freeze(); } case DIRECTORY, PROJECT, MODULES, MODULE, CUSTOM -> { long timeStamp = System.currentTimeMillis(); accept(createFileS...
createFilesSet
267,219
Result (@NotNull VirtualFile file) { boolean ignored = ReadAction.compute(() -> fileIndex.isExcluded(file)); if (!ignored && !file.isDirectory()) { fileSet.add(file); } return ignored ? SKIP_CHILDREN : CONTINUE; }
visitFileEx
267,220
void (@NotNull PsiElementVisitor visitor) { acceptImpl(visitor, false); }
accept
267,221
void (@NotNull PsiElementVisitor visitor) { acceptImpl(visitor, true); }
acceptIdempotentVisitor
267,222
void (@NotNull PsiElementVisitor visitor, boolean idempotent) { boolean needReadAction = !ApplicationManager.getApplication().isReadAccessAllowed(); PsiManager psiManager = PsiManager.getInstance(myProject); FileIndex fileIndex = getFileIndex(); accept(file -> { if (file.isDirectory()) return true; if (ProjectCoreUtil....
acceptImpl
267,223
boolean (@NotNull Processor<? super VirtualFile> processor) { if (myType == VIRTUAL_FILES) { return getFileSet().process(file -> isFilteredOut(file) || processor.process(file)); } if (myFilesSet != null) { return myFilesSet.process(processor); } FileIndex projectFileIndex = ProjectRootManager.getInstance(myProject).get...
accept
267,224
VirtualFileSet () { VirtualFileSet fileSet = myFilesSet; if (fileSet == null) { myFilesSet = fileSet = createFilesSet(); } return fileSet; }
getFileSet
267,225
ContentIterator (@NotNull Processor<? super VirtualFile> processor, @Nullable SearchScope searchScope) { return fileOrDir -> { boolean isInScope = ReadAction.compute(() -> { if (searchScope != null && !searchScope.contains(fileOrDir)) return false; if (isFilteredOut(fileOrDir)) return false; return !GeneratedSourcesFil...
createScopeIterator
267,226
boolean (@NotNull VirtualFile vFile, @NotNull PsiElementVisitor visitor, @NotNull PsiManager psiManager, boolean needReadAction, boolean idempotent) { if (needReadAction && !ApplicationManager.getApplication().isDispatchThread()) { Project project = psiManager.getProject(); if (idempotent) { ReadAction .nonBlocking(() ...
processFile
267,227
void (Runnable runnable, Project project) { while (true) { DumbService dumbService = DumbService.getInstance(project); dumbService.waitForSmartMode(); boolean passed = PsiDocumentManager.getInstance(project).commitAndRunReadAction(() -> { if (dumbService.isDumb()) return false; runnable.run(); return true; }); if (pass...
commitAndRunInSmartMode
267,228
boolean (@NotNull PsiFile file) { return ProblemHighlightFilter.shouldProcessFileInBatch(file); }
shouldHighlightFile
267,229
boolean (@NotNull Module module) { return switch (myType) { case PROJECT -> true; case MODULE -> myModule == module; case MODULES -> myModules.contains(module); case CUSTOM -> { if (module.isDisposed()) yield false; for (VirtualFile file : ModuleRootManager.getInstance(module).getSourceRoots()) { if (myScope.contains(f...
containsModule
267,230
void (@NotNull PsiElementVisitor visitor, @NotNull PsiManager psiManager, @NotNull VirtualFile vFile) { ProgressManager.checkCanceled(); if (!vFile.isValid()) return; PsiFile psiFile = psiManager.findFile(vFile); if (psiFile == null || !shouldHighlightFile(psiFile)) return; psiFile.accept(visitor); InjectedLanguageMana...
doProcessFile
267,231
boolean (@NotNull PsiDirectory dir, @NotNull Processor<? super VirtualFile> processor) { Project project = dir.getProject(); //we should analyze generated source files only if the action is explicitly invoked for a directory located under generated roots boolean processGeneratedFiles = GeneratedSourcesFilter.isGenerate...
accept
267,232
boolean () { if (myModules != null){ for (Module module : myModules) { if (module.isDisposed()) return false; } return true; } if (myModule != null) return !myModule.isDisposed(); if (myElement != null) { return myElement.isValid(); } return myType == VIRTUAL_FILES || myType == CUSTOM || myType == PROJECT; }
isValid
267,233
int () { return myType; }
getScopeType
267,234
Project () { return myProject; }
getProject
267,235
List<Module> () { return myModules == null ? Collections.emptyList() : Collections.unmodifiableList(myModules); }
getModules
267,236
Set<VirtualFile> () { //noinspection unchecked return myVFiles == null ? Collections.emptySet() : (Set<VirtualFile>)myVFiles; }
getFiles
267,237
String () { String relativePath = displayProjectRelativePath((PsiFileSystemItem)myElement); if (relativePath.length() > 100) { return ((PsiFileSystemItem)myElement).getName(); } return relativePath; }
getRelativePath
267,238
String (@NotNull String path) { File file = new File(path); return FileUtilRt.getNameWithoutExtension(file.getName()); }
pathToName
267,239
int () { return getFileSet().size(); }
getFileCount
267,240
void () { if (myType == VIRTUAL_FILES) { List<? extends VirtualFile> valid = ContainerUtil.filter(myVFiles, virtualFile -> virtualFile != null && virtualFile.isValid()); VirtualFileSet files = VfsUtilCore.createCompactVirtualFileSet(valid); files.freeze(); myVFiles = files; } myFilesSet = null; }
invalidate
267,241
boolean (boolean isTest) { if (myElement != null) { Project project = myElement.getProject(); ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex(); if (myElement instanceof PsiDirectory) { VirtualFile directory = ((PsiFileSystemItem)myElement).getVirtualFile(); if (index.isInSourceContent(dir...
containsSources
267,242
AnalysisScope (@NotNull Project defaultProject) { ProjectFileIndex fileIndex = ProjectRootManager.getInstance(defaultProject).getFileIndex(); HashSet<Module> modules = new HashSet<>(); if (myType == FILE || myType == DIRECTORY) { VirtualFile vFile = ((PsiFileSystemItem)myElement).getVirtualFile(); modules.addAll(getAll...
getNarrowedComplementaryScope
267,243
AnalysisScope (@NotNull Project defaultProject, @NotNull Set<? extends Module> modules) { if (modules.isEmpty()) { return new AnalysisScope(defaultProject); } Module[] allModules = ModuleManager.getInstance(defaultProject).getModules(); Set<Module> modulesToAnalyze = new HashSet<>(); for (Module module : modules) { mod...
collectScopes
267,244
Set<Module> (@NotNull Module fromModule, Module @NotNull [] allModules) { Set<Module> result = new HashSet<>(); for (Module module : allModules) { ModuleRootManager moduleRootManager = ModuleRootManager.getInstance(module); OrderEntry[] orderEntries = moduleRootManager.getOrderEntries(); for (OrderEntry orderEntry : or...
getExportBackwardDependencies
267,245
Set<Module> (@NotNull Module module, Module @NotNull [] allModules) { Set<Module> result = new HashSet<>(); for (Module dependency : allModules) { if (ArrayUtil.find(ModuleRootManager.getInstance(dependency).getDependencies(), module) > -1) { result.add(dependency); } } return result; }
getDirectBackwardDependencies
267,246
HashSet<Module> (@NotNull ProjectFileIndex fileIndex, @NotNull VirtualFile vFile) { HashSet<Module> modules = new HashSet<>(); if (fileIndex.isInLibrary(vFile)) { for (OrderEntry orderEntry : fileIndex.getOrderEntriesForFile(vFile)) { modules.add(orderEntry.getOwnerModule()); } } else { modules.add(fileIndex.getModuleF...
getAllInterestingModules
267,247
SearchScope () { ApplicationManager.getApplication().assertReadAccessAllowed(); return switch (myType) { case CUSTOM -> myScope; case DIRECTORY -> GlobalSearchScopesCore.directoryScope((PsiDirectory)myElement, true); case FILE -> GlobalSearchScope.fileScope((PsiFile)myElement); case INVALID -> LocalSearchScope.EMPTY; c...
toSearchScope
267,248
boolean (@NotNull VirtualFile file) { return getFileSet().contains(file); }
contains
267,249
boolean (@NotNull Module aModule) { return false; }
isSearchInModuleContent
267,250
boolean () { return false; }
isSearchInLibraries
267,251
boolean () { return getScopeType() == PROJECT && isIncludeTestSource(); }
isTotalScope
267,252
boolean () { return myIncludeTestSource; }
isIncludeTestSource
267,253
boolean () { return myAnalyzeInjectedCode; }
isAnalyzeInjectedCode
267,254
void (@NotNull GlobalSearchScope filter) { myFilter = filter; }
setFilter
267,255
String () { return ReadAction.compute(() -> toSearchScope().toString()); }
toString
267,256
int (String version1, String version2) { final List<String> vs1 = parse(version1); final List<String> vs2 = parse(version2); for (int i = 0; i < vs1.size() && i < vs2.size(); i++) { final String vs1Part = vs1.get(i); final String vs2Part = vs2.get(i); if (vs1Part.equals("**") || vs2Part.equals("**")) { return 0; } fina...
compare
267,257
List<String> (@Nullable String s) { // Version parsing from pkg_resources ensures that all the "pre", "alpha", "rc", etc. are sorted correctly if (s == null) { return Collections.emptyList(); } final Pattern COMPONENT_RE = Pattern.compile("\\d+|[a-z]+|\\.|-|.+"); final List<String> results = new ArrayList<>(); final Ma...
parse
267,258
void (@NotNull CatchingConsumer<? super List<String>, ? super Exception> consumer) { consumer.consume(getAllRepositories()); }
fetchAllRepositories
267,259
boolean () { return getAllRepositories() != null; }
canManageRepositories
267,260
boolean (String repositoryUrl) { return true; }
canModifyRepository
267,261
void (String repositoryUrl) { }
addRepository
267,262
void (String repositoryUrl) { }
removeRepository
267,263
int (@NotNull String version1, @NotNull String version2) { return PackageVersionComparator.VERSION_COMPARATOR.compare(version1, version2); }
compareVersions
267,264
List<RepoPackage> () { return Collections.emptyList(); }
getAllPackagesCached
267,265
boolean () { return false; }
canInstallToUser
267,266
boolean () { return false; }
isInstallToUserSelected
267,267
void (boolean newValue) { }
installToUserChanged
267,268
Collection<String> () { return myKeywords; }
getKeywords
267,269
int (Object o) { if (o instanceof RepoPackage) return myName.compareTo(((RepoPackage)o).getName()); return 0; }
compareTo
267,270
String () { return getName(); }
toString
267,271
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; InstalledPackage aPackage = (InstalledPackage)o; return myName.equals(aPackage.myName) && Objects.equals(myVersion, aPackage.myVersion); }
equals
267,272
int () { int result = myName.hashCode(); result = 31 * result + (myVersion != null ? myVersion.hashCode() : 0); return result; }
hashCode
267,273
Indent () { return Formatter.getInstance().getNormalIndent(false); }
getNormalIndent
267,274
Indent (boolean relativeToDirectParent) { return Formatter.getInstance().getNormalIndent(relativeToDirectParent); }
getNormalIndent
267,275
Indent () { return Formatter.getInstance().getNoneIndent(); }
getNoneIndent
267,276
Indent () { return Formatter.getInstance().getAbsoluteNoneIndent(); }
getAbsoluteNoneIndent
267,277
Indent () { return Formatter.getInstance().getAbsoluteLabelIndent(); }
getAbsoluteLabelIndent
267,278
Indent () { return Formatter.getInstance().getLabelIndent(); }
getLabelIndent
267,279
Indent () { return Formatter.getInstance().getContinuationIndent(false); }
getContinuationIndent
267,280
Indent (boolean relativeToDirectParent) { return Formatter.getInstance().getContinuationIndent(relativeToDirectParent); }
getContinuationIndent
267,281
Indent () {//is default return Formatter.getInstance().getContinuationWithoutFirstIndent(false); }
getContinuationWithoutFirstIndent
267,282
Indent (boolean relativeToDirectParent) { return Formatter.getInstance().getContinuationWithoutFirstIndent(relativeToDirectParent); }
getContinuationWithoutFirstIndent
267,283
Indent (final int spaces) { return Formatter.getInstance().getSpaceIndent(spaces, false); }
getSpaceIndent
267,284
Indent (final int spaces, final boolean relativeToDirectParent) { return Formatter.getInstance().getSpaceIndent(spaces, relativeToDirectParent); }
getSpaceIndent
267,285
Indent (@NotNull Type type, boolean relativeToDirectParent, boolean enforceIndentToChildren) { return Formatter.getInstance().getIndent(type, relativeToDirectParent, enforceIndentToChildren); }
getIndent
267,286
Indent (@NotNull Type type, int spaces, boolean relativeToDirectParent, boolean enforceIndentToChildren) { return Formatter.getInstance().getIndent(type, spaces, relativeToDirectParent, enforceIndentToChildren); }
getIndent
267,287
Indent (Type type) { return Formatter.getInstance().getSmartIndent(type); }
getSmartIndent
267,288
Indent (Type type, boolean relativeToDirectParent) { return Formatter.getInstance().getSmartIndent(type, relativeToDirectParent); }
getSmartIndent
267,289
String () { return myName; }
toString
267,290
Alignment () { return createAlignment(false, Anchor.LEFT); }
createAlignment
267,291
Alignment (boolean allowBackwardShift) { return createAlignment(allowBackwardShift, Anchor.LEFT); }
createAlignment
267,292
Alignment (boolean allowBackwardShift, @NotNull Anchor anchor) { return Formatter.getInstance().createAlignment(allowBackwardShift, anchor); }
createAlignment
267,293
Alignment (final Alignment base) { return Formatter.getInstance().createChildAlignment(base); }
createChildAlignment
267,294
Formatter () { Formatter instance = Holder.INSTANCE; if (instance == null) { instance = ApplicationManager.getApplication().getService(Formatter.class); Holder.INSTANCE = instance; } return instance; }
getInstance
267,295
int () { return value; }
intValue
267,296
BraceStyle (int value) { for (BraceStyle style : values()) { if (style.intValue() == value) { return style; } } throw new InvalidDataException("Unknown brace style integer value " + value); }
fromInt
267,297
int () { return myIntValue; }
intValue
267,298
ForceBraces (int value) { for (ForceBraces mode : values()) { if (mode.intValue() == value) { return mode; } } throw new InvalidDataException("Unknown brace style integer value " + value); }
fromInt
267,299
Indent () { return myChildIndent; }
getChildIndent