Skip to content

Fix project view not updating when folders are moved or deleted #571

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jun 25, 2025

The project view didn't automatically update when project folders were moved or deleted in VS Code's explorer, leaving stale paths and non-existent projects in the view.

Problem

  1. Moving a project folder → Project view still showed the old path
  2. Deleting a project folder → Project remained visible in the view despite being deleted

Solution

Added file system watchers to automatically track project folder changes:

  • File renames/moves: Updates project URIs to reflect new paths
  • File deletions: Removes deleted projects from the project view
  • Nested projects: Handles projects within moved/deleted parent folders

Implementation Details

  1. Enhanced workspace.apis.ts - Added onDidRenameFiles wrapper for VS Code file rename events
  2. Enhanced PythonProjectManagerImpl - Added updateProjectUri() method to handle path updates
  3. Enhanced ProjectView - Added event handlers:
    • handleFileRenames() - Updates project paths when folders are moved
    • handleFileDeletions() - Removes projects when folders are deleted

Testing

  • Added comprehensive unit tests for the new functionality
  • All existing tests continue to pass (120 passing)
  • Code passes linting and TypeScript compilation

The implementation is minimal and leverages VS Code's built-in file system events for reliable tracking.

Fixes #570.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] moving project folder doesn't update project view Fix project view not updating when folders are moved or deleted Jun 25, 2025
@Copilot Copilot AI requested a review from eleanorjboyd June 25, 2025 16:49
Copilot finished work on behalf of eleanorjboyd June 25, 2025 16:49
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.

moving project folder doesn't update project view
2 participants