Skip to content

fix: reconcile compiler state when a folder is deleted#531

Merged
magnus-madsen merged 2 commits into
masterfrom
fix/folder-deletion-reconciliation
Mar 22, 2026
Merged

fix: reconcile compiler state when a folder is deleted#531
magnus-madsen merged 2 commits into
masterfrom
fix/folder-deletion-reconciliation

Conversation

@magnus-madsen
Copy link
Copy Markdown
Member

@magnus-madsen magnus-madsen commented Mar 22, 2026

Summary

Fixes #402 — deleting a folder (e.g. src/) now correctly removes its contents from the Flix compiler.

  • VS Code's FileSystemWatcher does not fire onDidDelete for individual files when their parent folder is removed, leaving stale entries in the compiler
  • Added a debounced reconciliation that re-scans the workspace after any delete/create event, diffs against a client-side set of known URIs, and sends apiRemUri/apiAddUri for discrepancies
  • Covers .flix, .fpkg, and .jar files
  • Also fixes a pre-existing bug where the jar watcher overwrote the pkgWatcher variable, leaking the fpkg watcher

Test plan

  • Added integration test: deleting the lib/ folder removes the fpkg from the compiler
  • Existing file manipulation tests pass
  • Manual test: delete src/ folder in explorer → diagnostics clear correctly

🤖 Generated with Claude Code

magnus-madsen and others added 2 commits March 22, 2026 15:32
VS Code's FileSystemWatcher does not fire onDidDelete for individual
files when their parent folder is removed. This leaves stale entries in
the compiler, causing phantom errors.

After any file-system delete/create event, a debounced reconciliation
re-scans the workspace with findFiles(), diffs against a client-side
set of known URIs, and sends the appropriate add/rem notifications for
any discrepancies.

Also fixes a pre-existing bug where the jar watcher overwrote the
pkgWatcher variable, leaking the fpkg watcher.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@magnus-madsen magnus-madsen merged commit 411ac62 into master Mar 22, 2026
7 checks passed
@magnus-madsen magnus-madsen deleted the fix/folder-deletion-reconciliation branch March 22, 2026 14:43
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.

Deleting folder does not remove its contents from the compiler

1 participant