Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
266,500
boolean () { return isUndoInProgress() || isRedoInProgress(); }
isUndoOrRedoInProgress
266,501
boolean () { return true; }
isGlobal
266,502
DocumentReferenceManager () { return ApplicationManager.getApplication().getService(DocumentReferenceManager.class); }
getInstance
266,503
DocumentReference[] () { return myRefs; }
getAffectedDocuments
266,504
boolean () { return false; }
isGlobal
266,505
FileNavigator () { return ApplicationManager.getApplication().getService(FileNavigator.class); }
getInstance
266,506
FileEditorManager (@NotNull Project project) { return project.getService(FileEditorManager.class); }
getInstance
266,507
void (@NotNull OpenFileDescriptor descriptor, boolean focusEditor) { openTextEditor(descriptor, focusEditor); }
navigateToTextEditor
266,508
boolean (@NotNull VirtualFile file) { return isFileOpen(file); }
isFileOpenWithRemotes
266,509
boolean () { return getOpenFiles().length > 0; }
hasOpenFiles
266,510
Collection<FileEditor> () { return List.of(getSelectedEditors()); }
getSelectedEditorWithRemotes
266,511
List<FileEditor> (@NotNull VirtualFile file) { return Arrays.asList(getEditors(file)); }
getEditorList
266,512
void (@NotNull FileEditorManagerListener listener) { }
addFileEditorManagerListener
266,513
void (@NotNull FileEditorManagerListener listener) { }
removeFileEditorManagerListener
266,514
List<FileEditor> (@NotNull OpenFileDescriptor descriptor, boolean focusEditor) { return openFileEditor(descriptor, focusEditor); }
openEditor
266,515
void (@NotNull VirtualFile file) { }
updateFilePresentation
266,516
void (@NotNull VirtualFile file) { }
updateFileColor
266,517
VirtualFile () { return myFile; }
getFile
266,518
RangeMarker () { return myRangeMarker; }
getRangeMarker
266,519
int () { return myRangeMarker != null && myRangeMarker.isValid() ? myRangeMarker.getStartOffset() : myOffset; }
getOffset
266,520
int () { return myLogicalLine; }
getLine
266,521
int () { return myLogicalColumn; }
getColumn
266,522
void (boolean requestFocus) { FileNavigator.getInstance().navigate(this, requestFocus); }
navigate
266,523
boolean (@NotNull Project project, boolean requestFocus) { return FileNavigator.getInstance().navigateInEditor(this, requestFocus); }
navigateInEditor
266,524
void (@NotNull Editor e) { navigateInEditor(this, e); }
navigateIn
266,525
void (@NotNull OpenFileDescriptor descriptor, @NotNull Editor e) { int offset = descriptor.getOffset(); CaretModel caretModel = e.getCaretModel(); boolean caretMoved = false; if (descriptor.getLine() >= 0) { LogicalPosition pos = new LogicalPosition(descriptor.getLine(), Math.max(descriptor.getColumn(), 0)); if (offset...
navigateInEditor
266,526
void (@NotNull Editor editor) { FoldRegion[] allRegions = editor.getFoldingModel().getAllFoldRegions(); TextRange range = getRangeToUnfoldOnNavigation(editor); editor.getFoldingModel().runBatchFoldingOperation(() -> { for (FoldRegion region : allRegions) { if (!region.isExpanded() && range.intersects(region)) { region....
unfoldCurrentLine
266,527
TextRange (@NotNull Editor editor) { int offset = editor.getCaretModel().getOffset(); int line = editor.getDocument().getLineNumber(offset); int start = editor.getDocument().getLineStartOffset(line); int end = editor.getDocument().getLineEndOffset(line); return new TextRange(start, end); }
getRangeToUnfoldOnNavigation
266,528
void (@NotNull Editor e) { e.getScrollingModel().scrollToCaret(myScrollType); }
scrollToCaret
266,529
boolean () { return FileNavigator.getInstance().canNavigate(this); }
canNavigate
266,530
boolean () { return FileNavigator.getInstance().canNavigateToSource(this); }
canNavigateToSource
266,531
Project () { return myProject; }
getProject
266,532
OpenFileDescriptor (boolean search) { myUseCurrentWindow = search; return this; }
setUseCurrentWindow
266,533
boolean () { return myUseCurrentWindow; }
isUseCurrentWindow
266,534
OpenFileDescriptor (boolean usePreviewTab) { myUsePreviewTab = usePreviewTab; return this; }
setUsePreviewTab
266,535
boolean () { return myUsePreviewTab; }
isUsePreviewTab
266,536
void (@NotNull ScrollType scrollType) { myScrollType = scrollType; }
setScrollType
266,537
void () { if (myRangeMarker != null) { myRangeMarker.dispose(); } }
dispose
266,538
int (@NotNull OpenFileDescriptor o) { int i = myProject.getName().compareTo(o.myProject.getName()); if (i != 0) return i; i = myFile.getName().compareTo(o.myFile.getName()); if (i != 0) return i; if (myRangeMarker != null) { if (o.myRangeMarker == null) return 1; i = myRangeMarker.getStartOffset() - o.myRangeMarker.get...
compareTo
266,539
FileEditor () { return myFileEditor; }
getFileEditor
266,540
FileEditorProvider () { return myProvider; }
getProvider
266,541
boolean (Object o) { if (this == o) return true; if (!(o instanceof FileEditorWithProvider provider)) return false; if (!myFileEditor.equals(provider.myFileEditor)) return false; if (!myProvider.equals(provider.myProvider)) return false; return true; }
equals
266,542
int () { int result = myFileEditor.hashCode(); result = 31 * result + myProvider.hashCode(); return result; }
hashCode
266,543
FileEditor () { return myFileEditor; }
component1
266,544
FileEditorProvider () { return myProvider; }
component2
266,545
LocalFileSystem () { LocalFileSystem instance = ourInstance; if (instance == null) { instance = (LocalFileSystem)VirtualFileManager.getInstance().getFileSystem(PROTOCOL); ourInstance = instance; } return instance; }
getInstance
266,546
void (@NotNull Iterable<? extends File> files) { refreshIoFiles(files, false, false, null); }
refreshIoFiles
266,547
void (@NotNull Iterable<? extends Path> files) { refreshNioFiles(files, false, false, null); }
refreshNioFiles
266,548
void (@NotNull Iterable<? extends VirtualFile> files) { refreshFiles(files, false, false, null); }
refreshFiles
266,549
Set<WatchRequest> (@NotNull Collection<String> rootPaths, boolean watchRecursively) { if (rootPaths.isEmpty()) { return Collections.emptySet(); } else if (watchRecursively) { return replaceWatchedRoots(Collections.emptySet(), rootPaths, null); } else { return replaceWatchedRoots(Collections.emptySet(), null, rootPaths)...
addRootsToWatch
266,550
void (@NotNull WatchRequest watchRequest) { removeWatchedRoots(singleton(watchRequest)); }
removeWatchedRoot
266,551
void (@NotNull Collection<WatchRequest> watchRequests) { if (!watchRequests.isEmpty()) { replaceWatchedRoots(watchRequests, null, null); } }
removeWatchedRoots
266,552
URI (@NotNull File file) { String path = file.toURI().getPath(); try { if (SystemInfo.isWindows && path.charAt(0) != '/') { path = '/' + path; } return new URI(StandardFileSystems.FILE_PROTOCOL, "", path, null, null); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
toUri
266,553
String (@NotNull File libraryRoot) { return getUrlForLibraryRoot(libraryRoot.getAbsolutePath(), libraryRoot.getName()); }
getUrlForLibraryRoot
266,554
String (@NotNull Path libraryRoot) { return getUrlForLibraryRoot(libraryRoot.toAbsolutePath().toString(), libraryRoot.getFileName().toString()); }
getUrlForLibraryRoot
266,555
String (@NotNull String libraryRootAbsolutePath, @NotNull String libraryRootFileName) { String path = FileUtil.toSystemIndependentName(libraryRootAbsolutePath); return FileTypeRegistry.getInstance().getFileTypeByFileName(libraryRootFileName) == ArchiveFileType.INSTANCE ? VirtualFileManager.constructUrl(StandardFileSyst...
getUrlForLibraryRoot
266,556
String (@NotNull VirtualFile dir, @NotNull String prefix, @NotNull String extension) { String dotExt = PathUtil.makeFileName("", extension); String fileName = prefix + dotExt; int i = 1; while (dir.findChild(fileName) != null) { fileName = prefix + "_" + i + dotExt; i++; } return fileName; }
getNextAvailableName
266,557
boolean (String name) { if (name == null || name.isEmpty() || ".".equals(name) || "..".equals(name)) { return true; } for (int i = 0; i < name.length(); i++) { char ch = name.charAt(i); if (ch == '/' || ch == '\\') { return true; } } return false; }
isBadName
266,558
List<VirtualFile> (@NotNull VirtualFile root) { List<VirtualFile> result = new ArrayList<>(); visitChildrenRecursively(root, new VirtualFileVisitor<Void>(VirtualFileVisitor.NO_FOLLOW_SYMLINKS) { @Override public boolean visitFile(@NotNull VirtualFile file) { result.add(file); return true; } }); return result; }
collectChildrenRecursively
266,559
boolean (@NotNull VirtualFile file) { result.add(file); return true; }
visitFile
266,560
void (@NotNull VirtualFile root, @NotNull Processor<? super VirtualFile> processor) { FileTypeRegistry ftm = FileTypeRegistry.getInstance(); visitChildrenRecursively(root, new VirtualFileVisitor<Void>() { @Override public @NotNull Result visitFileEx(@NotNull VirtualFile file) { if (!processor.process(file)) return skip...
processFileRecursivelyWithoutIgnored
266,561
Result (@NotNull VirtualFile file) { if (!processor.process(file)) return skipTo(root); return file.isDirectory() && ftm.isFileIgnored(file) ? SKIP_CHILDREN : CONTINUE; }
visitFileEx
266,562
List<VirtualFile> (@NotNull VirtualFile dir, @NotNull VirtualFileFilter filter) { List<VirtualFile> result = null; for (VirtualFile child : dir.getChildren()) { if (filter.accept(child)) { if (result == null) result = new SmartList<>(); result.add(child); } } return result != null ? result : List.of(); }
getChildren
266,563
List<VirtualFile> (boolean recursive, boolean reloadChildren, VirtualFile @NotNull ... files) { var result = new ArrayList<VirtualFile>(files.length); for (var file : files) { if (file == null) continue; if (reloadChildren && file.isValid()) { file.getChildren(); } if (file instanceof NewVirtualFile nvf) { if (recursiv...
markDirty
266,564
void (boolean async, boolean recursive, boolean reloadChildren, VirtualFile @NotNull ... files) { List<VirtualFile> list = markDirty(recursive, reloadChildren, files); if (list.isEmpty()) return; LocalFileSystem.getInstance().refreshFiles(list, async, recursive, null); }
markDirtyAndRefresh
266,565
void (boolean async, boolean recursive, boolean reloadChildren, File @NotNull ... files) { LocalFileSystem fileSystem = LocalFileSystem.getInstance(); VirtualFile[] virtualFiles = ContainerUtil.map(files, fileSystem::refreshAndFindFileByIoFile, VirtualFile.EMPTY_ARRAY); markDirtyAndRefresh(async, recursive, reloadChild...
markDirtyAndRefresh
266,566
VirtualFile (@NotNull VirtualFile file) { if (file.isValid()) { VirtualFileSystem fileSystem = file.getFileSystem(); if (fileSystem instanceof ArchiveFileSystem) { VirtualFile localFile = ((ArchiveFileSystem)fileSystem).getLocalByEntry(file); if (localFile != null) { return localFile; } } } return file; }
getLocalFile
266,567
void (boolean asynchronous) { refresh(asynchronous); }
refreshWithoutFileWatcher
266,568
boolean () { return true; }
isReadOnly
266,569
boolean (@NotNull VirtualFile file) { return false; }
isSymLink
266,570
String (@NotNull VirtualFile file) { return null; }
resolveSymLink
266,571
void (@NotNull VirtualFileListener listener) { VirtualFileListener wrapper = new VirtualFileFilteringListener(listener, this); //noinspection deprecation VirtualFileManager.getInstance().addVirtualFileListener(wrapper); myListenerWrappers.put(listener, wrapper); }
addVirtualFileListener
266,572
void (@NotNull VirtualFileListener listener) { VirtualFileListener wrapper = myListenerWrappers.remove(listener); if (wrapper != null) { //noinspection deprecation VirtualFileManager.getInstance().removeVirtualFileListener(wrapper); } }
removeVirtualFileListener
266,573
boolean () { return false; }
markNewFilesAsDirty
266,574
String (@NotNull VirtualFile file) { return file.getName(); }
getCanonicallyCasedName
266,575
boolean (@NotNull VirtualFile file) { return list(file).length != 0; }
hasChildren
266,576
ByteArraySequence () { return ((RepresentableAsByteArraySequence)out).asByteArraySequence(); }
asByteArraySequence
266,577
ManagingFS () { ManagingFS instance = ourInstance; if (instance == null) { instance = ApplicationManager.getApplication().getService(ManagingFS.class); ourInstance = instance; } return instance; }
getInstance
266,578
ManagingFS () { return ourInstance; }
getInstanceOrNull
266,579
boolean () { ApplicationManager.getApplication().assertReadAccessAllowed(); return exists(); }
isValid
266,580
void (boolean asynchronous, boolean recursive, Runnable postRunnable) { RefreshQueue.getInstance().refresh(asynchronous, recursive, postRunnable, this); }
refresh
266,581
Iterable<VirtualFile> () { return iterInDbChildren(); }
iterInDbChildrenWithoutLoadingVfsFromOtherProjects
266,582
String (@NotNull VirtualFile file) { return composeRootPath(file.getPath()); }
getRootPathByLocal
266,583
int () { return LocalFileSystem.getInstance().getRank() + 1; }
getRank
266,584
String (@NotNull VirtualFile file) { String relativePath = file.getPath().substring(VfsUtilCore.getRootFile(file).getPath().length()); return StringUtil.trimLeading(relativePath, '/'); }
getRelativePath
266,585
FileAttributes (@NotNull VirtualFile file) { // Hack for handler initialization to have a caching e.g. JarFileSystemImpl.getHandler getHandler(file); return ArchiveHandler.DIRECTORY_ATTRIBUTES; }
getArchiveRootAttributes
266,586
boolean (@NotNull VirtualFile file) { return file.getParent() == null ? getLocalByEntry(file) != null : getAttributes(file) != null; }
exists
266,587
boolean (@NotNull VirtualFile file) { if (file.getParent() == null) return true; FileAttributes attributes = getAttributes(file); return attributes == null || attributes.isDirectory(); }
isDirectory
266,588
boolean (@NotNull VirtualFile file) { return false; }
isWritable
266,589
long (@NotNull VirtualFile file) { if (file.getParent() == null) { VirtualFile host = getLocalByEntry(file); if (host != null) return host.getTimeStamp(); } else { FileAttributes attributes = getAttributes(file); if (attributes != null) return attributes.lastModified; } return ArchiveHandler.DEFAULT_TIMESTAMP; }
getTimeStamp
266,590
long (@NotNull VirtualFile file) { if (file.getParent() == null) { VirtualFile host = getLocalByEntry(file); if (host != null) return host.getLength(); } else { FileAttributes attributes = getAttributes(file); if (attributes != null) return attributes.length; } return ArchiveHandler.DEFAULT_LENGTH; }
getLength
266,591
boolean (@NotNull VirtualFile local) { return FileTypeRegistry.getInstance().getFileTypeByFileName(local.getNameSequence()) == ArchiveFileType.INSTANCE; }
isCorrectFileType
266,592
void (@NotNull VirtualFile sampleEntry) { getHandler(sampleEntry).clearCaches(); }
clearArchiveCache
266,593
void (@NotNull VirtualFile @NotNull ... files) { addAllFiles(List.of(files)); }
addAllFiles
266,594
boolean (@NotNull VirtualFileEvent event) { return event.getFile().getFileSystem() == myFileSystem; }
isFromMySystem
266,595
void (@NotNull VirtualFileEvent event) { if (isFromMySystem(event)) { myDelegate.beforeContentsChange(event); } }
beforeContentsChange
266,596
void (@NotNull VirtualFileEvent event) { if (isFromMySystem(event)) { myDelegate.beforeFileDeletion(event); } }
beforeFileDeletion
266,597
void (@NotNull VirtualFileMoveEvent event) { if (isFromMySystem(event)) { myDelegate.beforeFileMovement(event); } }
beforeFileMovement
266,598
void (@NotNull VirtualFilePropertyEvent event) { if (isFromMySystem(event)) { myDelegate.beforePropertyChange(event); } }
beforePropertyChange
266,599
void (@NotNull VirtualFileEvent event) { if (isFromMySystem(event)) { myDelegate.contentsChanged(event); } }
contentsChanged