add configurable toggle for marking whole directories - #57
Conversation
| } | ||
|
|
||
| private getRecursionBehavior(): string { | ||
| return vscode.workspace.getConfiguration("weaudit").get("general.recursionBehavior")! |
There was a problem hiding this comment.
weaudit should be weAudit, or this will always return undefined.
|
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 |
ReviewThanks for this feature! Recursive directory marking is valuable functionality. However, there are some issues that need to be addressed: 1. Code BugsFilter logic bug (line 371 in the diff): children = children.filter(([path, t], _) => { t != vscode.FileType.Directory })The curly braces Should be: children = children.filter(([_, t]) => t !== vscode.FileType.Directory)Missing await on async recursive calls (line 373-376): children.forEach(([child, __], _) => {
const childUri = vscode.Uri.joinPath(uri, child)
this.toggleAuditedUri(childUri) // Missing await!
})
Should be: for (const [child] of children) {
const childUri = vscode.Uri.joinPath(uri, child);
await this.toggleAuditedUri(childUri);
}2. Architectural ConflictThe codebase has been significantly refactored since this PR was created. Main now uses a Your PR uses:
Main now uses:
Recommended Next Steps
I'd be happy to help with the implementation if you'd like! |
Hello again 👋 😊
This is a small PR implementing #30 , the ability to mark entire folders/directories as reviewed.
The
toggleAuditedUrifunction will use thevscode.fsAPI 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:
All the best 😊