Repository navigation
fix: skip workspace dependency scan when toggling tasks without dependencies - #263
Merged
Merged
Conversation
…dencies Toggle Done and Toggle Cancelled built the workspace-wide dependency index before every edit, even for tasks without @Depends(...). In a workspace with ~35k files this took about 6 seconds, and the version guard then dropped the edit if the document changed during the wait, so Alt+D and Alt+C appeared not to work. Only build the index when a toggled task, or a parent eligible for auto-completion, has dependencies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the 5.3.0 build,
Alt+D(Toggle Done) andAlt+C(Toggle Cancelled) seemed broken in a large workspace (Kromacut).Both commands build the workspace-wide dependency index before editing, even when the task has no
@depends(...). Building the index runs a full file discovery. I timed that discovery against Kromacut, which has about 35k files outsidenode_modules:discoverFiles(expanded ignore globs)5.3.0 also added a document-version guard. If the file changes during that wait, the edit is dropped and the user sees "The Todo file changed. Please run the command again." Together, the shortcuts either fire about 6 seconds late or never.
Keybindings, language detection, and activation are unchanged from 5.2.0. The extension-host log shows a normal activation with no errors, and no other extension or user keybinding claims
Alt+DorAlt+Cin Todo files.Fix
getBlockedTodosreturns early when none of the toggled tasks has dependencies, so the index is never built for them.autoCompleteParentsonly builds the index when an eligible parent has dependencies.Tests
@depends(...), so it still exercises the asynchronous index path.npm run checkpasses with 441 tests.vsce packagesucceeds.Follow-up (not in this PR)
5.3.0's
expandDirectoryExcludeGlobsmakes discovery about 2× slower than 5.2.0's. This still affects tasks that do have dependencies, the dependency diagnostics, and the Files view, but all of those run in the background except toggling a task with dependencies.