Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
7,700
Promise<Object> (@NotNull PlaybackContext context) { AsyncPromise<Object> promise = new AsyncPromise<>(); AppExecutorUtil.getAppExecutorService().execute(() -> { try { computePromise(context.getProject()); promise.setResult("completed"); } catch (Throwable t) { promise.setError(t); } }); return promise; }
_execute
7,701
URL[] () { return myClasspath.stream().map(f -> { try { URL fileURL = f.toURI().toURL(); if (!fileURL.getProtocol().equals("file")) { throw new RuntimeException("Remote resources are not allowed in the classpath: " + fileURL); } return fileURL; } catch (MalformedURLException e) { throw new RuntimeException("Failed to g...
convertClasspathToURLs
7,702
CompletionType () { String completionTypeArg = getArgument(0); switch (completionTypeArg) { case "SMART" -> { LOG.info(String.format("'%s' was passed as argument, so SMART completion will be used", completionTypeArg)); return CompletionType.SMART; } //case "BASIC", default -> { LOG.info(String.format("'%s' was passed a...
getCompletionType
7,703
String (int index) { String[] completionArgs = extractCommandArgument(PREFIX).trim().toUpperCase().split(" "); if(completionArgs.length > index) { return completionArgs[index]; } else { return ""; } }
getArgument
7,704
String () { return NAME; }
getName
7,705
Editor (PlaybackContext context) { return FileEditorManager.getInstance(context.getProject()).getSelectedTextEditor(); }
getEditor
7,706
Promise<Object> (final @NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); Disposable listenerDisposable = Disposer.newDisposable(); Ref<Span> span = new Ref<>(); Ref<Scope> scope = new Ref<>(); Ref<Long> completionTimeStarted = new Ref<>(); AtomicBoolean looku...
_execute
7,707
void (boolean isCompletionRunning) { Editor editor = getEditor(context); LookupEx lookup = LookupManager.getActiveLookup(editor); if (lookup != null && !lookupListenerInited.get()) { lookup.addLookupListener(new LookupListener() { @Override public void firstElementShown() { span.get().setAttribute("firstElementShown", ...
completionPhaseChanged
7,708
void () { span.get().setAttribute("firstElementShown", System.currentTimeMillis() - completionTimeStarted.get()); }
firstElementShown
7,709
Path () { String property = System.getProperty(DUMP_COMPLETION_ITEMS_DIR); if (property != null) { return Paths.get(property); } return null; }
getCompletionItemsDir
7,710
void (List<LookupElement> item, @NotNull Path reportPath) { File dir = reportPath.toFile(); dir.mkdirs(); File file = new File(dir, createTestReportFilename()); CompletionItemsReport report = new CompletionItemsReport(ContainerUtil.map(item, CompletionVariant::fromLookUp)); DataDumper.dump(report, file.toPath()); }
dumpCompletionVariants
7,711
String () { return "completion-" + getCompletionType() + "-" + System.currentTimeMillis() + (isWarmupMode() ? "_warmup" : "") + ".txt"; }
createTestReportFilename
7,712
String () { return name; }
getName
7,713
CompletionVariant (LookupElement element) { return new CompletionVariant(element.getLookupString()); }
fromLookUp
7,714
String (@NotNull Iterator<String> args, @NotNull String text) { if (!args.hasNext()) throw new RuntimeException("Too few arguments in " + text); return args.next(); }
nextArg
7,715
void (@NotNull Consumer<String> logMessage, @NotNull Project project) { logMessage.accept("Settings up SDK: name: " + mySdkName + ", type: " + mySdkType + ", home: " + mySdkHome); Sdk sdk = setupOrDetectSdk(logMessage); ProjectRootManager rootManager = ProjectRootManager.getInstance(project); Sdk projectSdk = rootManag...
runUnderPromiseInEDT
7,716
Sdk (@NotNull Consumer<String> logMessage) { Sdk oldSdk = ProjectJdkTable.getInstance().findJdk(mySdkName); if (oldSdk != null) { if (Objects.equals(oldSdk.getSdkType().getName(), mySdkName) && FileUtil.pathsEqual(oldSdk.getHomePath(), mySdkHome)) { logMessage.accept("Existing SDK is already configured the expected way...
setupOrDetectSdk
7,717
void (@NotNull Sdk newSdk) { ProjectJdkTable.getInstance().addJdk(newSdk); }
registerNewSdk
7,718
Promise<Object> (@NotNull PlaybackContext context) { AsyncPromise<Object> promise = new AsyncPromise<>(); ApplicationManager.getApplication().invokeLater(() -> { Promises.compute(promise, () -> { computePromise(s -> context.message(s, getLine()), context.getProject()); return null; }); }); return promise; }
_execute
7,719
void (@NotNull Consumer<String> logMessage, @NotNull Project project) { WriteAction.run(() -> { runUnderPromiseInEDT(logMessage, project); }); }
computePromise
7,720
void (@NotNull ActionCallback callback, @NotNull PlaybackContext context) { ActionManager actionManager = ActionManager.getInstance(); Component focusedComponent = IdeFocusManager.findInstance().getFocusOwner(); // real focused component (editor/project view/..) DataContext dataContext = DataManager.getInstance().getDa...
execute
7,721
String () { return PREFIX; }
getSpanName
7,722
String () { return IdeActions.GROUP_PROJECT_VIEW_POPUP; }
getGroupId
7,723
String () { return ActionPlaces.PROJECT_VIEW_POPUP; }
getPlace
7,724
void (@NotNull ActionCallback callback, @NotNull PlaybackContext context) { String filePath = getText().split(" ", 2)[1]; VirtualFile file = findFile(filePath, context.getProject()); ProjectView.getInstance(context.getProject()).select(null, file, true); callback.setDone(); }
execute
7,725
void (List<Usage> allUsages, @NotNull Project project) { List<FoundUsage> foundUsages = ContainerUtil.map(allUsages, usage -> convertToFoundUsage(project, usage)); Path jsonPath = getFoundUsagesJsonPath(); if (jsonPath != null) { dumpFoundUsagesToFile(foundUsages, jsonPath); } }
storeMetricsDumpFoundUsages
7,726
void (@NotNull List<FoundUsage> foundUsages, @NotNull Path jsonPath) { LOG.info("Found usages will be dumped to " + jsonPath); Collections.sort(foundUsages); FoundUsagesReport foundUsagesReport = new FoundUsagesReport(foundUsages.size(), foundUsages); DataDumper.dump(foundUsagesReport, jsonPath); }
dumpFoundUsagesToFile
7,727
FoundUsage (@NotNull Project project, @NotNull Usage usage) { PortableFilePath portableFilePath = null; Integer line = null; if (usage instanceof UsageInfo2UsageAdapter adapter) { VirtualFile file = ReadAction.compute(() -> adapter.getFile()); if (file != null) { portableFilePath = PortableFilePaths.INSTANCE.getPortabl...
convertToFoundUsage
7,728
Path () { String property = System.getProperty(DUMP_FOUND_USAGES_DESTINATION_FILE); if (property != null) { return Paths.get(property); } return null; }
getFoundUsagesJsonPath
7,729
int (@NotNull FindUsagesDumper.FoundUsage other) { return COMPARATOR.compare(this, other); }
compareTo
7,730
boolean (Object o) { if (this == o) return true; if (!(o instanceof FoundUsage usage)) return false; return text.equals(usage.text) && Objects.equals(portableFilePath, usage.portableFilePath) && Objects.equals(line, usage.line); }
equals
7,731
int () { return Objects.hash(text, portableFilePath, line); }
hashCode
7,732
String () { StringBuilder builder = new StringBuilder(); if (portableFilePath != null) { builder.append("In file '").append(portableFilePath.getPresentablePath()).append("' "); } if (line != null) { builder.append("(at line #").append(line).append(") "); } if (!builder.isEmpty()) { builder.append("\n"); } builder.appen...
toString
7,733
String () { return PREFIX; }
getSpanName
7,734
String () { return IdeActions.GROUP_EDITOR_POPUP; }
getGroupId
7,735
String () { return ActionPlaces.EDITOR_POPUP; }
getPlace
7,736
Promise<Object> (@NotNull final PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); if (StringUtil.isNotEmpty(myOptions.downloadFileUrl)) { if (StringUtil.isEmpty(myOptions.toolShortName)) { LOGGER.error("myOptions.toolShortName cannot be null if you want to download fi...
_execute
7,737
void (@NotNull InspectionResultsView view, @NotNull String title, boolean isOffline) { super.addView(view, title, isOffline); ToolWindow resultWindow = ProblemsView.getToolWindow(project); if (resultWindow != null && myOptions.hideResults) { resultWindow.hide(); } }
addView
7,738
void (@NotNull AnalysisScope scope) { super.notifyInspectionsFinished(scope); context.message(PerformanceTestingBundle.message("command.inspection.finish"), getLine()); if (enabledInspectionTools.size() == 1 && !myOptions.hideResults) { try { File tempDirectory = FileUtil.createTempDirectory("inspection", "result"); fi...
notifyInspectionsFinished
7,739
void (@NotNull Path path, @NotNull String identifier) { // We are currently at IDEA_HOME/ruby/integrationTests/run/RubyMine/bin File dest = new File("../../../report/incorrect-resolves/" + identifier + ".xml"); File destDir = dest.getParentFile(); if (!destDir.exists() && !destDir.mkdirs()) { LOGGER.error("Haven't mana...
saveArtifact
7,740
void (@NotNull List<Tools> enabledInspectionTools, String @NotNull [] fieldNames, boolean flag) { if (enabledInspectionTools.size() == 1) { InspectionProfileEntry inspection = enabledInspectionTools.get(0).getTool().getTool(); Class<? extends InspectionProfileEntry> inspectionClass = inspection.getClass(); for (String ...
setInspectionFields
7,741
void (@NotNull String toolShortName, @NotNull String downloadUrl) { String tempDirectory = FileUtil.getTempDirectory(); String filename = toolShortName + ".txt"; File downloadedFile = Paths.get(tempDirectory, filename).toFile(); if (downloadedFile.exists()) { //noinspection ResultOfMethodCallIgnored downloadedFile.dele...
downloadTestRequiredFile
7,742
String (@NotNull final String inspectionResultFilename, final String @Nullable [] inspectionTrueFields, @NotNull Project project) { return Stream.of(project.getName(), StringUtil.trimExtensions(inspectionResultFilename), ArrayUtil.isEmpty(inspectionTrueFields) ? null : StringUtil.join(inspectionTrueFields, "-"), "warni...
buildIdentifier
7,743
void (@NotNull String key, @NotNull String value) { // As TeamCity doesn't show statistic I report to stdout I will report it twice in order to be able to see it in logs System.out.println("Report statistics key = " + key + " value = " + value); System.out.println("##teamcity[buildStatisticValue key='" + key + "' value...
reportStatisticsToTeamCity
7,744
Promise<Object> (@NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); final MessageBusConnection busConnection = context.getProject().getMessageBus().connect(); busConnection.subscribe(PowerSaveMode.TOPIC, () -> actionCallback.setDone()); ApplicationManager.getA...
_execute
7,745
void () { }
dispose
7,746
Promise<Object> (final @NotNull PlaybackContext context) { AsyncPromise<Object> completion = new AsyncPromise<>(); completeWhenSmartModeIsLongEnough(context.getProject(), completion); return completion; }
_execute
7,747
void (@NotNull Project project, @NotNull AsyncPromise<Object> completion) { DumbService.getInstance(project).runWhenSmart(() -> myAlarm.addRequest(() -> { if (DumbService.isDumb(project)) { completeWhenSmartModeIsLongEnough(project, completion); } else { completion.setResult(null); } }, SMART_MODE_MINIMUM_DELAY)); }
completeWhenSmartModeIsLongEnough
7,748
Sdk (@NotNull String name, @NotNull String type, @NotNull String home) { Ref<Sdk> sdkRef = new Ref<>(); ApplicationManager.getApplication().invokeAndWait(() -> { WriteAction.run(() -> { Sdk sdk = setup(name, type, home); sdkRef.set(sdk); }); }); return sdkRef.get(); }
setupOrDetectSdk
7,749
void (@NotNull Project project, @NotNull String name, @NotNull String type, @NotNull String home) { ApplicationManager.getApplication().invokeAndWait(() -> { WriteAction.run(() -> { Sdk sdk = setup(name, type, home); ProjectRootManager rootManager = ProjectRootManager.getInstance(project); Sdk projectSdk = rootManager....
setupOrDetectSdk
7,750
Sdk (String mySdkName, String mySdkType, String mySdkHome) { Sdk oldSdk = ProjectJdkTable.getInstance().findJdk(mySdkName); if (oldSdk != null) { if (Objects.equals(oldSdk.getSdkType().getName(), mySdkName) && FileUtil.pathsEqual(oldSdk.getHomePath(), mySdkHome)) { LOG.info("Existing SDK is already configured the expec...
setup
7,751
Promise<Object> (@NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); WriteAction.runAndWait(() -> { Project project = context.getProject(); PsiManager.getInstance(project).dropResolveCaches(); PsiManager.getInstance(project).dropPsiCaches(); ((StubIndexEx)StubI...
_execute
7,752
long () { return usedMb; }
getUsedMb
7,753
long () { return maxMb; }
getMaxMb
7,754
long () { return metaspaceMb; }
getMetaspaceMb
7,755
void (@NotNull ActionCallback actionCallback, @NotNull PlaybackContext context) { String[] arguments = getText().split(" ", 3); String filePath = arguments[1]; long timeout = Long.parseLong(arguments[2]); Project project = context.getProject(); VirtualFile file = findFile(filePath, project); assert file != null : Perfo...
execute
7,756
Promise<Object> (@NotNull PlaybackContext context) { ActionCallback actionCallback = new ActionCallbackProfilerStopper(); String input = extractCommandArgument(PREFIX); String[] lineAndColumn = input.split(" "); final int startLine = Integer.parseInt(lineAndColumn[0]) - 1; final int startColumn = Integer.parseInt(lineA...
_execute
7,757
Promise<Object> (@NotNull final PlaybackContext context) { //example: %runConfiguration TILL_TERMINATED My Run Configuration String[] command = extractCommandArgument(PREFIX).split(" ", 2); String mode = command[0]; String configurationNameToRun = command[1]; Timer timer = new Timer(); final ActionCallback actionCallba...
_execute
7,758
void (@NotNull String executorId, @NotNull ExecutionEnvironment env, @NotNull ProcessHandler handler) { timer.start(); myExecutionEnvironment = env; context.message("processStarting: " + env, getLine()); }
processStarting
7,759
void (@NotNull String executorId, @NotNull ExecutionEnvironment env, @NotNull ProcessHandler handler) { myExecutionEnvironment = env; if (mode.equals(WAIT_FOR_PROCESS_STARTED)) { timer.stop(); long executionTime = timer.getTotalTime(); context.message("processStarted in: " + env + ": " + executionTime, getLine()); acti...
processStarted
7,760
void (@NotNull String executorId, @NotNull ExecutionEnvironment env, @NotNull ProcessHandler handler, int exitCode) { if (mode.equals(WAIT_FOR_PROCESS_TERMINATED)) { timer.stop(); long executionTime = timer.getTotalTime(); context.message("processTerminated in: " + env + ": " + executionTime, getLine()); if (env.equals...
processTerminated
7,761
RunConfiguration (RunManager runManager, String configurationName) { return ContainerUtil.find(runManager.getAllConfigurationsList(), configuration -> configurationName.equals(configuration.getName())); }
getConfigurationByName
7,762
void (RunManager runManager) { LOG.info("*****************************"); LOG.info("Available configurations are:"); runManager.getAllConfigurationsList().stream().map(RunProfile::getName).forEach(LOG::info); LOG.info("*****************************"); }
printAllConfigurationsNames
7,763
void (List<String> filePaths) { synchronizeFiles(filePaths, ProjectManager.getInstance().getOpenProjects()[0]); }
synchronizeFiles
7,764
void (@NotNull ActionCallback callback, @NotNull PlaybackContext context) { var project = context.getProject(); synchronizeFiles(extractCommandList(PREFIX, " "), project); callback.setDone(); }
execute
7,765
void (List<String> filePaths, Project project) { VirtualFile[] files = filePaths.stream().map(path -> { var file = findFile(path, project); if (file == null) { throw new IllegalArgumentException("File not found " + path); } return file; }).toArray(VirtualFile[]::new); markDirtyAndRefresh(false, true, true, files); }
synchronizeFiles
7,766
MemoryMetrics () { return memory; }
getMemory
7,767
Promise<Object> (@NotNull PlaybackContext context) { ActionCallback actionCallback = new ActionCallbackProfilerStopper(); String extractCommandList = extractCommandArgument(PREFIX); String[] commandList = extractCommandList.split("\\|"); final String actionName = commandList[0]; final boolean invoke = commandList.lengt...
_execute
7,768
void () { }
dispose
7,769
String () { return NAME; }
getName
7,770
Promise<Object> (@NotNull PlaybackContext context) { ActionCallback actionCallback = new ActionCallbackProfilerStopper(); ApplicationManager.getApplication().invokeAndWait(Context.current().wrap(() -> { boolean highlightErrorElements = true; boolean runAnnotators = true; Project project = context.getProject(); final Ed...
_execute
7,771
Promise<Object> (final @NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); Project project = context.getProject(); PsiManagerImpl myPsiManager = (PsiManagerImpl)PsiManager.getInstance(project); String input = extractCommandArgument(PREFIX); String[] lineAndColu...
_execute
7,772
void (@NotNull ActionCallback callback, @NotNull PlaybackContext context) { if (ApplicationManager.getApplication().isInternal()) { try { CreateAllServicesAndExtensionsActionKt.performAction(); callback.setDone(); } catch (Exception e) { callback.reject(e.getMessage()); } } else { callback.reject("Internal mode is requ...
execute
7,773
Promise<Object> (@NotNull PlaybackContext context) { ActionCallback actionCallback = new ActionCallbackProfilerStopper(); ApplicationManager.getApplication().invokeAndWait(Context.current().wrap(() -> { @NotNull Project project = context.getProject(); FileEditor fileEditor = FileEditorManager.getInstance(project).getSe...
_execute
7,774
void () { }
dispose
7,775
Promise<Object> (@NotNull PlaybackContext context) { if (!MemoryDumpHelper.memoryDumpAvailable()) { return Promises.rejectedPromise("Memory dump can't be collected"); } //noinspection CallToSystemGC System.gc(); String path = getMemoryDumpPath(); try { MemoryDumpHelper.captureMemoryDumpZipped(path); context.message("Me...
_execute
7,776
String () { String memoryDumpPath = System.getProperties().getProperty("memory.snapshots.path", PathManager.getLogPath()); String currentTime = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")); return memoryDumpPath + File.separator + (Timer.instance.getActivityName() + '-' + currentTime + ".hp...
getMemoryDumpPath
7,777
void (@NotNull ActionCallback callback, @NotNull PlaybackContext context) { writeExitMetricsIfNeeded(); String[] arguments = getText().split(" ", 2); boolean forceExit = true; if (arguments.length > 1) { forceExit = Boolean.parseBoolean(arguments[1]); } ApplicationManager.getApplication().exit(forceExit, true, false); ...
execute
7,778
void () { String exitMetricsPath = System.getProperty("idea.log.exit.metrics.file"); if (exitMetricsPath != null) { writeExitMetrics(exitMetricsPath); } }
writeExitMetricsIfNeeded
7,779
void (String path) { MemoryCapture capture = MemoryCapture.capture(); MemoryMetrics memory = new MemoryMetrics(capture.getUsedMb(), capture.getMaxMb(), capture.getMetaspaceMb()); ExitMetrics metrics = new ExitMetrics(memory); try { new ObjectMapper().writeValue(new File(path), metrics); } catch (IOException e) { //noin...
writeExitMetrics
7,780
Promise<Object> (final @NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); String input = extractCommandArgument(PREFIX); String[] args = input.split(" "); if (args.length == 1) { int offset = Integer.parseInt(args[0]); ApplicationManager.getApplication().invok...
_execute
7,781
void (@NotNull PlaybackContext context, @NotNull ActionCallback actionCallback, @NotNull Editor editor, int offset) { final CaretListener caretListener = new CaretListener() { @Override public void caretPositionChanged(@NotNull CaretEvent e) { context.message(PerformanceTestingBundle.message("command.goto.finish"), get...
goToOffset
7,782
void (@NotNull CaretEvent e) { context.message(PerformanceTestingBundle.message("command.goto.finish"), getLine()); actionCallback.setDone(); }
caretPositionChanged
7,783
Promise<Object> (@NotNull PlaybackContext context) { final AsyncPromise<Object> result = new AsyncPromise<>(); Options options = new Options(); Args.parse(options, extractCommandArgument(PREFIX).split(" ")); ApplicationManager.getApplication().executeOnPooledThread(() -> { try { Waiter.checkCondition(() -> findTarget(c...
_execute
7,784
Promise<Object> (final @NotNull PlaybackContext context) { final AsyncPromise<Object> result = new AsyncPromise<>(); String input = extractCommandArgument(PREFIX); String[] delayText = input.split("\\|"); final long delay = Integer.parseInt(delayText[0]); final String text = delayText[1] + END_CHAR; final boolean calcu...
_execute
7,785
void (@NotNull Editor editor, String action, long latencyMs) { latencyRecorder.update(((int)latencyMs)); }
recordTypingLatency
7,786
void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { return; } ExecuteScriptDialog executeScriptDialog = new ExecuteScriptDialog(project); executeScriptDialog.show(); }
actionPerformed
7,787
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
7,788
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(e.getProject() != null); }
update
7,789
void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) { return; } Path reportHtml = IndexDiagnosticDumper.Companion.getProjectDiagnosticDirectory(project).resolve("report.html"); BrowserUtil.browse(reportHtml); }
actionPerformed
7,790
ActionUpdateThread () { return ActionUpdateThread.BGT; }
getActionUpdateThread
7,791
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(e.getProject() != null); }
update
7,792
String () { return "IntegrationPerformanceTest"; }
getName
7,793
String () { return PerformanceTestingBundle.message("filetype.ijperformance.test.display.name"); }
getDisplayName
7,794
String () { return PerformanceTestingBundle.message("filetype.ijperformance.test.description"); }
getDescription
7,795
String () { return DEFAULT_EXTENSION; }
getDefaultExtension
7,796
Icon () { return AllIcons.FileTypes.Text; }
getIcon
7,797
SyntaxHighlighter (@Nullable Project project, @Nullable VirtualFile virtualFile) { return new IJPerfSyntaxHighlighter(); }
getSyntaxHighlighter
7,798
Lexer (Project project) { return new IJPerfLexerAdapter(); }
createLexer
7,799
PsiParser (Project project) { return new IJPerfParser(); }
createParser