Skip to content

Test disabling individual extensions #54865

@sandy081

Description

@sandy081

Refs: #54721

Complexity: 2

You can now disable individual extension using from command line using the argument --disable-extension

  • code --disable-extension pub.a should disable extension pub.a
  • code --disable-extension pub.a --disable-extension pub.b should disable pub.a and pub.b extensions

You can also disable extensions by using the command _workbench.enterWorkspace.

  • Write a simple extension with following code
import * as vscode from 'vscode';

export function activate(context: vscode.ExtensionContext) {
    vscode.commands.registerCommand('test.openWorkspace', () => {
        vscode.commands.executeCommand('_workbench.enterWorkspace', vscode.Uri.file(`${sampleWorkspace}`), ['pub.a', 'pub.b']);
    });
}

// this method is called when your extension is deactivated
export function deactivate() {
}
  • Above command opens the workspace you provided with the given extensions disabled.
    Note: Workspace to be provided should be code-workspace file

  • If the extensions to disable are not running in the window you are running the command, then this will open the workspace without reloading the window.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions