Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

View File

@@ -600,7 +600,6 @@ export class ExtensionEditor extends BaseEditor {
this.contentDisposables.add(webviewElement.onDidFocus(() => this.fireOnDidFocus()));
const removeLayoutParticipant = arrays.insert(this.layoutParticipants, {
layout: () => {
webviewElement.layout();
webviewElement.layoutWebviewOverElement(template.content);
}
});
@@ -867,7 +866,8 @@ export class ExtensionEditor extends BaseEditor {
this.renderViewContainers(content, manifest, layout),
this.renderViews(content, manifest, layout),
this.renderLocalizations(content, manifest, layout),
renderDashboardContributions(content, manifest, layout) // {{SQL CARBON EDIT}}
renderDashboardContributions(content, manifest, layout), // {{SQL CARBON EDIT}}
this.renderCustomEditors(content, manifest, layout),
];
scrollableContent.scanDomNode();
@@ -1067,6 +1067,31 @@ export class ExtensionEditor extends BaseEditor {
return true;
}
private renderCustomEditors(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
const webviewEditors = (manifest.contributes && manifest.contributes.webviewEditors) || [];
if (!webviewEditors.length) {
return false;
}
const details = $('details', { open: true, ontoggle: onDetailsToggle },
$('summary', { tabindex: '0' }, localize('customEditors', "Custom Editors ({0})", webviewEditors.length)),
$('table', undefined,
$('tr', undefined,
$('th', undefined, localize('customEditors view type', "View Type")),
$('th', undefined, localize('customEditors priority', "Priority")),
$('th', undefined, localize('customEditors filenamePattern', "Filename Pattern"))),
...webviewEditors.map(webviewEditor =>
$('tr', undefined,
$('td', undefined, webviewEditor.viewType),
$('td', undefined, webviewEditor.priority),
$('td', undefined, arrays.coalesce(webviewEditor.selector.map(x => x.filenamePattern)).join(', '))))
)
);
append(container, details);
return true;
}
private renderColorThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
const contributes = manifest.contributes;
const contrib = contributes && contributes.themes || [];
@@ -1339,12 +1364,10 @@ export class ExtensionEditor extends BaseEditor {
private loadContents<T>(loadingTask: () => CacheResult<T>, template: IExtensionEditorTemplate): Promise<T> {
addClass(template.content, 'loading');
const result = loadingTask();
const result = this.contentDisposables.add(loadingTask());
const onDone = () => removeClass(template.content, 'loading');
result.promise.then(onDone, onDone);
this.contentDisposables.add(toDisposable(() => result.dispose()));
return result.promise;
}

View File

@@ -87,7 +87,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
private _allIgnoredRecommendations: string[] = [];
private _globallyIgnoredRecommendations: string[] = [];
private _workspaceIgnoredRecommendations: string[] = [];
private _extensionsRecommendationsUrl: string;
private _extensionsRecommendationsUrl: string | undefined;
public loadWorkspaceConfigPromise: Promise<void>;
private proactiveRecommendationsFetched: boolean = false;
@@ -120,9 +120,10 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
) {
super();
// {{SQL CARBON EDIT}}
let extensionPolicy: string = this.configurationService.getValue<string>(ExtensionsPolicyKey);
const extensionPolicy = this.configurationService.getValue<string>(ExtensionsPolicyKey); // {{SQL CARBON EDIT}}
if (!this.isEnabled() || extensionPolicy === ExtensionsPolicy.allowNone) {
this.sessionSeed = 0;
this.loadWorkspaceConfigPromise = Promise.resolve();
return;
}
@@ -533,7 +534,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
const tip = this._importantExeBasedRecommendations[extensionId];
/* __GDPR__
exeExtensionRecommendations:alreadyInstalled" : {
"exeExtensionRecommendations:alreadyInstalled" : {
"extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" },
"exeName": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
}

View File

@@ -146,8 +146,8 @@ export abstract class ExtensionAction extends Action implements IExtensionContai
export class InstallAction extends ExtensionAction {
private static INSTALL_LABEL = localize('install', "Install");
private static INSTALLING_LABEL = localize('installing', "Installing");
private static readonly INSTALL_LABEL = localize('install', "Install");
private static readonly INSTALLING_LABEL = localize('installing', "Installing");
private static readonly Class = 'extension-action prominent install';
private static readonly InstallingClass = 'extension-action install installing';
@@ -289,8 +289,8 @@ export class InstallAction extends ExtensionAction {
export abstract class InstallInOtherServerAction extends ExtensionAction {
protected static INSTALL_LABEL = localize('install', "Install");
protected static INSTALLING_LABEL = localize('installing', "Installing");
protected static readonly INSTALL_LABEL = localize('install', "Install");
protected static readonly INSTALLING_LABEL = localize('installing', "Installing");
private static readonly Class = 'extension-action prominent install';
private static readonly InstallingClass = 'extension-action install installing';
@@ -586,7 +586,7 @@ export class ExtensionActionViewItem extends ActionViewItem {
updateEnabled(): void {
super.updateEnabled();
if (this.options.tabOnlyOnFocus && this.getAction().enabled && !this._hasFocus) {
if (this.label && this.options.tabOnlyOnFocus && this.getAction().enabled && !this._hasFocus) {
DOM.removeTabIndexAndUpdateFocus(this.label);
}
}
@@ -597,7 +597,7 @@ export class ExtensionActionViewItem extends ActionViewItem {
return;
}
this._hasFocus = value;
if (this.getAction().enabled) {
if (this.label && this.getAction().enabled) {
if (this._hasFocus) {
this.label.tabIndex = 0;
} else {
@@ -746,7 +746,7 @@ export class ManageExtensionAction extends ExtensionDropDownAction {
export class InstallAnotherVersionAction extends ExtensionAction {
static readonly ID = 'workbench.extensions.action.install.anotherVersion';
static LABEL = localize('install another version', "Install Another Version...");
static readonly LABEL = localize('install another version', "Install Another Version...");
constructor(
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
@@ -852,7 +852,7 @@ export class ExtensionSettingsAction extends ExtensionAction {
export class EnableForWorkspaceAction extends ExtensionAction {
static readonly ID = 'extensions.enableForWorkspace';
static LABEL = localize('enableForWorkspaceAction', "Enable (Workspace)");
static readonly LABEL = localize('enableForWorkspaceAction', "Enable (Workspace)");
constructor(
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
@@ -879,7 +879,7 @@ export class EnableForWorkspaceAction extends ExtensionAction {
export class EnableGloballyAction extends ExtensionAction {
static readonly ID = 'extensions.enableGlobally';
static LABEL = localize('enableGloballyAction', "Enable");
static readonly LABEL = localize('enableGloballyAction', "Enable");
constructor(
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
@@ -906,7 +906,7 @@ export class EnableGloballyAction extends ExtensionAction {
export class DisableForWorkspaceAction extends ExtensionAction {
static readonly ID = 'extensions.disableForWorkspace';
static LABEL = localize('disableForWorkspaceAction', "Disable (Workspace)");
static readonly LABEL = localize('disableForWorkspaceAction', "Disable (Workspace)");
constructor(readonly runningExtensions: IExtensionDescription[],
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
@@ -934,7 +934,7 @@ export class DisableForWorkspaceAction extends ExtensionAction {
export class DisableGloballyAction extends ExtensionAction {
static readonly ID = 'extensions.disableGlobally';
static LABEL = localize('disableGloballyAction', "Disable");
static readonly LABEL = localize('disableGloballyAction', "Disable");
constructor(readonly runningExtensions: IExtensionDescription[],
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
@@ -1030,7 +1030,7 @@ export class DisableDropDownAction extends ExtensionEditorDropDownAction {
export class CheckForUpdatesAction extends Action {
static readonly ID = 'workbench.extensions.action.checkForUpdates';
static LABEL = localize('checkForUpdates', "Check for Extension Updates");
static readonly LABEL = localize('checkForUpdates', "Check for Extension Updates");
constructor(
id = CheckForUpdatesAction.ID,
@@ -1102,7 +1102,7 @@ export class ToggleAutoUpdateAction extends Action {
export class EnableAutoUpdateAction extends ToggleAutoUpdateAction {
static readonly ID = 'workbench.extensions.action.enableAutoUpdate';
static LABEL = localize('enableAutoUpdate', "Enable Auto Updating Extensions");
static readonly LABEL = localize('enableAutoUpdate', "Enable Auto Updating Extensions");
constructor(
id = EnableAutoUpdateAction.ID,
@@ -1116,7 +1116,7 @@ export class EnableAutoUpdateAction extends ToggleAutoUpdateAction {
export class DisableAutoUpdateAction extends ToggleAutoUpdateAction {
static readonly ID = 'workbench.extensions.action.disableAutoUpdate';
static LABEL = localize('disableAutoUpdate', "Disable Auto Updating Extensions");
static readonly LABEL = localize('disableAutoUpdate', "Disable Auto Updating Extensions");
constructor(
id = EnableAutoUpdateAction.ID,
@@ -1130,7 +1130,7 @@ export class DisableAutoUpdateAction extends ToggleAutoUpdateAction {
export class UpdateAllAction extends Action {
static readonly ID = 'workbench.extensions.action.updateAllExtensions';
static LABEL = localize('updateAll', "Update All Extensions");
static readonly LABEL = localize('updateAll', "Update All Extensions");
constructor(
id = UpdateAllAction.ID,
@@ -1440,7 +1440,7 @@ export class InstallExtensionsAction extends OpenExtensionsViewletAction {
export class ShowEnabledExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showEnabledExtensions';
static LABEL = localize('showEnabledExtensions', "Show Enabled Extensions");
static readonly LABEL = localize('showEnabledExtensions', "Show Enabled Extensions");
constructor(
id: string,
@@ -1463,7 +1463,7 @@ export class ShowEnabledExtensionsAction extends Action {
export class ShowInstalledExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showInstalledExtensions';
static LABEL = localize('showInstalledExtensions', "Show Installed Extensions");
static readonly LABEL = localize('showInstalledExtensions', "Show Installed Extensions");
constructor(
id: string,
@@ -1486,7 +1486,7 @@ export class ShowInstalledExtensionsAction extends Action {
export class ShowDisabledExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showDisabledExtensions';
static LABEL = localize('showDisabledExtensions', "Show Disabled Extensions");
static readonly LABEL = localize('showDisabledExtensions', "Show Disabled Extensions");
constructor(
id: string,
@@ -1509,7 +1509,7 @@ export class ShowDisabledExtensionsAction extends Action {
export class ClearExtensionsInputAction extends Action {
static readonly ID = 'workbench.extensions.action.clearExtensionsInput';
static LABEL = localize('clearExtensionsInput', "Clear Extensions Input");
static readonly LABEL = localize('clearExtensionsInput', "Clear Extensions Input");
constructor(
id: string,
@@ -1540,7 +1540,7 @@ export class ClearExtensionsInputAction extends Action {
export class ShowBuiltInExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.listBuiltInExtensions';
static LABEL = localize('showBuiltInExtensions', "Show Built-in Extensions");
static readonly LABEL = localize('showBuiltInExtensions', "Show Built-in Extensions");
constructor(
id: string,
@@ -1563,7 +1563,7 @@ export class ShowBuiltInExtensionsAction extends Action {
export class ShowOutdatedExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.listOutdatedExtensions';
static LABEL = localize('showOutdatedExtensions', "Show Outdated Extensions");
static readonly LABEL = localize('showOutdatedExtensions', "Show Outdated Extensions");
constructor(
id: string,
@@ -1586,7 +1586,7 @@ export class ShowOutdatedExtensionsAction extends Action {
export class ShowPopularExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showPopularExtensions';
static LABEL = localize('showPopularExtensions', "Show Popular Extensions");
static readonly LABEL = localize('showPopularExtensions', "Show Popular Extensions");
constructor(
id: string,
@@ -1609,7 +1609,7 @@ export class ShowPopularExtensionsAction extends Action {
export class ShowRecommendedExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showRecommendedExtensions';
static LABEL = localize('showRecommendedExtensions', "Show Recommended Extensions");
static readonly LABEL = localize('showRecommendedExtensions', "Show Recommended Extensions");
constructor(
id: string,
@@ -1632,7 +1632,7 @@ export class ShowRecommendedExtensionsAction extends Action {
export class InstallWorkspaceRecommendedExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.installWorkspaceRecommendedExtensions';
static LABEL = localize('installWorkspaceRecommendedExtensions', "Install All Workspace Recommended Extensions");
static readonly LABEL = localize('installWorkspaceRecommendedExtensions', "Install All Workspace Recommended Extensions");
private _recommendations: IExtensionRecommendation[] = [];
get recommendations(): IExtensionRecommendation[] { return this._recommendations; }
@@ -1697,7 +1697,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action {
export class InstallRecommendedExtensionAction extends Action {
static readonly ID = 'workbench.extensions.action.installRecommendedExtension';
static LABEL = localize('installRecommendedExtension', "Install Recommended Extension");
static readonly LABEL = localize('installRecommendedExtension', "Install Recommended Extension");
private extensionId: string;
@@ -1788,7 +1788,7 @@ export class UndoIgnoreExtensionRecommendationAction extends Action {
export class ShowRecommendedKeymapExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showRecommendedKeymapExtensions';
static SHORT_LABEL = localize('showRecommendedKeymapExtensionsShort', "Keymaps");
static readonly SHORT_LABEL = localize('showRecommendedKeymapExtensionsShort', "Keymaps");
constructor(
id: string,
@@ -1811,7 +1811,7 @@ export class ShowRecommendedKeymapExtensionsAction extends Action {
export class ShowLanguageExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showLanguageExtensions';
static SHORT_LABEL = localize('showLanguageExtensionsShort', "Language Extensions");
static readonly SHORT_LABEL = localize('showLanguageExtensionsShort', "Language Extensions");
constructor(
id: string,
@@ -1834,7 +1834,7 @@ export class ShowLanguageExtensionsAction extends Action {
export class ShowAzureExtensionsAction extends Action {
static readonly ID = 'workbench.extensions.action.showAzureExtensions';
static SHORT_LABEL = localize('showAzureExtensionsShort', "Azure Extensions");
static readonly SHORT_LABEL = localize('showAzureExtensionsShort', "Azure Extensions");
constructor(
id: string,
@@ -2176,7 +2176,7 @@ export abstract class AbstractConfigureRecommendedExtensionsAction extends Actio
export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
static readonly ID = 'workbench.extensions.action.configureWorkspaceRecommendedExtensions';
static LABEL = localize('configureWorkspaceRecommendedExtensions', "Configure Recommended Extensions (Workspace)");
static readonly LABEL = localize('configureWorkspaceRecommendedExtensions', "Configure Recommended Extensions (Workspace)");
constructor(
@@ -2212,7 +2212,7 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfi
export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends AbstractConfigureRecommendedExtensionsAction {
static readonly ID = 'workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions';
static LABEL = localize('configureWorkspaceFolderRecommendedExtensions', "Configure Recommended Extensions (Workspace Folder)");
static readonly LABEL = localize('configureWorkspaceFolderRecommendedExtensions', "Configure Recommended Extensions (Workspace Folder)");
constructor(
@@ -2685,7 +2685,7 @@ export class SystemDisabledWarningAction extends ExtensionAction {
export class DisableAllAction extends Action {
static readonly ID = 'workbench.extensions.action.disableAll';
static LABEL = localize('disableAll', "Disable All Installed Extensions");
static readonly LABEL = localize('disableAll', "Disable All Installed Extensions");
constructor(
@@ -2710,7 +2710,7 @@ export class DisableAllAction extends Action {
export class DisableAllWorkspaceAction extends Action {
static readonly ID = 'workbench.extensions.action.disableAllWorkspace';
static LABEL = localize('disableAllWorkspace', "Disable All Installed Extensions for this Workspace");
static readonly LABEL = localize('disableAllWorkspace', "Disable All Installed Extensions for this Workspace");
constructor(
@@ -2737,7 +2737,7 @@ export class DisableAllWorkspaceAction extends Action {
export class EnableAllAction extends Action {
static readonly ID = 'workbench.extensions.action.enableAll';
static LABEL = localize('enableAll', "Enable All Extensions");
static readonly LABEL = localize('enableAll', "Enable All Extensions");
constructor(
@@ -2762,7 +2762,7 @@ export class EnableAllAction extends Action {
export class EnableAllWorkspaceAction extends Action {
static readonly ID = 'workbench.extensions.action.enableAllWorkspace';
static LABEL = localize('enableAllWorkspace', "Enable All Extensions for this Workspace");
static readonly LABEL = localize('enableAllWorkspace', "Enable All Extensions for this Workspace");
constructor(
@@ -2789,7 +2789,7 @@ export class EnableAllWorkspaceAction extends Action {
export class InstallVSIXAction extends Action {
static readonly ID = 'workbench.extensions.action.installVSIX';
static LABEL = localize('installVSIX', "Install from VSIX...");
static readonly LABEL = localize('installVSIX', "Install from VSIX...");
constructor(
id = InstallVSIXAction.ID,
@@ -2889,7 +2889,7 @@ export class InstallVSIXAction extends Action {
export class ReinstallAction extends Action {
static readonly ID = 'workbench.extensions.action.reinstall';
static LABEL = localize('reinstall', "Reinstall Extension...");
static readonly LABEL = localize('reinstall', "Reinstall Extension...");
constructor(
id: string = ReinstallAction.ID, label: string = ReinstallAction.LABEL,
@@ -2956,7 +2956,7 @@ export class ReinstallAction extends Action {
export class InstallSpecificVersionOfExtensionAction extends Action {
static readonly ID = 'workbench.extensions.action.install.specificVersion';
static LABEL = localize('install previous version', "Install Specific Version of Extension...");
static readonly LABEL = localize('install previous version', "Install Specific Version of Extension...");
constructor(
id: string = InstallSpecificVersionOfExtensionAction.ID, label: string = InstallSpecificVersionOfExtensionAction.LABEL,

View File

@@ -213,7 +213,7 @@ export class ExtensionsTree extends WorkbenchAsyncDataTree<IExtensionData, IExte
this.setInput(input);
this.disposables.push(this.onDidChangeSelection(event => {
this.disposables.add(this.onDidChangeSelection(event => {
if (event.browserEvent && event.browserEvent instanceof KeyboardEvent) {
extensionsWorkdbenchService.open(event.elements[0].extension, false);
}

View File

@@ -787,10 +787,10 @@ export class ExtensionsListView extends ViewletPanel {
if (count === 0 && this.isBodyVisible()) {
if (error) {
if (error instanceof ExtensionListViewWarning) {
this.bodyTemplate.messageSeverityIcon.className = SeverityIcon.className(Severity.Warning);
this.bodyTemplate.messageSeverityIcon.className = `codicon ${SeverityIcon.className(Severity.Warning)}`;
this.bodyTemplate.messageBox.textContent = getErrorMessage(error);
} else {
this.bodyTemplate.messageSeverityIcon.className = SeverityIcon.className(Severity.Error);
this.bodyTemplate.messageSeverityIcon.className = `codicon ${SeverityIcon.className(Severity.Error)}`;
this.bodyTemplate.messageBox.textContent = localize('error', "Error while loading extensions. {0}", getErrorMessage(error));
}
} else {
@@ -961,7 +961,7 @@ export class ServerExtensionsView extends ExtensionsListView {
getActions(): IAction[] {
if (this.extensionManagementServerService.remoteExtensionManagementServer && this.extensionManagementServerService.localExtensionManagementServer === this.server) {
const installLocalExtensionsInRemoteAction = this._register(this.instantiationService.createInstance(InstallLocalExtensionsInRemoteAction));
installLocalExtensionsInRemoteAction.class = 'octicon octicon-cloud-download';
installLocalExtensionsInRemoteAction.class = 'codicon codicon-cloud-download';
return [installLocalExtensionsInRemoteAction];
}
return [];
@@ -1060,11 +1060,11 @@ export class WorkspaceRecommendedExtensionsView extends ExtensionsListView {
getActions(): IAction[] {
if (!this.installAllAction) {
this.installAllAction = this._register(this.instantiationService.createInstance(InstallWorkspaceRecommendedExtensionsAction, InstallWorkspaceRecommendedExtensionsAction.ID, InstallWorkspaceRecommendedExtensionsAction.LABEL, []));
this.installAllAction.class = 'octicon octicon-cloud-download';
this.installAllAction.class = 'codicon codicon-cloud-download';
}
const configureWorkspaceFolderAction = this._register(this.instantiationService.createInstance(ConfigureWorkspaceFolderRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction.ID, ConfigureWorkspaceFolderRecommendedExtensionsAction.LABEL));
configureWorkspaceFolderAction.class = 'octicon octicon-pencil';
configureWorkspaceFolderAction.class = 'codicon codicon-pencil';
return [this.installAllAction, configureWorkspaceFolderAction];
}

View File

@@ -81,7 +81,7 @@ export class InstallCountWidget extends ExtensionWidget {
installLabel = installCount.toLocaleString(platform.locale);
}
append(this.container, $('span.octicon.octicon-cloud-download'));
append(this.container, $('span.codicon.codicon-cloud-download'));
const count = append(this.container, $('span.count'));
count.textContent = installLabel;
}
@@ -224,7 +224,7 @@ export class RecommendationWidget extends ExtensionWidget {
if (extRecommendations[this.extension.identifier.id.toLowerCase()]) {
this.element = append(this.parent, $('div.bookmark'));
const recommendation = append(this.element, $('.recommendation'));
append(recommendation, $('span.octicon.octicon-star'));
append(recommendation, $('span.codicon.codicon-star'));
const applyBookmarkStyle = (theme: ITheme) => {
const bgColor = theme.getColor(extensionButtonProminentBackground);
const fgColor = theme.getColor(extensionButtonProminentForeground);
@@ -290,7 +290,7 @@ class RemoteBadge extends Disposable {
}
private render(): void {
append(this.element, $('span.octicon.octicon-remote'));
append(this.element, $('span.codicon.codicon-remote'));
const applyBadgeStyle = () => {
if (!this.element) {

View File

@@ -15,7 +15,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
// {{SQL CARBON EDIT}}
import {
IExtensionManagementService, IExtensionGalleryService, ILocalExtension, IGalleryExtension, IQueryOptions,
InstallExtensionEvent, DidInstallExtensionEvent, DidUninstallExtensionEvent, IExtensionIdentifier
InstallExtensionEvent, DidInstallExtensionEvent, DidUninstallExtensionEvent, IExtensionIdentifier, InstallOperation
} from 'vs/platform/extensionManagement/common/extensionManagement';
import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
import { getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData, areSameExtensions, getMaliciousExtensionsSet, groupByExtension, ExtensionIdentifierWithVersion } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
@@ -25,7 +25,7 @@ import { IHostService } from 'vs/workbench/services/host/browser/host';
import { URI } from 'vs/base/common/uri';
import { IExtension, ExtensionState, IExtensionsWorkbenchService, AutoUpdateConfigurationKey, AutoCheckUpdatesConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions';
import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService';
import { IURLService, IURLHandler } from 'vs/platform/url/common/url';
import { IURLService, IURLHandler, IOpenURLOptions } from 'vs/platform/url/common/url';
import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput';
import { ILogService } from 'vs/platform/log/common/log';
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
@@ -323,8 +323,8 @@ ${this.description}
class Extensions extends Disposable {
private readonly _onChange: Emitter<Extension | undefined> = new Emitter<Extension | undefined>();
get onChange(): Event<Extension | undefined> { return this._onChange.event; }
private readonly _onChange: Emitter<{ extension: Extension, operation?: InstallOperation } | undefined> = this._register(new Emitter<{ extension: Extension, operation?: InstallOperation } | undefined>());
get onChange(): Event<{ extension: Extension, operation?: InstallOperation } | undefined> { return this._onChange.event; }
private installing: Extension[] = [];
private uninstalling: Extension[] = [];
@@ -385,7 +385,7 @@ class Extensions extends Disposable {
const local = extension.local.metadata ? extension.local : await this.server.extensionManagementService.updateMetadata(extension.local, { id: compatible.identifier.uuid, publisherDisplayName: compatible.publisherDisplayName, publisherId: compatible.publisherId });
extension.local = local;
extension.gallery = compatible;
this._onChange.fire(extension);
this._onChange.fire({ extension });
return true;
}
return false;
@@ -412,7 +412,7 @@ class Extensions extends Disposable {
const extension = this.installed.filter(e => areSameExtensions(e.identifier, gallery.identifier))[0]
|| this.instantiationService.createInstance(Extension, this.stateProvider, this.server, undefined, gallery);
this.installing.push(extension);
this._onChange.fire(extension);
this._onChange.fire({ extension });
}
}
@@ -436,9 +436,10 @@ class Extensions extends Disposable {
if (!extension.gallery) {
extension.gallery = gallery;
}
extension.enablementState = this.extensionEnablementService.getEnablementState(local);
}
}
this._onChange.fire(error ? undefined : extension);
this._onChange.fire(error || !extension ? undefined : { extension, operation: event.operation });
}
private onUninstallExtension(identifier: IExtensionIdentifier): void {
@@ -446,7 +447,7 @@ class Extensions extends Disposable {
if (extension) {
const uninstalling = this.uninstalling.filter(e => areSameExtensions(e.identifier, identifier))[0] || extension;
this.uninstalling = [uninstalling, ...this.uninstalling.filter(e => !areSameExtensions(e.identifier, identifier))];
this._onChange.fire(uninstalling);
this._onChange.fire(uninstalling ? { extension: uninstalling } : undefined);
}
}
@@ -457,7 +458,7 @@ class Extensions extends Disposable {
const uninstalling = this.uninstalling.filter(e => areSameExtensions(e.identifier, identifier))[0];
this.uninstalling = this.uninstalling.filter(e => !areSameExtensions(e.identifier, identifier));
if (uninstalling) {
this._onChange.fire(uninstalling);
this._onChange.fire({ extension: uninstalling });
}
}
@@ -468,7 +469,7 @@ class Extensions extends Disposable {
const enablementState = this.extensionEnablementService.getEnablementState(extension.local);
if (enablementState !== extension.enablementState) {
(extension as Extension).enablementState = enablementState;
this._onChange.fire(extension as Extension);
this._onChange.fire({ extension: extension as Extension });
}
}
}
@@ -522,11 +523,13 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
super();
if (this.extensionManagementServerService.localExtensionManagementServer) {
this.localExtensions = this._register(instantiationService.createInstance(Extensions, extensionManagementServerService.localExtensionManagementServer, ext => this.getExtensionState(ext)));
this._register(this.localExtensions.onChange(e => this._onChange.fire(e)));
this._register(this.localExtensions.onChange(e => this._onChange.fire(e ? e.extension : undefined)));
this._register(Event.filter(this.localExtensions.onChange, e => !!e && e.operation === InstallOperation.Install)(e => this.onDidInstallExtension(e!.extension)));
}
if (this.extensionManagementServerService.remoteExtensionManagementServer) {
this.remoteExtensions = this._register(instantiationService.createInstance(Extensions, extensionManagementServerService.remoteExtensionManagementServer, ext => this.getExtensionState(ext)));
this._register(this.remoteExtensions.onChange(e => this._onChange.fire(e)));
this._register(this.remoteExtensions.onChange(e => this._onChange.fire(e ? e.extension : undefined)));
this._register(Event.filter(this.remoteExtensions.onChange, e => !!e && e.operation === InstallOperation.Install)(e => this.onDidInstallExtension(e!.extension)));
}
this.syncDelayer = new ThrottledDelayer<void>(ExtensionsWorkbenchService.SyncPeriod);
@@ -807,7 +810,6 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
// Prompt the user about the error detail.
try {
const { identifier } = await this.extensionService.install(extension);
this.checkAndEnableDisabledDependencies(identifier);
return this.local.filter(local => areSameExtensions(local.identifier, identifier))[0];
} catch (error) {
this.notificationService.error(error);
@@ -840,12 +842,12 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
// {{SQL CARBON EDIT}} remove extensionservice install from gallery
if (extensionPolicy === ExtensionsPolicy.allowMicrosoft) {
if (extension.publisherDisplayName === 'Microsoft') {
await this.downloadOrBrowse(extension).then(() => this.checkAndEnableDisabledDependencies(gallery.identifier));
await this.downloadOrBrowse(extension);
} else {
return Promise.resolve(null);
}
}
await this.downloadOrBrowse(extension).then(() => this.checkAndEnableDisabledDependencies(gallery.identifier));
await this.downloadOrBrowse(extension);
return this.local.filter(local => areSameExtensions(local.identifier, gallery.identifier))[0];
}, gallery.displayName);
}
@@ -942,15 +944,8 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
}
}
private checkAndEnableDisabledDependencies(extensionIdentifier: IExtensionIdentifier): Promise<void> {
const extension = this.local.filter(e => (e.local || e.gallery) && areSameExtensions(extensionIdentifier, e.identifier))[0];
if (extension) {
const disabledDepencies = this.getExtensionsRecursively([extension], this.local, EnablementState.EnabledGlobally, { dependencies: true, pack: false });
if (disabledDepencies.length) {
return this.setEnablement(disabledDepencies, EnablementState.EnabledGlobally);
}
}
return Promise.resolve();
private onDidInstallExtension(extension: IExtension): void {
this.setEnablement(extension, EnablementState.EnabledGlobally);
}
private promptAndSetEnablement(extensions: IExtension[], enablementState: EnablementState): Promise<any> {
@@ -1103,7 +1098,7 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
this.notificationService.error(err);
}
handleURL(uri: URI): Promise<boolean> {
handleURL(uri: URI, options?: IOpenURLOptions): Promise<boolean> {
if (!/^extension/.test(uri.path)) {
return Promise.resolve(false);
}

View File

@@ -46,7 +46,7 @@
justify-content: center;
}
.extension-editor > .header > .icon-container .extension-remote-badge .octicon {
.extension-editor > .header > .icon-container .extension-remote-badge .codicon {
font-size: 28px;
}

View File

@@ -8,9 +8,9 @@
}
.extensions-viewlet > .header {
height: 38px;
height: 41px;
box-sizing: border-box;
padding: 5px 9px 5px 16px;
padding: 5px 12px 6px 16px;
}
.extensions-viewlet > .header > .search-box {
@@ -31,7 +31,7 @@
margin-right: 4px;
}
.extensions-viewlet > .extensions .extension-view-header .monaco-action-bar .action-item > .action-label.icon.octicon {
.extensions-viewlet > .extensions .extension-view-header .monaco-action-bar .action-item > .action-label.icon.codicon {
vertical-align: middle;
line-height: 22px;
}
@@ -47,7 +47,7 @@
}
.extensions-viewlet > .extensions .panel-header {
padding-right: 6px;
padding-right: 12px;
}
.extensions-viewlet > .extensions .panel-header > .title {
@@ -84,10 +84,11 @@
box-sizing: border-box;
}
.extensions-viewlet > .extensions .monaco-list-row > .bookmark > .recommendation > .octicon {
.extensions-viewlet > .extensions .monaco-list-row > .bookmark > .recommendation > .codicon {
position: absolute;
top: 1px;
left: 1px;
color: inherit;
font-size: 90%;
}
@@ -146,7 +147,7 @@
justify-content: center;
}
.extensions-viewlet > .extensions .monaco-list-row > .extension > .details > .header-container > .header .extension-remote-badge > .octicon {
.extensions-viewlet > .extensions .monaco-list-row > .extension > .details > .header-container > .header .extension-remote-badge > .codicon {
font-size: 12px;
}
@@ -200,7 +201,7 @@
margin: 0 6px;
}
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count > .octicon {
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count > .codicon {
font-size: 120%;
margin-right: 2px;
}

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -107,12 +107,12 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio
}
}
public startProfiling(): Promise<any> | null {
public async startProfiling(): Promise<any> {
if (this._state !== ProfileSessionState.None) {
return null;
}
const inspectPort = this._extensionService.getInspectPort();
const inspectPort = await this._extensionService.getInspectPort(false);
if (!inspectPort) {
return this._dialogService.confirm({
type: 'info',

View File

@@ -14,7 +14,7 @@ import { Schemas } from 'vs/base/common/network';
export class OpenExtensionsFolderAction extends Action {
static readonly ID = 'workbench.extensions.action.openExtensionsFolder';
static LABEL = localize('openExtensionsFolder', "Open Extensions Folder");
static readonly LABEL = localize('openExtensionsFolder', "Open Extensions Folder");
constructor(
id: string,

View File

@@ -43,7 +43,7 @@ export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchCont
private async _onDidChangeResponsiveChange(event: IResponsiveStateChangeEvent): Promise<void> {
const port = this._extensionService.getInspectPort();
const port = await this._extensionService.getInspectPort(true);
if (!port) {
return;

View File

@@ -38,7 +38,7 @@ import { randomPort } from 'vs/base/node/ports';
import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { ILabelService } from 'vs/platform/label/common/label';
import { renderOcticons } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
import { renderCodicons } from 'vs/base/browser/ui/codiconLabel/codiconLabel';
import { ExtensionIdentifier, ExtensionType, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
import { SlowExtensionAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsSlowActions';
@@ -364,31 +364,31 @@ export class RuntimeExtensionsEditor extends BaseEditor {
if (this._extensionHostProfileService.getUnresponsiveProfile(element.description.identifier)) {
const el = $('span');
el.innerHTML = renderOcticons(` $(alert) Unresponsive`);
el.innerHTML = renderCodicons(` $(alert) Unresponsive`);
el.title = nls.localize('unresponsive.title', "Extension has caused the extension host to freeze.");
data.msgContainer.appendChild(el);
}
if (isNonEmptyArray(element.status.runtimeErrors)) {
const el = $('span');
el.innerHTML = renderOcticons(`$(bug) ${nls.localize('errors', "{0} uncaught errors", element.status.runtimeErrors.length)}`);
el.innerHTML = renderCodicons(`$(bug) ${nls.localize('errors', "{0} uncaught errors", element.status.runtimeErrors.length)}`);
data.msgContainer.appendChild(el);
}
if (element.status.messages && element.status.messages.length > 0) {
const el = $('span');
el.innerHTML = renderOcticons(`$(alert) ${element.status.messages[0].message}`);
el.innerHTML = renderCodicons(`$(alert) ${element.status.messages[0].message}`);
data.msgContainer.appendChild(el);
}
if (element.description.extensionLocation.scheme !== 'file') {
const el = $('span');
el.innerHTML = renderOcticons(`$(remote) ${element.description.extensionLocation.authority}`);
el.innerHTML = renderCodicons(`$(remote) ${element.description.extensionLocation.authority}`);
data.msgContainer.appendChild(el);
const hostLabel = this._labelService.getHostLabel(REMOTE_HOST_SCHEME, this._environmentService.configuration.remoteAuthority);
if (hostLabel) {
el.innerHTML = renderOcticons(`$(remote) ${hostLabel}`);
el.innerHTML = renderCodicons(`$(remote) ${hostLabel}`);
}
}
@@ -459,7 +459,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
export class ShowRuntimeExtensionsAction extends Action {
static readonly ID = 'workbench.action.showRuntimeExtensions';
static LABEL = nls.localize('showRuntimeExtensions', "Show Running Extensions");
static readonly LABEL = nls.localize('showRuntimeExtensions', "Show Running Extensions");
constructor(
id: string, label: string,
@@ -477,7 +477,7 @@ export class ShowRuntimeExtensionsAction extends Action {
export class ReportExtensionIssueAction extends Action {
private static readonly _id = 'workbench.extensions.action.reportExtensionIssue';
private static _label = nls.localize('reportExtensionIssue', "Report Issue");
private static readonly _label = nls.localize('reportExtensionIssue', "Report Issue");
private readonly _url: string;
@@ -533,8 +533,8 @@ export class ReportExtensionIssueAction extends Action {
export class DebugExtensionHostAction extends Action {
static readonly ID = 'workbench.extensions.action.debugExtensionHost';
static LABEL = nls.localize('debugExtensionHost', "Start Debugging Extension Host");
static CSS_CLASS = 'debug-extension-host';
static readonly LABEL = nls.localize('debugExtensionHost', "Start Debugging Extension Host");
static readonly CSS_CLASS = 'debug-extension-host';
constructor(
@IDebugService private readonly _debugService: IDebugService,
@@ -547,7 +547,7 @@ export class DebugExtensionHostAction extends Action {
async run(): Promise<any> {
const inspectPort = this._extensionService.getInspectPort();
const inspectPort = await this._extensionService.getInspectPort(false);
if (!inspectPort) {
const res = await this._dialogService.confirm({
type: 'info',
@@ -557,8 +557,10 @@ export class DebugExtensionHostAction extends Action {
secondaryButton: nls.localize('cancel', "Cancel")
});
if (res.confirmed) {
this._electronService.relaunch({ addArgs: [`--inspect-extensions=${randomPort()}`] });
await this._electronService.relaunch({ addArgs: [`--inspect-extensions=${randomPort()}`] });
}
return;
}
return this._debugService.startDebugging(undefined, {
@@ -572,7 +574,7 @@ export class DebugExtensionHostAction extends Action {
export class StartExtensionHostProfileAction extends Action {
static readonly ID = 'workbench.extensions.action.extensionHostProfile';
static LABEL = nls.localize('extensionHostProfileStart', "Start Extension Host Profile");
static readonly LABEL = nls.localize('extensionHostProfileStart', "Start Extension Host Profile");
constructor(
id: string = StartExtensionHostProfileAction.ID, label: string = StartExtensionHostProfileAction.LABEL,
@@ -589,7 +591,7 @@ export class StartExtensionHostProfileAction extends Action {
export class StopExtensionHostProfileAction extends Action {
static readonly ID = 'workbench.extensions.action.stopExtensionHostProfile';
static LABEL = nls.localize('stopExtensionHostProfileStart', "Stop Extension Host Profile");
static readonly LABEL = nls.localize('stopExtensionHostProfileStart', "Stop Extension Host Profile");
constructor(
id: string = StartExtensionHostProfileAction.ID, label: string = StartExtensionHostProfileAction.LABEL,
@@ -606,7 +608,7 @@ export class StopExtensionHostProfileAction extends Action {
export class SaveExtensionHostProfileAction extends Action {
static LABEL = nls.localize('saveExtensionHostProfile', "Save Extension Host Profile");
static readonly LABEL = nls.localize('saveExtensionHostProfile', "Save Extension Host Profile");
static readonly ID = 'workbench.extensions.action.saveExtensionHostProfile';
constructor(
@@ -636,7 +638,7 @@ export class SaveExtensionHostProfileAction extends Action {
}]
});
if (!picked || !picked.filePath) {
if (!picked || !picked.filePath || picked.canceled) {
return;
}

View File

@@ -305,7 +305,6 @@ suite.skip('ExtensionsTipsService Test', () => { // {{SQL CARBON EDIT}} skip sui
function testNoPromptOrRecommendationsForValidRecommendations(recommendations: string[]) {
return setUpFolderWorkspace('myFolder', mockTestData.validRecommendedExtensions).then(() => {
testObject = instantiationService.createInstance(ExtensionTipsService);
assert.equal(!testObject.loadWorkspaceConfigPromise, true);
assert.ok(!prompted);
return testObject.getWorkspaceRecommendations().then(() => {

View File

@@ -942,6 +942,46 @@ suite('ExtensionsWorkbenchServiceTest', () => {
});
});
test('test installing an extension re-eanbles it when disabled globally', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.EnabledGlobally);
});
test('test updating an extension does not re-eanbles it when disabled globally', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledGlobally);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.DisabledGlobally);
});
test('test installing an extension re-eanbles it when workspace disabled', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Install });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.EnabledGlobally);
});
test('test updating an extension does not re-eanbles it when workspace disabled', async () => {
testObject = await aWorkbenchService();
const local = aLocalExtension('pub.a');
await instantiationService.get(IExtensionEnablementService).setEnablement([local], EnablementState.DisabledWorkspace);
didInstallEvent.fire({ local, identifier: local.identifier, operation: InstallOperation.Update });
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [local]);
const actual = await testObject.queryLocal();
assert.equal(actual[0].enablementState, EnablementState.DisabledWorkspace);
});
async function aWorkbenchService(): Promise<ExtensionsWorkbenchService> {
const workbenchService: ExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
await workbenchService.queryLocal();