Repository navigation
agents: fire configuration changes when workspace folders bring or take settings - #350602
Open
Sandeep Somavarapu (sandy081) wants to merge 1 commit into
Open
Sandeep Somavarapu (sandy081) wants to merge 1 commit into
Sandeep Somavarapu (sandy081) wants to merge 1 commit into
Conversation
Settings of added folders were applied silently while the folders were
being added, so editors on files in a mounted folder kept stale values.
Removals did fire, but the event compared against the already-updated
workspace, so `affectsConfiguration(key, { resource })` for a file in
the removed folder returned false.
The change for added folders is now computed when they load and fired
once the folders change, keyed to that change, against the configuration
and folders from before it. Initialization stays silent.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the workspace-folder configuration notification changes.
No open issues 🎉
What changed in this PR
Fixes configuration-change notifications in the Agents window so already-open editors receive folder settings when workspace folders are added or removed.
Changes:
- Tracks added-folder configuration changes per workspace-folder event and merges them with removals.
- Snapshots the previous configuration and workspace folders so resource-specific change checks remain accurate.
- Adds regression tests for folder settings, language overrides, and silent initialization.
| File | Description |
|---|---|
src/vs/workbench/services/configuration/test/browser/agents/agentsConfigurationService.test.ts |
Tests add/remove notifications, language-only settings, and silent initialization. |
src/vs/workbench/services/configuration/browser/agents/agentsConfigurationService.ts |
Collects folder configuration changes and preserves prior workspace state for accurate notifications. |
Review effort: Balanced
Sandeep Somavarapu (sandy081)
marked this pull request as ready for review
November 26, 2026 21:50
This branch has not been deployed
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.
What: In the Agents window,
.vscode/settings.jsonof a folder that gets mounted now reaches already-open editors for files in that folder. Removing the folder also notifies them correctly. Before this, adding was silent, and on removalaffectsConfiguration(key, { resource })returned false for files in the removed folder.Changes:
AgentsConfigurationService: computes the change when added folders load (inonWillChangeWorkspaceFolders) and fires it inonDidChangeWorkspaceFolders, merged with removals.WeakMap), so a change that never completes doesn't leak into the next one.[typescript]settings, checked withaffectsConfigurationwith a resource and an override identifier. Plus a silent initialize test.Validation:
./scripts/test.sh --run src/vs/workbench/services/configuration/test/browser/agents/agentsConfigurationService.test.ts: 64 passing. Without the fix, the 2 new add/remove tests fail../scripts/test.sh --runGlob "vs/workbench/services/configuration/test/browser/**/*.test.js": 313 passing, 7 pending.npm run typecheck-client,npm run valid-layers-check,npm run oxlinton the changed files: passed.Written by GitHub Copilot on behalf of Sandeep Somavarapu (@sandy081)