Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add configurable toggle for marking whole directories #57

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alxshine
Copy link

Hello again 👋 😊

This is a small PR implementing #30 , the ability to mark entire folders/directories as reviewed.

The toggleAuditedUri function will use the vscode.fs API to check if the URI in question is a directory or file, making a separate function for directories unnecessary.
This also makes adding a context menu action for the command simpler 🙂

For the behavior when encountering a directory, I added a configuration option with three modes:

  • no recursion: mark the directory only
  • direct children only: mark the directory and child files, no subdirectories
  • full recursion: recurse into all subdirectories, toggling all files

All the best 😊

}

private getRecursionBehavior(): string {
return vscode.workspace.getConfiguration("weaudit").get("general.recursionBehavior")!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weaudit should be weAudit, or this will always return undefined.

@jvdprng
Copy link
Member

jvdprng commented Oct 1, 2024

If I understand this correctly, with recursion off you can toggle a folder as audited without toggling the contained files as audited. However, if you ever toggle any of the recursive children of this folder as audited or not audited, it will start an upward recursion of this.checkIfAllSiblingFilesAreAudited, and if any of the intermediate files are not audited, your folder will not be marked as audited anymore. Is this the desired behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants