Skip to content

extensions: disable Disable Globally when extension is workspace-enabled only#316728

Open
j-abed wants to merge 1 commit into
microsoft:mainfrom
j-abed:fix-disable-globally-enabledworkspace
Open

extensions: disable Disable Globally when extension is workspace-enabled only#316728
j-abed wants to merge 1 commit into
microsoft:mainfrom
j-abed:fix-disable-globally-enabledworkspace

Conversation

@j-abed
Copy link
Copy Markdown

@j-abed j-abed commented May 15, 2026

Fixes #244138

Summary

DisableGloballyAction was enabled when an extension was EnabledWorkspace.
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

  • Updated DisableGloballyAction.update() to enable only when:
    • extension is installed
    • enablement state is EnablementState.EnabledGlobally
    • global enablement can be changed
  • Added regression test:
    • Test DisableGloballyAction when the extension is only enabled for workspace

Files

  • src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
  • src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts

Before / After

  • Before: "Disable (Globally)" could be enabled for EnabledWorkspace.
  • After: "Disable (Globally)" is enabled only for EnabledGlobally.

Validation

  • Targeted DisableGloballyAction tests pass, including the new regression case.

Copilot AI review requested due to automatic review settings May 15, 2026 23:33
@j-abed
Copy link
Copy Markdown
Author

j-abed commented May 15, 2026

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for EnablementState.EnabledGlobally (plus existing installed/can-change checks).
  • Added a regression test covering the “enabled for workspace only” scenario to ensure DisableGloballyAction is 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.

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.

Disabled and enabled (workspace) extension Disable button dropdown contains both "Disable" and "Disable (Workspace)" items

3 participants