Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
258,600
int (FilePath path) { if (path == null) return 0; int result = path.getPath().hashCode(); result = 31 * result + (path.isDirectory() ? 1 : 0); return result; }
hashCode
258,601
ActionUpdateThread () { return ActionUpdateThread.EDT; }
getActionUpdateThread
258,602
void (@NotNull AnActionEvent e) { ConsoleViewImpl consoleView = ObjectUtils.tryCast(e.getData(LangDataKeys.CONSOLE_VIEW), ConsoleViewImpl.class); Editor editor = consoleView != null ? consoleView.getEditor() : null; boolean isShown = editor != null && editor.getGutter().isAnnotationsShown(); e.getPresentation().setEnab...
update
258,603
void (@NotNull final AnActionEvent e) { myIsLoading = true; Project project = e.getProject(); ConsoleViewImpl consoleView = (ConsoleViewImpl)e.getData(LangDataKeys.CONSOLE_VIEW); Editor editor = consoleView != null ? consoleView.getEditor() : null; if (project == null || editor == null) return; EditorHyperlinkSupport h...
actionPerformed
258,604
void () { editor.getGutter().closeAllAnnotations(); }
onCancel
258,605
void () { myIsLoading = false; Disposer.dispose(myUpdateQueue); }
onFinished
258,606
void (@NotNull ProgressIndicator indicator) { Map<VirtualFile, IntList> files2lines = CollectionFactory.createSmallMemoryFootprintMap(); Int2ObjectMap<LastRevision> revisions = new Int2ObjectOpenHashMap<>(); ApplicationManager.getApplication().runReadAction(() -> { for (int line = 0; line < editor.getDocument().getLine...
run
258,607
void () { updateGutter(indicator, revisions); }
run
258,608
void (@NotNull ProgressIndicator indicator, @NotNull Map<Integer, LastRevision> revisions) { if (indicator.isCanceled()) return; if (myGutter == null) { myGutter = new MyActiveAnnotationGutter(getProject(), hyperlinks, indicator); editor.getGutter().registerTextAnnotation(myGutter, myGutter); } Map<Integer, LastRevisio...
updateGutter
258,609
LastRevision (@NotNull VirtualFile file) { try { AbstractVcs vcs = VcsUtil.getVcsFor(project, file); if (vcs == null) return null; VcsHistoryProvider historyProvider = vcs.getVcsHistoryProvider(); if (historyProvider == null) return null; FilePath filePath = VcsContextFactory.getInstance().createFilePathOn(file); if (h...
getLastRevision
258,610
VirtualFile (@NotNull List<? extends RangeHighlighter> links) { RangeHighlighter key = ContainerUtil.getLastItem(links); if (key == null) return null; HyperlinkInfo info = EditorHyperlinkSupport.getHyperlinkInfo(key); if (!(info instanceof FileHyperlinkInfo)) return null; OpenFileDescriptor descriptor = ((FileHyperlink...
getHyperlinkVirtualFile
258,611
LastRevision (@NotNull VcsFileRevision revision) { VcsRevisionNumber number = revision.getRevisionNumber(); String author = StringUtil.notNullize(revision.getAuthor(), VcsBundle.message("vfs.revision.author.unknown")); Date date = revision.getRevisionDate(); String message = StringUtil.notNullize(revision.getCommitMess...
create
258,612
VcsRevisionNumber () { return myNumber; }
getNumber
258,613
String () { return myAuthor; }
getAuthor
258,614
Date () { return myDate; }
getDate
258,615
String () { return myMessage; }
getMessage
258,616
void (int lineNum) { LastRevision revision = myRevisions.get(lineNum); if (revision == null) return; VirtualFile file = getHyperlinkVirtualFile(myHyperlinks.findAllHyperlinksOnLine(lineNum)); if (file == null) return; AbstractVcs vcs = ProjectLevelVcsManager.getInstance(myProject).getVcsFor(file); if (vcs != null) { Vc...
doAction
258,617
Cursor (int lineNum) { return myRevisions.containsKey(lineNum) ? Cursor.getPredefinedCursor(Cursor.HAND_CURSOR) : Cursor.getDefaultCursor(); }
getCursor
258,618
String (int line, Editor editor) { LastRevision revision = myRevisions.get(line); if (revision != null) { return String.format("%" + myMaxDateLength + "s", FileAnnotation.formatDate(revision.getDate())) + " " + revision.getAuthor(); } return ""; }
getLineText
258,619
String (int line, Editor editor) { LastRevision revision = myRevisions.get(line); if (revision != null) { return XmlStringUtil.escapeString( revision.getAuthor() + " " + DateFormatUtil.formatDateTime(revision.getDate()) + "\n" + VcsUtil.trimCommitMessageToSaneSize(revision.getMessage()) ); } return null; }
getToolTip
258,620
EditorFontType (int line, Editor editor) { LastRevision revision = myRevisions.get(line); return revision != null && revision.getDate().equals(myNewestDate) ? EditorFontType.BOLD : EditorFontType.PLAIN; }
getStyle
258,621
ColorKey (int line, Editor editor) { return AnnotationSource.LOCAL.getColor(); }
getColor
258,622
Color (int line, Editor editor) { return null; }
getBgColor
258,623
List<AnAction> (int line, Editor editor) { return Collections.emptyList(); }
getPopupActions
258,624
void () { myIndicator.cancel(); }
gutterClosed
258,625
void (@NotNull Map<Integer, LastRevision> revisions) { myRevisions = revisions; Date newestDate = null; int maxDateLength = 0; for (LastRevision revision : myRevisions.values()) { Date date = revision.getDate(); if (newestDate == null || date.after(newestDate)) { newestDate = date; } int length = DateFormatUtil.formatP...
updateData
258,626
Notification (@NotNull String executable) { return !isExecutableValid(executable) ? createDefaultNotification() : null; }
validate
258,627
ExecutableNotValidNotification () { return new ExecutableNotValidNotification(); }
createDefaultNotification
258,628
boolean (@NotNull String executable) { return doCheckExecutable(executable, Collections.emptyList(), Collections.emptyMap()); }
isExecutableValid
258,629
boolean (@NotNull String executable, @NotNull List<String> processParameters, @NotNull Map<String, String> envVariables) { try { GeneralCommandLine commandLine = new GeneralCommandLine(); commandLine.setExePath(executable); commandLine.addParameters(processParameters); commandLine.setCharset(CharsetToolkit.getDefaultSy...
doCheckExecutable
258,630
void (@NotNull Notification notification) { if (ApplicationManager.getApplication().isUnitTestMode() || ApplicationManager.getApplication().isHeadlessEnvironment()) { return; } NotificationsManager notificationsManager = NotificationsManager.getNotificationsManager(); if (notificationsManager.getNotificationsOfType(not...
showExecutableErrorNotification
258,631
void (@NotNull Notification notification) { showSettings(); if (validate(getCurrentExecutable()) == null) { notification.expire(); } }
showSettingsAndExpireIfFixed
258,632
void () { ShowSettingsUtil.getInstance().showSettingsDialog(myProject, getConfigurableDisplayName()); }
showSettings
258,633
boolean () { if (myProject.isDisposed()) { return false; } if (!myProject.isDefault() && !TrustedProjects.isTrusted(myProject)) { return notify(new SafeModeErrorNotification()); } LOG.info("Executable is not valid: " + getCurrentExecutable()); Notification notification = validate(getCurrentExecutable()); return notify(...
checkExecutableAndNotifyIfNeeded
258,634
boolean (@Nullable Notification notification) { if (notification != null) { showExecutableErrorNotification(notification); return false; } return true; }
notify
258,635
boolean (@Nullable Component parentComponent) { if (myProject.isDisposed()) { return false; } if (!myProject.isDefault() && !TrustedProjects.isTrusted(myProject)) { Messages.showErrorDialog(parentComponent, myNotificationSafeModeDescription, myNotificationErrorTitle); return false; } if (!isExecutableValid(getCurrentEx...
checkExecutableAndShowMessageIfNeeded
258,636
int (@Nullable Component parentComponent) { String okText = IdeBundle.message("button.fix.it"); String cancelText = CommonBundle.getCancelButtonText(); Icon icon = Messages.getErrorIcon(); String title = myNotificationErrorTitle; String description = myNotificationErrorDescription; return parentComponent != null ? Mess...
showMessage
258,637
boolean () { if (!myProject.isDefault() && !TrustedProjects.isTrusted(myProject)) { return false; } return isExecutableValid(getCurrentExecutable()); }
isExecutableValid
258,638
void (@NotNull Notification notification, @NotNull HyperlinkEvent event) { showSettingsAndExpireIfFixed(notification); }
hyperlinkActivated
258,639
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
258,640
void (@NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); boolean enabled = isEnabled(project); Presentation presentation = e.getPresentation(); presentation.setEnabledAndVisible(enabled); }
update
258,641
void (@NotNull final AnActionEvent e) { Project project = e.getRequiredData(CommonDataKeys.PROJECT); if (!isEnabled(project)) return; VirtualFile targetDirectory = ProjectUtil.guessProjectDir(project); if (targetDirectory == null) { LOG.warn("Project directory is null"); return; } StartUseVcsDialog dialog = new StartUs...
actionPerformed
258,642
boolean (@Nullable Project project) { if (project == null || !TrustedProjects.isTrusted(project)) return false; ProjectLevelVcsManagerImpl manager = ProjectLevelVcsManagerImpl.getInstanceImpl(project); return manager.haveVcses() && !manager.hasAnyMappings(); }
isEnabled
258,643
JComponent () { return myVcsCombo; }
getPreferredFocusedComponent
258,644
JComponent () { JLabel selectText = new JLabel( VcsBundle.message("dialog.enable.version.control.integration.select.vcs.label.text", PathUtil.getFileName(myTargetDirectory))); selectText.setUI(new MultiLineLabelUI()); JPanel mainPanel = new JPanel(new GridBagLayout()); GridBagConstraints gb = new GridBagConstraints(0, ...
createCenterPanel
258,645
String () { return "reference.version.control.enable.version.control.integration"; }
getHelpId
258,646
AbstractVcs () { return myVcsCombo.getItem(); }
getVcs
258,647
boolean (@NotNull EditorComposite editor, @NotNull EditorWindow window, @NotNull FileEditorManagerEx fileEditorManager) { return !fileEditorManager.isChanged(editor) && !window.isFilePinned(editor.getFile()); }
isFileToClose
258,648
boolean (Project project, AnActionEvent event) { return super.isActionEnabled(project, event) && ProjectLevelVcsManager.getInstance(project).getAllActiveVcss().length > 0; }
isActionEnabled
258,649
String (final boolean inSplitter) { if (inSplitter) { return IdeBundle.message("action.close.all.unmodified.editors.in.tab.group"); } else { return IdeBundle.message("action.close.all.unmodified.editors"); } }
getPresentationText
258,650
Set<TodoItem> (@Nullable TodoFilter todoFilter) { Collection<Change> changes = myChanges.values(); TodoCheckinHandlerWorker worker = new TodoCheckinHandlerWorker(myProject, changes, todoFilter); worker.execute(); return worker.inOneList(); }
doFindAllTodoItems
258,651
Set<TodoItem> (@NotNull PsiFile psiFile, @Nullable TodoFilter todoFilter) { VirtualFile file = psiFile.getVirtualFile(); Change change = myChanges.get(file); if (change == null) return Collections.emptySet(); List<Change> changes = Collections.singletonList(change); TodoCheckinHandlerWorker worker = new TodoCheckinHand...
doFindTodoForFile
258,652
TodoTreeStructure () { return new ChangeListTodosTreeStructure(myProject); }
createTreeStructure
258,653
PsiTodoSearchHelper () { return myCustomPsiTodoSearchHelper; }
getSearchHelper
258,654
void (@NotNull Collection<? extends TodoItem> todoItems) { synchronized (myMap) { myMap.clear(); for (TodoItem todoItem : todoItems) { myMap.putValue(todoItem.getFile(), todoItem); } } }
buildMap
258,655
boolean (@NotNull Processor<? super PsiFile> processor) { return ContainerUtil.process(findFilesWithTodoItems(), processor); }
processFilesWithTodoItems
258,656
int (@NotNull PsiFile file) { return findTodoItems(file).length; }
getTodoItemsCount
258,657
int (@NotNull PsiFile file, @NotNull TodoPattern pattern) { final TodoFilter filter = new TodoFilter(); filter.addTodoPattern(pattern); return findPatternedTodoItems(file, filter).length; }
getTodoItemsCount
258,658
TodoItem[] (PsiFile file, final TodoFilter todoFilter) { if (myDirtyFileSet.contains(file.getVirtualFile())) { Set<TodoItem> todoItems = doFindTodoForFile(file, todoFilter); synchronized (myMap) { myMap.remove(file); for (TodoItem todoItem : todoItems) { myMap.putValue(file, todoItem); } } } synchronized (myMap) { fina...
findPatternedTodoItems
258,659
TodoTreeStructure () { return new CustomChangelistTodoTreeStructure(myProject, myCustomPsiTodoSearchHelper); }
createTreeStructure
258,660
boolean (final @NotNull PsiFile psiFile) { if (!psiFile.isValid()) return false; VirtualFile file = psiFile.getVirtualFile(); ChangeListManager changeListManager = ChangeListManager.getInstance(myProject); List<LocalChangeList> changeLists = changeListManager.getChangeLists(file); return ContainerUtil.exists(changeList...
accept
258,661
Set<VirtualFile> (@NotNull Collection<? extends TodoItem> todoItems) { HashSet<VirtualFile> files = new HashSet<>(); for (TodoItem item : todoItems) { PsiFile psiFile = item.getFile(); files.add(psiFile.getVirtualFile()); } return files; }
collectIncludedFiles
258,662
Set<TodoItem> (@Nullable TodoFilter todoFilter) { List<Change> allChanges = new ArrayList<>(); if (myIncludedChangeListsIds == null) { allChanges.addAll(ChangeListManager.getInstance(myProject).getAllChanges()); } else { for (String changeListId : myIncludedChangeListsIds) { LocalChangeList changeList = ChangeListManag...
doFindAllTodoItems
258,663
Set<TodoItem> (@NotNull PsiFile psiFile, @Nullable TodoFilter todoFilter) { VirtualFile file = psiFile.getVirtualFile(); if (!myIncludedFiles.contains(file)) return Collections.emptySet(); Change change = ChangeListManager.getInstance(myProject).getChange(file); if (change == null) return Collections.emptySet(); List<C...
doFindTodoForFile
258,664
void (final ChangeList oldDefaultList, final ChangeList newDefaultList) { rebuildWithAlarm(myAlarm); updateTabName(); }
defaultListChanged
258,665
void (final ChangeList list, final String oldName) { updateTabName(); }
changeListRenamed
258,666
void (final Collection<? extends Change> changes, final ChangeList fromList, final ChangeList toList) { rebuildWithAlarm(myAlarm); }
changesMoved
258,667
void () { updateTabName(); }
allChangeListsMappingsChanged
258,668
void () { AppUIUtil.invokeLaterIfProjectAlive(myProject, () -> { setDisplayName(getTabName(myProject)); }); }
updateTabName
258,669
String (@NotNull Project project) { ChangeListManager changeListManager = ChangeListManager.getInstance(project); if (changeListManager.areChangeListsEnabled()) { LocalChangeList list = changeListManager.getDefaultChangeList(); String changelistName = list.getName().trim(); String suffix = VcsBundle.message("todo.tab.t...
getTabName
258,670
VcsContext (@NotNull AnActionEvent event) { return VcsContextWrapper.createCachedInstanceOn(event); }
createCachedContextOn
258,671
VcsContext (@NotNull AnActionEvent event) { return new VcsContextWrapper(event.getDataContext(), event.getModifiers(), event.getPlace(), event.getPresentation().getText()); }
createContextOn
258,672
FilePath (@NotNull VirtualFile virtualFile) { return createFilePath(virtualFile.getPath(), virtualFile.isDirectory()); }
createFilePathOn
258,673
FilePath (@NotNull File file) { String path = file.getPath(); VirtualFile vf = LocalFileSystem.getInstance().findFileByPath(path); return createFilePath(path, vf != null ? vf.isDirectory() : file.isDirectory()); }
createFilePathOn
258,674
FilePath (@NotNull final File file, final boolean isDirectory) { return createFilePath(file.getPath(), isDirectory); }
createFilePathOn
258,675
FilePath (@NotNull Path file, boolean isDirectory) { return new LocalFilePath(file, isDirectory); }
createFilePath
258,676
FilePath (@NotNull final String path, final boolean isDirectory) { return new RemoteFilePath(path, isDirectory); }
createFilePathOnNonLocal
258,677
FilePath (@NotNull final VirtualFile parent, @NotNull final String name) { return createFilePath(parent, name, false); }
createFilePathOn
258,678
FilePath (@NotNull VirtualFile parent, @NotNull String fileName, boolean isDirectory) { return createFilePath(parent.getPath() + "/" + fileName, isDirectory); }
createFilePath
258,679
LocalChangeList (@NotNull Project project, @NotNull final String name) { return LocalChangeListImpl.createEmptyChangeListImpl(project, name, null); }
createLocalChangeList
258,680
FilePath (@NotNull String path, boolean isDirectory) { return new LocalFilePath(path, isDirectory); }
createFilePath
258,681
Type () { return myType; }
getType
258,682
VcsDirectoryMapping () { return myMapping; }
getMapping
258,683
String () { return String.format("VcsRootError{%s - %s}", myType, myMapping); //NON-NLS }
toString
258,684
boolean (Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; VcsRootError error = (VcsRootError)o; if (!Objects.equals(myMapping, error.getMapping())) return false; if (myType != error.getType()) return false; return true; }
equals
258,685
int () { return Objects.hash(myType, myMapping); }
hashCode
258,686
void (@NotNull ProgressIndicator indicator) { runnable.run(); }
run
258,687
void () { myZipperUpdater.queue(myInZipper); }
request
258,688
void (@NotNull CompletionParameters parameters, @NotNull CompletionResultSet result) { PsiFile file = parameters.getOriginalFile(); Project project = file.getProject(); Document document = PsiDocumentManager.getInstance(project).getDocument(file); if (document == null) return; Supplier<Iterable<Change>> changesSupplier...
fillCompletionVariants
258,689
void (Project project, CompletionResultSet resultSet, FilePath filePath, boolean strikeout) { resultSet.addElement(LookupElementBuilder.create(filePath.getName()) .withIcon(VcsUtil.getIcon(project, filePath)) .withStrikeoutness(strikeout)); }
addFilePathName
258,690
void (Project project, int count, CompletionResultSet prefixed, FilePath filePath) { VirtualFile vFile = filePath.getVirtualFile(); if (vFile == null) return; PsiFile psiFile = PsiManagerEx.getInstanceEx(project).findFile(vFile); if (psiFile == null) return; PlainTextSymbolCompletionContributor contributor = PlainTextS...
addLanguageSpecificElements
258,691
CodeSmellDetector (Project project) { return project.getService(CodeSmellDetector.class); }
getInstance
258,692
String () { return String.format("MovedFileInfo{[%s] -> [%s]}", myOldPath, myNewPath); //NON-NLS }
toString
258,693
boolean () { return myFile.isCaseSensitive(); }
isCaseSensitive
258,694
FilePath () { return VcsUtil.getFilePath(myOldPath, myFile.isDirectory()); }
getOldPath
258,695
FilePath () { return VcsUtil.getFilePath(myNewPath, myFile.isDirectory()); }
getNewPath
258,696
List<VirtualFile> () { return acquireListUnderLock(myAddedFiles); }
acquireAddedFiles
258,697
List<MovedFileInfo> () { return acquireListUnderLock(myMovedFiles); }
acquireMovedFiles
258,698
List<FilePath> () { return withLock(PROCESSING_LOCK.writeLock(), () -> { List<FilePath> deletedFiles = new ArrayList<>(myDeletedFiles); myDeletedFiles.clear(); return deletedFiles; }); }
acquireDeletedFiles
258,699
void () { withLock(PROCESSING_LOCK.writeLock(), () -> { myAddedFiles.clear(); myCopyFromMap.clear(); myDeletedFiles.clear(); myMovedFiles.clear(); }); }
clearAllPendingTasks