Skip to content

fix: skip workspace dependency scan when toggling tasks without dependencies - #263

Merged
vycdev merged 1 commit into
developfrom
fix/skip-dependency-scan
Oct 24, 2026
Merged

vycdev merged 1 commit into
developfrom
fix/skip-dependency-scan

Conversation

@vycdev

@vycdev vycdev commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Problem

In the 5.3.0 build, Alt+D (Toggle Done) and Alt+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 outside node_modules:

Discovery Time
5.2.0-style globby call ~1.5–3.2 s
5.3.0 discoverFiles (expanded ignore globs) ~4.3–6.3 s

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+D or Alt+C in Todo files.

Fix

  • getBlockedTodos returns early when none of the toggled tasks has dependencies, so the index is never built for them.
  • autoCompleteParents only builds the index when an eligible parent has dependencies.

Tests

  • New: toggling done or cancelled on a task without dependencies never builds the index. It fails without the fix.
  • New: a task with an unfinished dependency is still blocked.
  • The existing stale-edit test now uses a task with @depends(...), so it still exercises the asynchronous index path.
  • npm run check passes with 441 tests. vsce package succeeds.

Follow-up (not in this PR)

5.3.0's expandDirectoryExcludeGlobs makes 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.

…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.
@vycdev
vycdev merged commit 1314b26 into develop Oct 24, 2026
4 checks passed
@vycdev
vycdev deleted the fix/skip-dependency-scan branch October 24, 2026 15:39
@vycdev vycdev mentioned this pull request Oct 24, 2026
3 of 7 tasks
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.

1 participant