Fix Extension Disable Button Dropdown (#244138)#300218
Open
Harshithk951 wants to merge 2 commits intomicrosoft:mainfrom
Open
Fix Extension Disable Button Dropdown (#244138)#300218Harshithk951 wants to merge 2 commits intomicrosoft:mainfrom
Harshithk951 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a VS Code Extensions UI bug where the Disable button incorrectly shows a dropdown with redundant options when an extension is disabled globally but enabled for the current workspace.
Changes:
- Update
DisableGloballyAction.update()to additionally checkIWorkbenchExtensionEnablementService.isDisabledGlobally()and disable (hide) the global-disable action when it’s already globally disabled. - Add a regression test covering the “disabled globally + enabled workspace” state to ensure
DisableGloballyActionis not enabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/vs/workbench/contrib/extensions/browser/extensionsActions.ts | Prevents the global disable action from being shown/enabled when the extension is already disabled globally, eliminating the redundant dropdown entry. |
| src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts | Adds a test to validate the new enablement logic for DisableGloballyAction in the globally-disabled + workspace-enabled scenario. |
You can also share your feedback on Copilot code review. Take the survey.
Author
|
@microsoft-github-policy-service agree |
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.
Description
This pull request addresses issue #244138, where the extension "Disable" button incorrectly displays a dropdown with redundant options when an extension is globally disabled but enabled for the current workspace.
Proposed Changes
DisableGloballyAction.update()in src/vs/workbench/contrib/extensions/browser/extensionsActions.ts to check if the extension is already disabled globally usingIExtensionEnablementService.isDisabledGlobally().disabled(effectively hidden viahideOnDisabled).Testing and Verification
Automated Verification:
Test DisableGloballyAction when extension is disabled globally and enabled for workspace.Manual Verification:
Fixes Disabled and enabled (workspace) extension Disable button dropdown contains both "Disable" and "Disable (Workspace)" items #244138