Open
Conversation
Contributor
Screenshot ChangesBase: Changed (2)blocks-ci screenshots changedReplace the contents of Updated blocks-ci-screenshots.md<!-- auto-generated by CI — do not edit manually -->
#### editor/codeEditor/CodeEditor/Dark

#### editor/codeEditor/CodeEditor/Light
 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a performance issue caused by repeated updateReadonly calls firing onDidChangeReadonly for each file, which can cascade into expensive event handling (notably in prompt file registration).
Changes:
- Extend
IFilesConfigurationService.updateReadonlyto acceptURI[]and batch the readonly override updates into a singleonDidChangeReadonlyevent. - Batch readonly updates in
PromptsService(both provider listing and contributed file registration) to avoid per-file events. - Add browser tests to validate event batching behavior for
updateReadonlywith single and multiple resources.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/services/filesConfiguration/test/browser/filesConfigurationService.test.ts | Adds tests ensuring updateReadonly batches events for arrays and handles empty arrays/reset correctly. |
| src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.ts | Updates the service contract and implementation to support URI[] and fire a single readonly-change event per batch. |
| src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts | Batches prompt-file readonly updates to prevent renderer freezes caused by per-file readonly change events. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts:948
- The microtask flush calls
filesConfigService.updateReadonly(...)without awaiting/handling the Promise. Please make the intent explicit (e.g.void ...) and add.catch(...)logging to avoid potential unhandled rejections (especially if a different IFilesConfigurationService implementation throws).
queueMicrotask(() => {
const uris = this._pendingReadonlyUris;
this._pendingReadonlyUris = [];
this._pendingReadonlyFlush = false;
this.filesConfigService.updateReadonly(uris, true);
});
- Files reviewed: 3/3 changed files
- Comments generated: 3
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.
Fixes #280253
If there's a large amount of customizations, we don't want to fire readonly change events in rapid succession. Let's debounce / group these.