extensions: disable Disable Globally when extension is workspace-enabled only#316728
Open
j-abed wants to merge 1 commit into
Open
extensions: disable Disable Globally when extension is workspace-enabled only#316728j-abed wants to merge 1 commit into
j-abed wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the Extensions UI so that “Disable (Globally)” is not offered when an extension is only enabled for the current workspace (EnablementState.EnabledWorkspace). This aligns the disable options with the actual enablement scope and resolves the reported duplicate-disable-options behavior.
Changes:
- Tightened
DisableGloballyAction.update()so it is enabled only forEnablementState.EnabledGlobally(plus existing installed/can-change checks). - Added a regression test covering the “enabled for workspace only” scenario to ensure
DisableGloballyActionis disabled/hidden.
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 | Adjusts DisableGloballyAction enablement to exclude EnabledWorkspace, preventing “Disable (Globally)” from appearing when it shouldn’t. |
| src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts | Adds a regression test verifying DisableGloballyAction is not enabled when the extension is enabled for workspace only. |
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 #244138
Summary
DisableGloballyActionwas enabled when an extension wasEnabledWorkspace.In that state, the extension is only enabled for the current workspace and is not globally enabled, so "Disable (Globally)" should not be available.
Changes
DisableGloballyAction.update()to enable only when:EnablementState.EnabledGloballyTest DisableGloballyAction when the extension is only enabled for workspaceFiles
Before / After
EnabledWorkspace.EnabledGlobally.Validation
DisableGloballyActiontests pass, including the new regression case.