Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 3, 2025

When expanding environment manager nodes in the Environment Managers view, newly created environments (such as those created by pipenv install pytest or conda create -n myenv) were not appearing until the user manually refreshed the view.

This change adds automatic refresh functionality for all environment managers when their tree node is expanded. The implementation:

  • Calls the existing manager.refresh(undefined) method before retrieving environments for any manager type
  • Affects all environment managers (Pipenv, Conda, Venv, Poetry, etc.) providing consistent behavior
  • Uses the established refresh mechanism that properly updates collections and fires change events

Before:

  1. Run pipenv install pytest or create a new environment with any manager
  2. Open Environment Managers view
  3. Expand environment manager node
  4. New environment is not visible until manual refresh

After:

  1. Run pipenv install pytest or create a new environment with any manager
  2. Open Environment Managers view
  3. Expand environment manager node
  4. New environment appears immediately

The fix is minimal and targeted, modifying only 1 line of code in the getChildren method in EnvManagerView. Unit tests have been updated to validate the core logic for any manager type.

Fixes #782.


💡 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] Expanding Pipenv should refresh the children Refresh Pipenv environments automatically when expanding tree node Sep 3, 2025
@Copilot Copilot AI requested a review from eleanorjboyd September 3, 2025 19:09
Copilot finished work on behalf of eleanorjboyd September 3, 2025 19:09
@eleanorjboyd
Copy link
Member

do this for any manager not just pipenv @copilot

Copy link
Contributor Author

Copilot AI commented Sep 5, 2025

do this for any manager not just pipenv @copilot

Done! I've updated the implementation to refresh all environment managers when expanded, not just Pipenv. The change removes the if (manager.name === 'pipenv') condition and now applies automatic refresh to any manager type (Conda, Venv, Poetry, etc.). This provides consistent behavior across all environment managers for detecting newly created environments. (806ef3b)

@Copilot Copilot AI changed the title Refresh Pipenv environments automatically when expanding tree node Refresh environment managers automatically when expanding tree node Sep 5, 2025
Copilot finished work on behalf of eleanorjboyd September 5, 2025 21:28
@eleanorjboyd eleanorjboyd marked this pull request as ready for review September 8, 2025 18:26
@eleanorjboyd eleanorjboyd enabled auto-merge (squash) September 8, 2025 18:26
@vs-code-engineering vs-code-engineering bot added this to the September 2025 milestone Sep 8, 2025
@eleanorjboyd eleanorjboyd merged commit 5b29669 into main Sep 8, 2025
10 checks passed
@eleanorjboyd eleanorjboyd deleted the copilot/fix-782 branch September 8, 2025 18:31
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.

Expanding Pipenv should refresh the children
3 participants