Java Code Examples for com.intellij.openapi.module.Module#EMPTY_ARRAY

The following examples show how to use com.intellij.openapi.module.Module#EMPTY_ARRAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModuleRootLayerImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nonnull
@Override
public Module[] getModuleDependencies(boolean includeTests) {
  final List<Module> result = new ArrayList<>();

  for (OrderEntry entry : getOrderEntries()) {
    if (entry instanceof ModuleOrderEntry) {
      ModuleOrderEntry moduleOrderEntry = (ModuleOrderEntry)entry;
      final DependencyScope scope = moduleOrderEntry.getScope();
      if (!includeTests && !scope.isForProductionCompile() && !scope.isForProductionRuntime()) {
        continue;
      }
      final Module module1 = moduleOrderEntry.getModule();
      if (module1 != null) {
        result.add(module1);
      }
    }
  }

  return result.isEmpty() ? Module.EMPTY_ARRAY : ContainerUtil.toArray(result, new Module[result.size()]);
}
 
Example 2
Source File: PackageViewPane.java    From consulo with Apache License 2.0 6 votes vote down vote up
private Module[] getModulesFor(PsiDirectory dir) {
  final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
  final VirtualFile vFile = dir.getVirtualFile();
  final Set<Module> modules = new HashSet<Module>();
  final Module module = fileIndex.getModuleForFile(vFile);
  if (module != null) {
    modules.add(module);
  }
  if (fileIndex.isInLibrarySource(vFile) || fileIndex.isInLibraryClasses(vFile)) {
    final List<OrderEntry> orderEntries = fileIndex.getOrderEntriesForFile(vFile);
    if (orderEntries.isEmpty()) {
      return Module.EMPTY_ARRAY;
    }
    for (OrderEntry entry : orderEntries) {
      modules.add(entry.getOwnerModule());
    }
  }
  return modules.toArray(new Module[modules.size()]);
}
 
Example 3
Source File: FlutterModuleUtils.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@NotNull
public static Module[] getModules(@NotNull Project project) {
  // A disposed project has no modules.
  if (project.isDisposed()) return Module.EMPTY_ARRAY;

  return ModuleManager.getInstance(project).getModules();
}
 
Example 4
Source File: FlutterModuleUtils.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@NotNull
public static Module[] getModules(@NotNull Project project) {
  // A disposed project has no modules.
  if (project.isDisposed()) return Module.EMPTY_ARRAY;

  return ModuleManager.getInstance(project).getModules();
}
 
Example 5
Source File: OneProjectItemCompileScope.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nonnull
public Module[] getAffectedModules() {
  final Module module = ModuleUtil.findModuleForFile(myFile, myProject);
  if (module == null) {
    LOG.error("Module is null for file " + myFile.getPresentableUrl());
    return Module.EMPTY_ARRAY;
  }
  return new Module[] {module};
}
 
Example 6
Source File: ModuleBasedConfiguration.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  ThrowableComputable<Module[],RuntimeException> action = () -> {
    final Module module = getConfigurationModule().getModule();
    return module == null ? Module.EMPTY_ARRAY : new Module[]{module};
  };
  return AccessRule.read(action);
}
 
Example 7
Source File: BlazeRerunFailedTestsAction.java    From intellij with Apache License 2.0 4 votes vote down vote up
@Override
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 8
Source File: BlazeIntellijPluginConfiguration.java    From intellij with Apache License 2.0 4 votes vote down vote up
@Override
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 9
Source File: ModulesProvider.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 10
Source File: RuntimeConfigurationProducer.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 11
Source File: RuntimeConfiguration.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 12
Source File: ToolRunProfile.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}
 
Example 13
Source File: CppRunConfiguration.java    From CppTools with Apache License 2.0 4 votes vote down vote up
@NotNull
public Module[] getModules() {
  return Module.EMPTY_ARRAY;
}