private static VirtualFile[] getVirtualFiles(@NotNull AnActionEvent e) {
    final VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
    if (files != null) return Arrays.stream(files).filter(file -> !file.isDirectory()).toArray(VirtualFile[]::new);

    final VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);
    return file == null || file.isDirectory() ? VirtualFile.EMPTY_ARRAY : new VirtualFile[]{file};
  }
private static VirtualFile[] getVirtualFiles(@NotNull AnActionEvent e)