Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
277,100
void () { try { ExternalSystemTask task = myTask; if (task != null) { task.cancel(); } } finally { closeInput(); } }
destroyProcessImpl
277,101
void () { try { notifyProcessDetached(); } finally { closeInput(); } }
detachProcessImpl
277,102
boolean () { return false; }
detachIsDefault
277,103
OutputStream () { return myProcessInputWriter; }
getProcessInput
277,104
void (int exitCode) { try { super.notifyProcessTerminated(exitCode); } finally { closeInput(); } }
notifyProcessTerminated
277,105
void () { var processInputWriter = myProcessInputWriter; var processInputReader = myProcessInputReader; var dataHolder = myDataHolder; myProcessInputWriter = null; myProcessInputReader = null; if (dataHolder != null) { dataHolder.putUserData(ExternalSystemRunConfiguration.RUN_INPUT_KEY, null); } //noinspection deprecat...
closeInput
277,106
void (@NotNull UserDataHolder dataHolder) { var leakedStream = dataHolder.getUserData(ExternalSystemRunConfiguration.RUN_INPUT_KEY); dataHolder.putUserData(ExternalSystemRunConfiguration.RUN_INPUT_KEY, null); if (leakedStream != null) { LOG.warn("Unexpected stream found, closing it..."); } //noinspection deprecation St...
closeLeakedStream
277,107
void () { try { detachProcessImpl(); } finally { myTask = null; myDataHolder = null; } }
dispose
277,108
RunConfiguration (@NotNull Project project) { return doCreateConfiguration(myExternalSystemId, project, this, ""); }
createTemplateConfiguration
277,109
String () { return getConfigurationFactoryId(); }
getId
277,110
boolean () { return AbstractExternalSystemTaskConfigurationType.this.isEditableInDumbMode(); }
isEditableInDumbMode
277,111
boolean () { return false; }
isEditableInDumbMode
277,112
ProjectSystemId () { return myExternalSystemId; }
getExternalSystemId
277,113
ConfigurationFactory () { return myFactories[0]; }
getFactory
277,114
ExternalSystemRunConfiguration (@NotNull ProjectSystemId externalSystemId, @NotNull Project project, @NotNull ConfigurationFactory factory, @NotNull String name) { return new ExternalSystemRunConfiguration(externalSystemId, project, factory, name); }
doCreateConfiguration
277,115
String () { return myExternalSystemId.getReadableName(); }
getDisplayName
277,116
String () { return ExternalSystemBundle.message("run.configuration.description", myExternalSystemId.getReadableName()); }
getConfigurationTypeDescription
277,117
Icon () { return myIcon.getValue(); }
getIcon
277,118
String () { return myExternalSystemId.getReadableName() + "RunConfiguration"; }
getId
277,119
ConfigurationFactory[] () { return myFactories; }
getConfigurationFactories
277,120
String () { return AbstractExternalSystemTaskConfigurationType.generateName(getProject(), mySettings); }
suggestedName
277,121
boolean () { return isReattachDebugProcess; }
isReattachDebugProcess
277,122
void (boolean reattachDebugProcess) { isReattachDebugProcess = reattachDebugProcess; }
setReattachDebugProcess
277,123
boolean () { return isDebugServerProcess; }
isDebugServerProcess
277,124
void (boolean debugServerProcess) { isDebugServerProcess = debugServerProcess; putUserData(DEBUG_SERVER_PROCESS_KEY, debugServerProcess); }
setDebugServerProcess
277,125
ExternalSystemRunConfiguration () { ConfigurationFactory configurationFactory = getFactory(); if (configurationFactory == null) { return null; } final Element element = new Element("toClone"); try { writeExternal(element); RunConfiguration clone = configurationFactory.createTemplateConfiguration(getProject()); External...
clone
277,126
void () { if (Strings.isEmptyOrSpaces(mySettings.getExternalProjectPath())) { String path = getRootProjectPath(); if (path != null) { mySettings.setExternalProjectPath(path); } } }
initializeSettings
277,127
boolean (@NotNull Accessor accessor, @NotNull Object bean) { // only these fields due to backward compatibility return switch (accessor.getName()) { case "passParentEnvs" -> !mySettings.isPassParentEnvs(); case "env" -> !mySettings.getEnv().isEmpty(); default -> true; }; }
accepts
277,128
boolean (@NotNull Element element, @NotNull String name, @NotNull Consumer<Boolean> consumer) { var childElement = element.getChild(name); if (childElement == null) { return false; } var value = Boolean.parseBoolean(childElement.getText()); consumer.accept(value); return true; }
readExternalBoolean
277,129
void (@NotNull Element element, @NotNull String name, boolean value) { var childElement = new Element(name); childElement.setText(String.valueOf(value)); element.addContent(childElement); }
writeExternalBoolean
277,130
ExternalSystemTaskExecutionSettings () { return mySettings; }
getSettings
277,131
SettingsEditor<ExternalSystemRunConfiguration> () { return new ExternalSystemRunConfigurationFragmentedEditor(this); }
getConfigurationEditor
277,132
GlobalSearchScope () { GlobalSearchScope scope = null; ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(mySettings.getExternalSystemId()); if (manager != null) { scope = manager.getSearchScope(getProject(), mySettings); } if (scope == null) { VirtualFile file = VfsUtil.findFileByIoFile(ne...
getSearchScope
277,133
void (@Nullable ExecutionConsole consoleView, String text, boolean isGreeting) { int limit = 100; if (text.length() < limit) { return; } final ConsoleViewImpl consoleViewImpl; if (consoleView instanceof ConsoleViewImpl) { consoleViewImpl = (ConsoleViewImpl)consoleView; } else if (consoleView instanceof DuplexConsoleVie...
foldGreetingOrFarewell
277,134
void (AdditionalTabComponentManager manager, ProcessHandler startedProcess) { RunProfile runProfile = ExecutionManagerImpl.getDelegatedRunProfile(this); if (runProfile instanceof RunConfigurationBase<?>) { ((RunConfigurationBase<?>)runProfile).createAdditionalTabComponents(manager, startedProcess); } }
createAdditionalTabComponents
277,135
void (@NotNull AnActionEvent event) { Presentation presentation = event.getPresentation(); ExecutionEnvironment environment = getEnvironment(event); if (environment != null) { presentation.setText(ExecutionBundle.messagePointer("rerun.configuration.action.name", StringUtil.escapeMnemonics(environment.getRunProfile().ge...
update
277,136
RunContentDescriptor (AnActionEvent event) { return myContentDescriptor != null ? myContentDescriptor : super.getDescriptor(event); }
getDescriptor
277,137
ExecutionEnvironment (@NotNull AnActionEvent event) { return myEnvironment; }
getEnvironment
277,138
void (@NotNull CompletionResultSet result) { List<LookupElement> cachedElements = myCachedElements; final String projectPath = myProjectPathAccessor.getText(); if (cachedElements == null || !StringUtil.equals(myCachedWorkingDir, projectPath)) { final ExternalProjectSettings linkedProjectSettings = ExternalSystemApiUtil...
addArgumentVariants
277,139
List<LookupElement> (@NotNull final DataNode<ProjectData> projectDataNode, @NotNull final String modulePath) { final DataNode<ModuleData> moduleDataNode = findModuleDataNode(projectDataNode, modulePath); if (moduleDataNode == null) { return Collections.emptyList(); } final Collection<DataNode<TaskData>> tasks = Externa...
getVariants
277,140
DataNode<ModuleData> (@NotNull final DataNode<ProjectData> projectDataNode, @NotNull final String projectPath) { final DataNode<?> node = ExternalSystemApiUtil.findFirstRecursively(projectDataNode, node1 -> node1.getKey().equals(ProjectKeys.MODULE) && node1.getData() instanceof ModuleData && ((ModuleData)node1 .getData...
findModuleDataNode
277,141
ExternalTaskExecutionInfo () { return myTaskInfo; }
getTaskInfo
277,142
ExternalSystemTaskLocation (@NotNull Project project, @NotNull ProjectSystemId systemId, @Nullable String projectPath, @NotNull ExternalTaskExecutionInfo taskInfo) { if (projectPath != null) { final VirtualFile file = VfsUtil.findFileByIoFile(new File(projectPath), false); if (file != null) { final PsiDirectory psiFile...
create
277,143
boolean (@NotNull ConfigurationFromContext self, @NotNull ConfigurationFromContext other) { return true; }
shouldReplace
277,144
boolean (@NotNull ExternalSystemRunConfiguration configuration, @NotNull ConfigurationContext context, @NotNull Ref<PsiElement> sourceElement) { Project project = getProjectFromContext(context); if (project == null) return false; ExternalSystemTaskExecutionSettings contextTaskExecutionSettings = getTaskSettingsFromCont...
setupConfigurationFromContext
277,145
boolean (@NotNull ExternalSystemRunConfiguration configuration, @NotNull ConfigurationContext context) { Project project = getProjectFromContext(context); if (project == null) return false; ExternalSystemTaskExecutionSettings contextTaskExecutionSettings = getTaskSettingsFromContext(context); if (contextTaskExecutionSe...
isConfigurationFromContext
277,146
ExternalSystemTaskExecutionSettings (ConfigurationContext context) { final Location<?> contextLocation = context.getLocation(); if (!(contextLocation instanceof ExternalSystemTaskLocation)) { return null; } return ((ExternalSystemTaskLocation)contextLocation).getTaskInfo().getSettings(); }
getTaskSettingsFromContext
277,147
Project (ConfigurationContext context) { final Location<?> contextLocation = context.getLocation(); if (!(contextLocation instanceof ExternalSystemTaskLocation)) { return null; } return contextLocation.getProject(); }
getProjectFromContext
277,148
ProjectSystemId () { return ProjectSystemId.IDE; }
getExternalSystemId
277,149
ExecutionConsole (@NotNull Project project, @NotNull ExternalSystemTask task, @Nullable ExecutionEnvironment env, @Nullable ProcessHandler processHandler) { ConsoleView executionConsole = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole(); executionConsole.attachToProcess(processHandler); retur...
attachExecutionConsole
277,150
void (@NotNull ExecutionConsole executionConsole, @NotNull ProcessHandler processHandler, @NotNull String text, @NotNull Key processOutputType) { processHandler.notifyTextAvailable(text, processOutputType); }
onOutput
277,151
boolean (@NotNull ExternalSystemTask task) { return true; }
isApplicableFor
277,152
AnAction[] (@NotNull ExecutionConsole consoleView) { return AnAction.EMPTY_ARRAY; }
getRestartActions
277,153
ExternalSystemJdkProvider () { return ApplicationManager.getApplication().getService(ExternalSystemJdkProvider.class); }
getInstance
277,154
ExternalSystemTaskExecutionSettings () { return myTaskExecutionSettings; }
getTaskExecutionSettings
277,155
void (@NotNull Element element) { super.writeExternal(element); element.setAttribute("tasks", StringUtil.join(myTaskExecutionSettings.getTaskNames(), " ")); if (myTaskExecutionSettings.getExternalProjectPath() != null) { element.setAttribute("externalProjectPath", myTaskExecutionSettings.getExternalProjectPath()); } if...
writeExternal
277,156
void (@NotNull Element element) { super.readExternal(element); myTaskExecutionSettings.setTaskNames(StringUtil.split(StringUtil.notNullize(element.getAttributeValue("tasks")), " ")); myTaskExecutionSettings.setExternalProjectPath(element.getAttributeValue("externalProjectPath")); myTaskExecutionSettings.setVmOptions(el...
readExternal
277,157
boolean (Object o) { if (this == o) return true; if (!(o instanceof ExternalSystemBeforeRunTask task)) return false; if (!super.equals(o)) return false; if (!myTaskExecutionSettings.equals(task.myTaskExecutionSettings)) return false; return true; }
equals
277,158
int () { int result = super.hashCode(); result = 31 * result + myTaskExecutionSettings.hashCode(); return result; }
hashCode
277,159
BeforeRunTask () { return new ExternalSystemBeforeRunTask(this); }
clone
277,160
Sdk (@Nullable Project project) { if (project != null) { Sdk res = ProjectRootManager.getInstance(project).getProjectSdk(); if (res != null) return res; Module[] modules = ModuleManager.getInstance(project).getModules(); for (Module module : modules) { Sdk sdk = ModuleRootManager.getInstance(module).getSdk(); if (sdk !...
getProjectJdk
277,161
Sdk () { String javaHome = getJavaHome(); if (StringUtil.isEmptyOrSpaces(javaHome)) throw new UndefinedJavaHomeException(); if (!isValidJdk(javaHome)) throw new InvalidJavaHomeException(javaHome); return ExternalSystemJdkProvider.getInstance().createJdk(null, javaHome); }
getJavaHomeJdk
277,162
Sdk (@NotNull String jdkName) { Sdk jdk = ProjectJdkTable.getInstance().findJdk(jdkName); if (jdk == null) return null; String homePath = jdk.getHomePath(); if (!isValidJdk(jdk)) throw new InvalidSdkException(homePath); return jdk; }
getJdk
277,163
Sdk (@NotNull Project project, SdkType javaSdkType) { Sdk projectSdk = ProjectRootManager.getInstance(project).getProjectSdk(); Stream<Sdk> projectSdks = Stream.concat(Stream.of(projectSdk), Stream.of(ModuleManager.getInstance(project).getModules()).map(module -> ModuleRootManager .getInstance(module).getSdk())); retur...
findProjectJDK
277,164
Sdk (Sdk projectSdk) { if (projectSdk != null && projectSdk.getSdkType() instanceof DependentSdkType && projectSdk.getSdkType() instanceof JavaSdkType sdkType) { String sdkBinPath = sdkType.getBinPath(projectSdk); if (sdkBinPath == null) { return null; } final String jdkPath = FileUtil.toSystemIndependentName(new File(...
findReferencedJdk
277,165
Sdk (Project project) { Sdk projectSdk = ProjectRootManager.getInstance(project).getProjectSdk(); return findReferencedJdk(projectSdk); }
findReferencedJdk
277,166
Sdk (@NotNull Sdk sdk) { Sdk parentSdk = findReferencedJdk(sdk); if (parentSdk == null) return sdk; return parentSdk; }
resolveDependentJdk
277,167
Collection<String> () { return getJavaSdkType().suggestHomePaths(); }
suggestJdkHomePaths
277,168
SdkType () { return getJavaSdk(); }
getJavaSdkType
277,169
boolean (@Nullable Sdk jdk) { if (jdk == null) return false; if (!(jdk.getSdkType() instanceof JavaSdkType)) return false; if (SdkDownloadTracker.getInstance().isDownloading(jdk)) return true; return isValidJdk(jdk.getHomePath()); }
isValidJdk
277,170
boolean (@Nullable String homePath) { if (StringUtil.isEmptyOrSpaces(homePath)) { return false; } try { return JdkUtil.checkForJdk(homePath) && JdkUtil.checkForJre(homePath); } catch (InvalidPathException exception) { return false; } }
isValidJdk
277,171
Sdk (@NotNull String homePath) { ExternalSystemJdkProvider jdkProvider = ExternalSystemJdkProvider.getInstance(); List<Sdk> sdks = Arrays.asList(ProjectJdkTable.getInstance().getAllJdks()); String name = SdkConfigurationUtil.createUniqueSdkName(jdkProvider.getJavaSdkType(), homePath, sdks); Sdk jdk = jdkProvider.create...
addJdk
277,172
SdkType () { return ExternalSystemJdkProvider.getInstance().getJavaSdkType(); }
getJavaSdk
277,173
Sdk () { return ExternalSystemJdkProvider.getInstance().getInternalJdk(); }
getInternalJdk
277,174
boolean (@Nullable String javaHome) { JdkVersionDetector.JdkVersionInfo jdkVersionInfo = javaHome == null ? null : JdkVersionDetector.getInstance().detectJdkVersionInfo(javaHome); return jdkVersionInfo != null && jdkVersionInfo.version.isAtLeast(9); }
isJdk9orLater
277,175
String (@NotNull String currentTextPrefix) { ParametersListLexer lexer = new ParametersListLexer(currentTextPrefix); while (lexer.nextToken()) { if (lexer.getTokenEnd() == currentTextPrefix.length()) { return lexer.getCurrentToken(); } } return ""; }
getPrefix
277,176
LookupElement (@NotNull Option option, @NotNull String text) { LookupElementBuilder res = LookupElementBuilder.create(text); if (option.getDescription() != null) { return TailTypeDecorator.withTail(res.withTypeText(option.getDescription(), true), TailTypes.insertSpaceType()); } return res; }
createLookupElement
277,177
void (@NotNull String text, int offset, @NotNull String prefix, @NotNull CompletionResultSet result) { ParametersListLexer lexer = new ParametersListLexer(text); int argCount = 0; while (lexer.nextToken()) { if (offset < lexer.getTokenStart()) { break; } if (offset <= lexer.getTokenEnd()) { if (argCount == 0) { if (pre...
addCompletionVariants
277,178
int (ProjectCoordinate object) { if (object == null) { return 0; } String groupId = object.getGroupId(); String artifactId = object.getArtifactId(); String version = object.getVersion(); int result1 = (groupId != null ? groupId.hashCode() : 0); result1 = 31 * result1 + (artifactId != null ? artifactId.hashCode() : 0); ...
hashCode
277,179
boolean (ProjectCoordinate o1, ProjectCoordinate o2) { if (o1 == o2) { return true; } if (o1 == null || o2 == null) { return false; } if (o1.getGroupId() != null ? !o1.getGroupId().equals(o2.getGroupId()) : o2.getGroupId() != null) return false; if (o1.getArtifactId() != null ? !o1.getArtifactId().equals(o2.getArtifact...
equals
277,180
void () { Set<String> existingModules = new HashSet<>(); myModulesSupplier.get().stream().map(Module::getName).forEach(existingModules::add); myState.names = new HashMap<>(); myNamesMap.forEach((module, lib) -> { if (existingModules.contains(module)) { myState.names.put(module, lib); } }); myState.substitutions = new H...
commit
277,181
void (String ownerModuleName, String moduleName, String libraryName, DependencyScope scope) { myNamesMap.put(moduleName, libraryName); mySubstitutions.putValue(ownerModuleName, moduleName + '_' + scope.getDisplayName()); }
addSubstitution
277,182
void (String ownerModuleName, String moduleName, String libraryName, DependencyScope scope) { mySubstitutions.remove(ownerModuleName, moduleName + '_' + scope.getDisplayName()); Collection<String> substitutions = mySubstitutions.values(); for (DependencyScope dependencyScope : DependencyScope.values()) { if (substituti...
removeSubstitution
277,183
boolean (String moduleOwner, String substitutionModule, DependencyScope scope) { return mySubstitutions.get(moduleOwner).contains(substitutionModule + '_' + scope.getDisplayName()); }
isSubstitution
277,184
boolean (String libraryName) { return myNamesMap.containsValue(libraryName); }
isSubstituted
277,185
String (String moduleName) { return myNamesMap.get(moduleName); }
getSubstitutedLibrary
277,186
String (@NotNull ProjectCoordinate id) { if (StringUtil.isEmpty(id.getArtifactId())) return null; String result = myModuleMappingById.get(id); return result == null && id.getVersion() != null ? myModuleMappingById.get(new ProjectId(id.getGroupId(), id.getArtifactId(), null)) : result; }
findModule
277,187
void (@NotNull ProjectCoordinate id, @NotNull Module module) { myModuleMappingById.put(id, module.getName()); myModuleMappingById.put(new ProjectId(id.getGroupId(), id.getArtifactId(), null), module.getName()); }
register
277,188
void (@NotNull Module module) { Arrays.stream(ExternalProjectsWorkspaceImpl.EP_NAME.getExtensions()) .map(contributor -> contributor.findProjectId(module)) .filter(Objects::nonNull) .findFirst() .ifPresent(id -> register(id, module)); }
register
277,189
Module (@NotNull final String filePath, final String moduleTypeId) { Module module = getModifiableModuleModel().newModule(filePath, moduleTypeId); final String moduleName = FileUtilRt.getNameWithoutExtension(new File(filePath).getName()); if (!module.getName().equals(moduleName)) { try { getModifiableModuleModel().rena...
newModule
277,190
Module (@NotNull ModuleData moduleData) { String imlName = null; for (String candidate: suggestModuleNameCandidates(moduleData)) { Module module = findIdeModule(candidate); if (module == null) { imlName = candidate; break; } } assert imlName != null : "Too many duplicated module names"; String filePath = ExternalSystem...
newModule
277,191
Module (@NotNull String ideModuleName) { Module module = getModifiableModuleModel().findModuleByName(ideModuleName); return module == null ? getModifiableModuleModel().getModuleToBeRenamed(ideModuleName) : module; }
findIdeModule
277,192
Library (@NotNull LibraryData libraryData) { final LibraryTable.ModifiableModel libraryTable = getModifiableProjectLibrariesModel(); for (Library ideLibrary: libraryTable.getLibraries()) { if (ExternalSystemApiUtil.isRelated(ideLibrary, libraryData)) return ideLibrary; } return null; }
findIdeLibrary
277,193
ModifiableModuleModel () { if (myModifiableModuleModel == null) { myModifiableModuleModel = doGetModifiableModuleModel(); } return myModifiableModuleModel; }
getModifiableModuleModel
277,194
ModifiableRootModel (Module module) { return (ModifiableRootModel)getRootModel(module); }
getModifiableRootModel
277,195
ModuleRootModel (Module module) { return myModifiableRootModels.computeIfAbsent(module, k -> doGetModifiableRootModel(module)); }
getRootModel
277,196
ModifiableFacetModel (Module module) { return myModifiableFacetModels.computeIfAbsent(module, k -> doGetModifiableFacetModel(module)); }
getModifiableFacetModel
277,197
Library (String name) { return getModifiableProjectLibrariesModel().getLibraryByName(name); }
getLibraryByName
277,198
Library (String name) { return getModifiableProjectLibrariesModel().createLibrary(name); }
createLibrary
277,199
Library (String name, @Nullable ProjectModelExternalSource externalSource) { return getModifiableProjectLibrariesModel().createLibrary(name, null, externalSource); }
createLibrary