private MultiValuesMap<VirtualFile, Artifact> computeFileToArtifactsMap() {
    final MultiValuesMap<VirtualFile, Artifact> result = new MultiValuesMap<>();
    final ArtifactManager artifactManager = ArtifactManager.getInstance(myProject);
    for (final Artifact artifact : artifactManager.getArtifacts()) {
      final PackagingElementResolvingContext context = artifactManager.getResolvingContext();
      ArtifactUtil.processPackagingElements(artifact, null, new PackagingElementProcessor<>() {
        @Override
        public boolean process(@NotNull PackagingElement<?> element, @NotNull PackagingElementPath path) {
          if (element instanceof FileOrDirectoryCopyPackagingElement<?>) {
            final VirtualFile root = ((FileOrDirectoryCopyPackagingElement<?>)element).findFile();
            if (root != null) {
              result.put(root, artifact);
            }
          }
          else if (element instanceof ModuleOutputPackagingElement) {
            for (VirtualFile sourceRoot : ((ModuleOutputPackagingElement)element).getSourceRoots(context)) {
              result.put(sourceRoot, artifact);
            }
          }
          return true;
        }
      }, context, true);
    }
    return result;
  }
private MultiValuesMap<VirtualFile, Artifact> computeFileToArtifactsMap()