Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)
* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c * remove files we don't want * fix hygiene * update distro * update distro * fix hygiene * fix strict nulls * distro * distro * fix tests * fix tests * add another edit * fix viewlet icon * fix azure dialog * fix some padding * fix more padding issues
@@ -30,7 +30,7 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { CombinedInstallAction, UpdateAction, ExtensionEditorDropDownAction, ReloadAction, MaliciousStatusLabelAction, IgnoreExtensionRecommendationAction, UndoIgnoreExtensionRecommendationAction, EnableDropDownAction, DisableDropDownAction, StatusLabelAction, SetFileIconThemeAction, SetColorThemeAction, RemoteInstallAction, ExtensionToolTipAction, SystemDisabledWarningAction, LocalInstallAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { IOpenerService, matchesScheme } from 'vs/platform/opener/common/opener';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -60,6 +60,7 @@ import { renderMarkdownDocument } from 'vs/workbench/contrib/markdown/common/mar
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { TokenizationRegistry } from 'vs/editor/common/modes';
|
||||
import { generateTokensCSSForColorMap } from 'vs/editor/common/modes/supports/tokenization';
|
||||
import { editorBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { ExtensionsViewlet } from 'vs/workbench/contrib/extensions/browser/extensionsViewlet';
|
||||
|
||||
function removeEmbeddedSVGs(documentContent: string): string {
|
||||
@@ -471,10 +472,8 @@ export class ExtensionEditor extends BaseEditor {
|
||||
private setSubText(extension: IExtension, reloadAction: ReloadAction, template: IExtensionEditorTemplate): void {
|
||||
hide(template.subtextContainer);
|
||||
|
||||
const ignoreAction = this.instantiationService.createInstance(IgnoreExtensionRecommendationAction);
|
||||
const undoIgnoreAction = this.instantiationService.createInstance(UndoIgnoreExtensionRecommendationAction);
|
||||
ignoreAction.extension = extension;
|
||||
undoIgnoreAction.extension = extension;
|
||||
const ignoreAction = this.instantiationService.createInstance(IgnoreExtensionRecommendationAction, extension);
|
||||
const undoIgnoreAction = this.instantiationService.createInstance(UndoIgnoreExtensionRecommendationAction, extension);
|
||||
ignoreAction.enabled = false;
|
||||
undoIgnoreAction.enabled = false;
|
||||
|
||||
@@ -628,9 +627,10 @@ export class ExtensionEditor extends BaseEditor {
|
||||
if (!link) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Whitelist supported schemes for links
|
||||
if ([Schemas.http, Schemas.https, Schemas.mailto].indexOf(link.scheme) >= 0 || (link.scheme === 'command' && link.path === ShowCurrentReleaseNotesActionId)) {
|
||||
if (matchesScheme(link, Schemas.http) || matchesScheme(link, Schemas.https) || matchesScheme(link, Schemas.mailto)
|
||||
|| (matchesScheme(link, Schemas.command) && URI.parse(link).path === ShowCurrentReleaseNotesActionId)
|
||||
) {
|
||||
this.openerService.open(link);
|
||||
}
|
||||
}, null, this.contentDisposables));
|
||||
@@ -663,6 +663,8 @@ export class ExtensionEditor extends BaseEditor {
|
||||
body {
|
||||
padding: 10px 20px;
|
||||
line-height: 22px;
|
||||
max-width: 780px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
img {
|
||||
@@ -865,6 +867,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
const renders = [
|
||||
this.renderSettings(content, manifest, layout),
|
||||
this.renderCommands(content, manifest, layout),
|
||||
this.renderCodeActions(content, manifest, layout),
|
||||
this.renderLanguages(content, manifest, layout),
|
||||
this.renderColorThemes(content, manifest, layout),
|
||||
this.renderIconThemes(content, manifest, layout),
|
||||
@@ -907,7 +910,11 @@ export class ExtensionEditor extends BaseEditor {
|
||||
append(template.content, scrollableContent.getDomNode());
|
||||
this.contentDisposables.add(scrollableContent);
|
||||
|
||||
const dependenciesTree = this.instantiationService.createInstance(ExtensionsTree, new ExtensionData(extension, null, extension => extension.dependencies || [], this.extensionsWorkbenchService), content);
|
||||
const dependenciesTree = this.instantiationService.createInstance(ExtensionsTree,
|
||||
new ExtensionData(extension, null, extension => extension.dependencies || [], this.extensionsWorkbenchService), content,
|
||||
{
|
||||
listBackground: editorBackground
|
||||
});
|
||||
const layout = () => {
|
||||
scrollableContent.scanDomNode();
|
||||
const scrollDimensions = scrollableContent.getScrollDimensions();
|
||||
@@ -927,7 +934,11 @@ export class ExtensionEditor extends BaseEditor {
|
||||
append(template.content, scrollableContent.getDomNode());
|
||||
this.contentDisposables.add(scrollableContent);
|
||||
|
||||
const extensionsPackTree = this.instantiationService.createInstance(ExtensionsTree, new ExtensionData(extension, null, extension => extension.extensionPack || [], this.extensionsWorkbenchService), content);
|
||||
const extensionsPackTree = this.instantiationService.createInstance(ExtensionsTree,
|
||||
new ExtensionData(extension, null, extension => extension.extensionPack || [], this.extensionsWorkbenchService), content,
|
||||
{
|
||||
listBackground: editorBackground
|
||||
});
|
||||
const layout = () => {
|
||||
scrollableContent.scanDomNode();
|
||||
const scrollDimensions = scrollableContent.getScrollDimensions();
|
||||
@@ -942,8 +953,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderSettings(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const configuration = contributes && contributes.configuration;
|
||||
const configuration = manifest.contributes?.configuration;
|
||||
let properties: any = {};
|
||||
if (Array.isArray(configuration)) {
|
||||
configuration.forEach(config => {
|
||||
@@ -979,9 +989,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderDebuggers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const contrib = contributes && contributes.debuggers || [];
|
||||
|
||||
const contrib = manifest.contributes?.debuggers || [];
|
||||
if (!contrib.length) {
|
||||
return false;
|
||||
}
|
||||
@@ -1004,10 +1012,9 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderViewContainers(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const contrib = contributes && contributes.viewsContainers || {};
|
||||
const contrib = manifest.contributes?.viewsContainers || {};
|
||||
|
||||
let viewContainers = Object.keys(contrib).reduce((result, location) => {
|
||||
const viewContainers = Object.keys(contrib).reduce((result, location) => {
|
||||
let viewContainersForLocation: IViewContainer[] = contrib[location];
|
||||
result.push(...viewContainersForLocation.map(viewContainer => ({ ...viewContainer, location })));
|
||||
return result;
|
||||
@@ -1030,10 +1037,9 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderViews(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const contrib = contributes && contributes.views || {};
|
||||
const contrib = manifest.contributes?.views || {};
|
||||
|
||||
let views = Object.keys(contrib).reduce((result, location) => {
|
||||
const views = Object.keys(contrib).reduce((result, location) => {
|
||||
let viewsForLocation: IView[] = contrib[location];
|
||||
result.push(...viewsForLocation.map(view => ({ ...view, location })));
|
||||
return result;
|
||||
@@ -1056,9 +1062,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderLocalizations(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const localizations = contributes && contributes.localizations || [];
|
||||
|
||||
const localizations = manifest.contributes?.localizations || [];
|
||||
if (!localizations.length) {
|
||||
return false;
|
||||
}
|
||||
@@ -1076,7 +1080,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderCustomEditors(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const webviewEditors = (manifest.contributes && manifest.contributes.webviewEditors) || [];
|
||||
const webviewEditors = manifest.contributes?.webviewEditors || [];
|
||||
if (!webviewEditors.length) {
|
||||
return false;
|
||||
}
|
||||
@@ -1100,10 +1104,39 @@ export class ExtensionEditor extends BaseEditor {
|
||||
return true;
|
||||
}
|
||||
|
||||
private renderColorThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const contrib = contributes && contributes.themes || [];
|
||||
private renderCodeActions(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const codeActions = manifest.contributes?.codeActions || [];
|
||||
if (!codeActions.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const flatActions = arrays.flatten(
|
||||
codeActions.map(contribution =>
|
||||
contribution.actions.map(action => ({ ...action, languages: contribution.languages }))));
|
||||
|
||||
const details = $('details', { open: true, ontoggle: onDetailsToggle },
|
||||
$('summary', { tabindex: '0' }, localize('codeActions', "Code Actions ({0})", flatActions.length)),
|
||||
$('table', undefined,
|
||||
$('tr', undefined,
|
||||
$('th', undefined, localize('codeActions.title', "Title")),
|
||||
$('th', undefined, localize('codeActions.kind', "Kind")),
|
||||
$('th', undefined, localize('codeActions.description', "Description")),
|
||||
$('th', undefined, localize('codeActions.languages', "Languages"))),
|
||||
...flatActions.map(action =>
|
||||
$('tr', undefined,
|
||||
$('td', undefined, action.title),
|
||||
$('td', undefined, $('code', undefined, action.kind)),
|
||||
$('td', undefined, action.description ?? ''),
|
||||
$('td', undefined, ...action.languages.map(language => $('code', undefined, language)))))
|
||||
)
|
||||
);
|
||||
|
||||
append(container, details);
|
||||
return true;
|
||||
}
|
||||
|
||||
private renderColorThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contrib = manifest.contributes?.themes || [];
|
||||
if (!contrib.length) {
|
||||
return false;
|
||||
}
|
||||
@@ -1118,9 +1151,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderIconThemes(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const contrib = contributes && contributes.iconThemes || [];
|
||||
|
||||
const contrib = manifest.contributes?.iconThemes || [];
|
||||
if (!contrib.length) {
|
||||
return false;
|
||||
}
|
||||
@@ -1135,10 +1166,8 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderColors(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const colors = contributes && contributes.colors;
|
||||
|
||||
if (!(colors && colors.length)) {
|
||||
const colors = manifest.contributes?.colors || [];
|
||||
if (!colors.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1180,9 +1209,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
|
||||
|
||||
private renderJSONValidation(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const contrib = contributes && contributes.jsonValidation || [];
|
||||
|
||||
const contrib = manifest.contributes?.jsonValidation || [];
|
||||
if (!contrib.length) {
|
||||
return false;
|
||||
}
|
||||
@@ -1204,8 +1231,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
private renderCommands(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const rawCommands = contributes && contributes.commands || [];
|
||||
const rawCommands = manifest.contributes?.commands || [];
|
||||
const commands = rawCommands.map(c => ({
|
||||
id: c.command,
|
||||
title: c.title,
|
||||
@@ -1215,7 +1241,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
|
||||
const byId = arrays.index(commands, c => c.id);
|
||||
|
||||
const menus = contributes && contributes.menus || {};
|
||||
const menus = manifest.contributes?.menus || {};
|
||||
|
||||
Object.keys(menus).forEach(context => {
|
||||
menus[context].forEach(menu => {
|
||||
@@ -1231,7 +1257,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
});
|
||||
});
|
||||
|
||||
const rawKeybindings = contributes && contributes.keybindings ? (Array.isArray(contributes.keybindings) ? contributes.keybindings : [contributes.keybindings]) : [];
|
||||
const rawKeybindings = manifest.contributes?.keybindings ? (Array.isArray(manifest.contributes.keybindings) ? manifest.contributes.keybindings : [manifest.contributes.keybindings]) : [];
|
||||
|
||||
rawKeybindings.forEach(rawKeybinding => {
|
||||
const keybinding = this.resolveKeybinding(rawKeybinding);
|
||||
@@ -1285,7 +1311,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
|
||||
private renderLanguages(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
const contributes = manifest.contributes;
|
||||
const rawLanguages = contributes && contributes.languages || [];
|
||||
const rawLanguages = contributes?.languages || [];
|
||||
const languages = rawLanguages.map(l => ({
|
||||
id: l.id,
|
||||
name: (l.aliases || [])[0] || l.id,
|
||||
@@ -1296,8 +1322,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
|
||||
const byId = arrays.index(languages, l => l.id);
|
||||
|
||||
const grammars = contributes && contributes.grammars || [];
|
||||
|
||||
const grammars = contributes?.grammars || [];
|
||||
grammars.forEach(grammar => {
|
||||
let language = byId[grammar.language];
|
||||
|
||||
@@ -1310,8 +1335,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}
|
||||
});
|
||||
|
||||
const snippets = contributes && contributes.snippets || [];
|
||||
|
||||
const snippets = contributes?.snippets || [];
|
||||
snippets.forEach(snippet => {
|
||||
let language = byId[snippet.language];
|
||||
|
||||
|
||||
@@ -43,12 +43,12 @@ import { ExtensionType, ExtensionsPolicy, ExtensionsPolicyKey } from 'vs/platfor
|
||||
// import { extname } from 'vs/base/common/resources';
|
||||
import { IExeBasedExtensionTip, IProductService } from 'vs/platform/product/common/productService';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; // {{SQL CARBON EDIT}}
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; // {{SQL CARBON EDIT}}
|
||||
import { IWorkspaceStatsService } from 'vs/workbench/contrib/stats/common/workspaceStats';
|
||||
import { IWorkspaceTagsService } from 'vs/workbench/contrib/tags/common/workspaceTags';
|
||||
import { /*setImmediate,*/ isWeb } from 'vs/base/common/platform';
|
||||
import { platform, env as processEnv } from 'vs/base/common/process';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys'; // {{SQL CARBON EDIT}}
|
||||
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
|
||||
|
||||
const milliSecondsInADay = 1000 * 60 * 60 * 24;
|
||||
const choiceNever = localize('neverShowAgain', "Don't Show Again");
|
||||
@@ -112,10 +112,10 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
// @IViewletService private readonly viewletService: IViewletService, {{SQL CARBON EDIT}} comment out for no unused
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
|
||||
@IAdsTelemetryService private readonly adsTelemetryService: IAdsTelemetryService, // {{SQL CARBON EDIT}}
|
||||
// @IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService, {{SQL CARBON EDIT}} comment out for no unused
|
||||
// @IExperimentService private readonly experimentService: IExperimentService, {{SQL CARBON EDIT}} comment out for no unused
|
||||
@IAdsTelemetryService private readonly adsTelemetryService: IAdsTelemetryService, // {{SQL CARBON EDIT}}
|
||||
@IWorkspaceStatsService private readonly workspaceStatsService: IWorkspaceStatsService,
|
||||
@IWorkspaceTagsService private readonly workspaceTagsService: IWorkspaceTagsService,
|
||||
@IProductService private readonly productService: IProductService
|
||||
) {
|
||||
super();
|
||||
@@ -518,15 +518,6 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
|
||||
private async promptForImportantExeBasedExtension(): Promise<boolean> {
|
||||
|
||||
const storageKey = 'extensionsAssistant/workspaceRecommendationsIgnore';
|
||||
const config = this.configurationService.getValue<IExtensionsConfiguration>(ConfigurationKey);
|
||||
|
||||
if (config.ignoreRecommendations
|
||||
|| config.showRecommendationsOnlyOnDemand
|
||||
|| this.storageService.getBoolean(storageKey, StorageScope.WORKSPACE, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
let recommendationsToSuggest = Object.keys(this._importantExeBasedRecommendations);
|
||||
|
||||
const installed = await this.extensionManagementService.getInstalled(ExtensionType.User);
|
||||
@@ -539,13 +530,23 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
"exeName": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:alreadyInstalled', { extensionId, exeName: tip.exeFriendlyName || basename(tip.windowsPath!) });
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:alreadyInstalled', { extensionId, exeName: basename(tip.windowsPath!) });
|
||||
|
||||
});
|
||||
|
||||
if (recommendationsToSuggest.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const storageKey = 'extensionsAssistant/workspaceRecommendationsIgnore';
|
||||
const config = this.configurationService.getValue<IExtensionsConfiguration>(ConfigurationKey);
|
||||
|
||||
if (config.ignoreRecommendations
|
||||
|| config.showRecommendationsOnlyOnDemand
|
||||
|| this.storageService.getBoolean(storageKey, StorageScope.WORKSPACE, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
recommendationsToSuggest = this.filterIgnoredOrNotAllowed(recommendationsToSuggest);
|
||||
if (recommendationsToSuggest.length === 0) {
|
||||
return false;
|
||||
@@ -1123,7 +1124,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
|
||||
const storageKey = 'extensionsAssistant/dynamicWorkspaceRecommendations';
|
||||
const workspaceUri = this.contextService.getWorkspace().folders[0].uri;
|
||||
return Promise.all([this.workspaceStatsService.getHashedRemotesFromUri(workspaceUri, false), this.workspaceStatsService.getHashedRemotesFromUri(workspaceUri, true)]).then(([hashedRemotes1, hashedRemotes2]) => {
|
||||
return Promise.all([this.workspaceTagsService.getHashedRemotesFromUri(workspaceUri, false), this.workspaceTagsService.getHashedRemotesFromUri(workspaceUri, true)]).then(([hashedRemotes1, hashedRemotes2]) => {
|
||||
const hashedRemotes = (hashedRemotes1 || []).concat(hashedRemotes2 || []);
|
||||
if (!hashedRemotes.length) {
|
||||
return undefined;
|
||||
@@ -1133,7 +1134,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
if (context.res.statusCode !== 200) {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
return asJson(context).then((result: { [key: string]: any }) => {
|
||||
return asJson(context).then((result: { [key: string]: any } | null) => {
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./media/extensions';
|
||||
import { localize } from 'vs/nls';
|
||||
import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -55,7 +54,7 @@ Registry.as<IOutputChannelRegistry>(OutputExtensions.OutputChannels)
|
||||
|
||||
// Quickopen
|
||||
Registry.as<IQuickOpenRegistry>(Extensions.Quickopen).registerQuickOpenHandler(
|
||||
new QuickOpenHandlerDescriptor(
|
||||
QuickOpenHandlerDescriptor.create(
|
||||
ExtensionsHandler,
|
||||
ExtensionsHandler.ID,
|
||||
'ext ',
|
||||
@@ -67,7 +66,7 @@ Registry.as<IQuickOpenRegistry>(Extensions.Quickopen).registerQuickOpenHandler(
|
||||
|
||||
// Editor
|
||||
Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
|
||||
new EditorDescriptor(
|
||||
EditorDescriptor.create(
|
||||
ExtensionEditor,
|
||||
ExtensionEditor.ID,
|
||||
localize('extension', "Extension")
|
||||
@@ -77,13 +76,12 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
|
||||
]);
|
||||
|
||||
// Viewlet
|
||||
const viewletDescriptor = new ViewletDescriptor(
|
||||
const viewletDescriptor = ViewletDescriptor.create(
|
||||
ExtensionsViewlet,
|
||||
VIEWLET_ID,
|
||||
localize('extensions', "Extensions"),
|
||||
'extensions',
|
||||
// {{SQL CARBON EDIT}}
|
||||
14
|
||||
'codicon-extensions',
|
||||
14 // {{SQL CARBON EDIT}}
|
||||
);
|
||||
|
||||
Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets)
|
||||
@@ -92,67 +90,67 @@ Registry.as<ViewletRegistry>(ViewletExtensions.Viewlets)
|
||||
// Global actions
|
||||
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
||||
|
||||
const openViewletActionDescriptor = new SyncActionDescriptor(OpenExtensionsViewletAction, OpenExtensionsViewletAction.ID, OpenExtensionsViewletAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_X });
|
||||
const openViewletActionDescriptor = SyncActionDescriptor.create(OpenExtensionsViewletAction, OpenExtensionsViewletAction.ID, OpenExtensionsViewletAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_X });
|
||||
actionRegistry.registerWorkbenchAction(openViewletActionDescriptor, 'View: Show Extensions', localize('view', "View"));
|
||||
|
||||
const installActionDescriptor = new SyncActionDescriptor(InstallExtensionsAction, InstallExtensionsAction.ID, InstallExtensionsAction.LABEL);
|
||||
const installActionDescriptor = SyncActionDescriptor.create(InstallExtensionsAction, InstallExtensionsAction.ID, InstallExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(installActionDescriptor, 'Extensions: Install Extensions', ExtensionsLabel);
|
||||
|
||||
const listOutdatedActionDescriptor = new SyncActionDescriptor(ShowOutdatedExtensionsAction, ShowOutdatedExtensionsAction.ID, ShowOutdatedExtensionsAction.LABEL);
|
||||
const listOutdatedActionDescriptor = SyncActionDescriptor.create(ShowOutdatedExtensionsAction, ShowOutdatedExtensionsAction.ID, ShowOutdatedExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(listOutdatedActionDescriptor, 'Extensions: Show Outdated Extensions', ExtensionsLabel);
|
||||
|
||||
const recommendationsActionDescriptor = new SyncActionDescriptor(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, ShowRecommendedExtensionsAction.LABEL);
|
||||
const recommendationsActionDescriptor = SyncActionDescriptor.create(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, ShowRecommendedExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(recommendationsActionDescriptor, 'Extensions: Show Recommended Extensions', ExtensionsLabel);
|
||||
|
||||
const keymapRecommendationsActionDescriptor = new SyncActionDescriptor(ShowRecommendedKeymapExtensionsAction, ShowRecommendedKeymapExtensionsAction.ID, ShowRecommendedKeymapExtensionsAction.SHORT_LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_M) });
|
||||
const keymapRecommendationsActionDescriptor = SyncActionDescriptor.create(ShowRecommendedKeymapExtensionsAction, ShowRecommendedKeymapExtensionsAction.ID, ShowRecommendedKeymapExtensionsAction.SHORT_LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_M) });
|
||||
actionRegistry.registerWorkbenchAction(keymapRecommendationsActionDescriptor, 'Preferences: Keymaps', PreferencesLabel);
|
||||
|
||||
const languageExtensionsActionDescriptor = new SyncActionDescriptor(ShowLanguageExtensionsAction, ShowLanguageExtensionsAction.ID, ShowLanguageExtensionsAction.SHORT_LABEL);
|
||||
const languageExtensionsActionDescriptor = SyncActionDescriptor.create(ShowLanguageExtensionsAction, ShowLanguageExtensionsAction.ID, ShowLanguageExtensionsAction.SHORT_LABEL);
|
||||
actionRegistry.registerWorkbenchAction(languageExtensionsActionDescriptor, 'Preferences: Language Extensions', PreferencesLabel);
|
||||
|
||||
const azureExtensionsActionDescriptor = new SyncActionDescriptor(ShowAzureExtensionsAction, ShowAzureExtensionsAction.ID, ShowAzureExtensionsAction.SHORT_LABEL);
|
||||
const azureExtensionsActionDescriptor = SyncActionDescriptor.create(ShowAzureExtensionsAction, ShowAzureExtensionsAction.ID, ShowAzureExtensionsAction.SHORT_LABEL);
|
||||
actionRegistry.registerWorkbenchAction(azureExtensionsActionDescriptor, 'Preferences: Azure Extensions', PreferencesLabel);
|
||||
|
||||
const popularActionDescriptor = new SyncActionDescriptor(ShowPopularExtensionsAction, ShowPopularExtensionsAction.ID, ShowPopularExtensionsAction.LABEL);
|
||||
const popularActionDescriptor = SyncActionDescriptor.create(ShowPopularExtensionsAction, ShowPopularExtensionsAction.ID, ShowPopularExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(popularActionDescriptor, 'Extensions: Show Popular Extensions', ExtensionsLabel);
|
||||
|
||||
const enabledActionDescriptor = new SyncActionDescriptor(ShowEnabledExtensionsAction, ShowEnabledExtensionsAction.ID, ShowEnabledExtensionsAction.LABEL);
|
||||
const enabledActionDescriptor = SyncActionDescriptor.create(ShowEnabledExtensionsAction, ShowEnabledExtensionsAction.ID, ShowEnabledExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(enabledActionDescriptor, 'Extensions: Show Enabled Extensions', ExtensionsLabel);
|
||||
|
||||
const installedActionDescriptor = new SyncActionDescriptor(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL);
|
||||
const installedActionDescriptor = SyncActionDescriptor.create(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(installedActionDescriptor, 'Extensions: Show Installed Extensions', ExtensionsLabel);
|
||||
|
||||
const disabledActionDescriptor = new SyncActionDescriptor(ShowDisabledExtensionsAction, ShowDisabledExtensionsAction.ID, ShowDisabledExtensionsAction.LABEL);
|
||||
const disabledActionDescriptor = SyncActionDescriptor.create(ShowDisabledExtensionsAction, ShowDisabledExtensionsAction.ID, ShowDisabledExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(disabledActionDescriptor, 'Extensions: Show Disabled Extensions', ExtensionsLabel);
|
||||
|
||||
const builtinActionDescriptor = new SyncActionDescriptor(ShowBuiltInExtensionsAction, ShowBuiltInExtensionsAction.ID, ShowBuiltInExtensionsAction.LABEL);
|
||||
const builtinActionDescriptor = SyncActionDescriptor.create(ShowBuiltInExtensionsAction, ShowBuiltInExtensionsAction.ID, ShowBuiltInExtensionsAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(builtinActionDescriptor, 'Extensions: Show Built-in Extensions', ExtensionsLabel);
|
||||
|
||||
const updateAllActionDescriptor = new SyncActionDescriptor(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL);
|
||||
const updateAllActionDescriptor = SyncActionDescriptor.create(UpdateAllAction, UpdateAllAction.ID, UpdateAllAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(updateAllActionDescriptor, 'Extensions: Update All Extensions', ExtensionsLabel);
|
||||
|
||||
const installVSIXActionDescriptor = new SyncActionDescriptor(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL);
|
||||
const installVSIXActionDescriptor = SyncActionDescriptor.create(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(installVSIXActionDescriptor, 'Extensions: Install from VSIX...', ExtensionsLabel);
|
||||
|
||||
const disableAllAction = new SyncActionDescriptor(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL);
|
||||
const disableAllAction = SyncActionDescriptor.create(DisableAllAction, DisableAllAction.ID, DisableAllAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(disableAllAction, 'Extensions: Disable All Installed Extensions', ExtensionsLabel);
|
||||
|
||||
const disableAllWorkspaceAction = new SyncActionDescriptor(DisableAllWorkspaceAction, DisableAllWorkspaceAction.ID, DisableAllWorkspaceAction.LABEL);
|
||||
const disableAllWorkspaceAction = SyncActionDescriptor.create(DisableAllWorkspaceAction, DisableAllWorkspaceAction.ID, DisableAllWorkspaceAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(disableAllWorkspaceAction, 'Extensions: Disable All Installed Extensions for this Workspace', ExtensionsLabel);
|
||||
|
||||
const enableAllAction = new SyncActionDescriptor(EnableAllAction, EnableAllAction.ID, EnableAllAction.LABEL);
|
||||
const enableAllAction = SyncActionDescriptor.create(EnableAllAction, EnableAllAction.ID, EnableAllAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(enableAllAction, 'Extensions: Enable All Extensions', ExtensionsLabel);
|
||||
|
||||
const enableAllWorkspaceAction = new SyncActionDescriptor(EnableAllWorkspaceAction, EnableAllWorkspaceAction.ID, EnableAllWorkspaceAction.LABEL);
|
||||
const enableAllWorkspaceAction = SyncActionDescriptor.create(EnableAllWorkspaceAction, EnableAllWorkspaceAction.ID, EnableAllWorkspaceAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(enableAllWorkspaceAction, 'Extensions: Enable All Extensions for this Workspace', ExtensionsLabel);
|
||||
|
||||
const checkForUpdatesAction = new SyncActionDescriptor(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL);
|
||||
const checkForUpdatesAction = SyncActionDescriptor.create(CheckForUpdatesAction, CheckForUpdatesAction.ID, CheckForUpdatesAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(checkForUpdatesAction, `Extensions: Check for Extension Updates`, ExtensionsLabel);
|
||||
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL), `Extensions: Enable Auto Updating Extensions`, ExtensionsLabel);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL), `Extensions: Disable Auto Updating Extensions`, ExtensionsLabel);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(InstallSpecificVersionOfExtensionAction, InstallSpecificVersionOfExtensionAction.ID, InstallSpecificVersionOfExtensionAction.LABEL), 'Install Specific Version of Extension...', ExtensionsLabel);
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReinstallAction, ReinstallAction.ID, ReinstallAction.LABEL), 'Reinstall Extension...', localize('developer', "Developer"));
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.create(EnableAutoUpdateAction, EnableAutoUpdateAction.ID, EnableAutoUpdateAction.LABEL), `Extensions: Enable Auto Updating Extensions`, ExtensionsLabel);
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.create(DisableAutoUpdateAction, DisableAutoUpdateAction.ID, DisableAutoUpdateAction.LABEL), `Extensions: Disable Auto Updating Extensions`, ExtensionsLabel);
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.create(InstallSpecificVersionOfExtensionAction, InstallSpecificVersionOfExtensionAction.ID, InstallSpecificVersionOfExtensionAction.LABEL), 'Install Specific Version of Extension...', ExtensionsLabel);
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.create(ReinstallAction, ReinstallAction.ID, ReinstallAction.LABEL), 'Reinstall Extension...', localize('developer', "Developer"));
|
||||
|
||||
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
|
||||
.registerConfiguration({
|
||||
@@ -281,12 +279,13 @@ CommandsRegistry.registerCommand({
|
||||
throw new Error(localize('id required', "Extension id required."));
|
||||
}
|
||||
const extensionManagementService = accessor.get(IExtensionManagementService);
|
||||
const installed = await extensionManagementService.getInstalled(ExtensionType.User);
|
||||
const [extensionToUninstall] = installed.filter(e => areSameExtensions(e.identifier, { id }));
|
||||
if (!extensionToUninstall) {
|
||||
throw new Error(localize('notInstalled', "Extension '{0}' is not installed. Make sure you use the full extension ID, including the publisher, e.g.: ms-vscode.csharp.", id));
|
||||
}
|
||||
|
||||
try {
|
||||
const installed = await extensionManagementService.getInstalled(ExtensionType.User);
|
||||
const [extensionToUninstall] = installed.filter(e => areSameExtensions(e.identifier, { id }));
|
||||
if (!extensionToUninstall) {
|
||||
return Promise.reject(new Error(localize('notInstalled', "Extension '{0}' is not installed. Make sure you use the full extension ID, including the publisher, e.g.: ms-vscode.csharp.", id)));
|
||||
}
|
||||
await extensionManagementService.uninstall(extensionToUninstall, true);
|
||||
} catch (e) {
|
||||
onUnexpectedError(e);
|
||||
@@ -357,7 +356,7 @@ class ExtensionsContributions implements IWorkbenchContribution {
|
||||
|
||||
if (canManageExtensions) {
|
||||
Registry.as<IQuickOpenRegistry>(Extensions.Quickopen).registerQuickOpenHandler(
|
||||
new QuickOpenHandlerDescriptor(
|
||||
QuickOpenHandlerDescriptor.create(
|
||||
GalleryExtensionsHandler,
|
||||
GalleryExtensionsHandler.ID,
|
||||
'ext install ',
|
||||
|
||||
@@ -16,7 +16,7 @@ import { dispose, Disposable } from 'vs/base/common/lifecycle';
|
||||
// {{SQL CARBON EDIT}}
|
||||
import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer, EXTENSIONS_CONFIG } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate';
|
||||
import { ExtensionsLabel, IGalleryExtension, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionsLabel, IGalleryExtension, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension, INSTALL_ERROR_NOT_SUPPORTED } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { IExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionTipsService, IExtensionRecommendation, IExtensionsConfigContent, IExtensionManagementServer } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { ExtensionType, ExtensionIdentifier, IExtensionDescription, IExtensionManifest, isLanguagePackExtension, ExtensionsPolicy, ExtensionsPolicyKey } from 'vs/platform/extensions/common/extensions'; // {{SQL CARBON EDIT}}
|
||||
@@ -55,12 +55,12 @@ import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
import { coalesce } from 'vs/base/common/arrays';
|
||||
import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING, IFileIconTheme, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { isUIExtension } from 'vs/workbench/services/extensions/common/extensionsUtil';
|
||||
import { prefersExecuteOnUI, prefersExecuteOnWorkspace } from 'vs/workbench/services/extensions/common/extensionsUtil';
|
||||
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IFileDialogService, IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
|
||||
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; // {{SQL CARBON EDIT}}
|
||||
@@ -76,31 +76,37 @@ export function toExtensionDescription(local: ILocalExtension): IExtensionDescri
|
||||
};
|
||||
}
|
||||
|
||||
const promptDownloadManually = (extension: IGalleryExtension | undefined, message: string, error: Error,
|
||||
instantiationService: IInstantiationService, notificationService: INotificationService, openerService: IOpenerService, productService: IProductService) => {
|
||||
if (!extension || error.name === INSTALL_ERROR_INCOMPATIBLE || error.name === INSTALL_ERROR_MALICIOUS || !productService.extensionsGallery) {
|
||||
return Promise.reject(error);
|
||||
} else {
|
||||
const downloadUrl = (extension.assets.downloadPage && extension.assets.downloadPage.uri) || extension.assets.download.uri; // {{SQL CARBON EDIT}} Use the URI directly since we don't have a marketplace hosting the packages
|
||||
notificationService.prompt(Severity.Error, message, [{
|
||||
label: localize('download', "Download Manually"),
|
||||
run: () => openerService.open(URI.parse(downloadUrl)).then(() => {
|
||||
notificationService.prompt(
|
||||
Severity.Info,
|
||||
localize('install vsix', 'Once downloaded, please manually install the downloaded VSIX of \'{0}\'.', extension.identifier.id),
|
||||
[{
|
||||
label: InstallVSIXAction.LABEL,
|
||||
run: () => {
|
||||
const action = instantiationService.createInstance(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL);
|
||||
action.run();
|
||||
action.dispose();
|
||||
}
|
||||
}]
|
||||
);
|
||||
})
|
||||
}]);
|
||||
return Promise.resolve();
|
||||
}
|
||||
const promptDownloadManually = (extension: IGalleryExtension | undefined, message: string, error: Error, instantiationService: IInstantiationService): Promise<any> => {
|
||||
return instantiationService.invokeFunction(accessor => {
|
||||
const productService = accessor.get(IProductService);
|
||||
const openerService = accessor.get(IOpenerService);
|
||||
const notificationService = accessor.get(INotificationService);
|
||||
const dialogService = accessor.get(IDialogService);
|
||||
const erorrsToShows = [INSTALL_ERROR_INCOMPATIBLE, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_NOT_SUPPORTED];
|
||||
if (!extension || erorrsToShows.indexOf(error.name) !== -1 || !productService.extensionsGallery) {
|
||||
return dialogService.show(Severity.Error, error.message, []);
|
||||
} else {
|
||||
const downloadUrl = (extension.assets.downloadPage && extension.assets.downloadPage.uri) || extension.assets.download.uri; // {{SQL CARBON EDIT}} Use the URI directly since we don't have a marketplace hosting the packages
|
||||
notificationService.prompt(Severity.Error, message, [{
|
||||
label: localize('download', "Download Manually"),
|
||||
run: () => openerService.open(URI.parse(downloadUrl)).then(() => {
|
||||
notificationService.prompt(
|
||||
Severity.Info,
|
||||
localize('install vsix', 'Once downloaded, please manually install the downloaded VSIX of \'{0}\'.', extension.identifier.id),
|
||||
[{
|
||||
label: InstallVSIXAction.LABEL,
|
||||
run: () => {
|
||||
const action = instantiationService.createInstance(InstallVSIXAction, InstallVSIXAction.ID, InstallVSIXAction.LABEL);
|
||||
action.run();
|
||||
action.dispose();
|
||||
}
|
||||
}]
|
||||
);
|
||||
})
|
||||
}]);
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function getRelativeDateLabel(date: Date): string {
|
||||
@@ -138,9 +144,9 @@ function getRelativeDateLabel(date: Date): string {
|
||||
}
|
||||
|
||||
export abstract class ExtensionAction extends Action implements IExtensionContainer {
|
||||
private _extension: IExtension;
|
||||
get extension(): IExtension { return this._extension; }
|
||||
set extension(extension: IExtension) { this._extension = extension; this.update(); }
|
||||
private _extension: IExtension | null = null;
|
||||
get extension(): IExtension | null { return this._extension; }
|
||||
set extension(extension: IExtension | null) { this._extension = extension; this.update(); }
|
||||
abstract update(): void;
|
||||
}
|
||||
|
||||
@@ -153,7 +159,7 @@ export class InstallAction extends ExtensionAction {
|
||||
private static readonly InstallingClass = 'extension-action install installing';
|
||||
|
||||
|
||||
private _manifest: IExtensionManifest | null;
|
||||
private _manifest: IExtensionManifest | null = null;
|
||||
set manifest(manifest: IExtensionManifest) {
|
||||
this._manifest = manifest;
|
||||
this.updateLabel();
|
||||
@@ -163,7 +169,6 @@ export class InstallAction extends ExtensionAction {
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IExtensionService private readonly runtimeExtensionService: IExtensionService,
|
||||
@IWorkbenchThemeService private readonly workbenchThemeService: IWorkbenchThemeService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@@ -196,12 +201,15 @@ export class InstallAction extends ExtensionAction {
|
||||
}
|
||||
|
||||
private updateLabel(): void {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
if (this.extension.state === ExtensionState.Installing) {
|
||||
this.label = InstallAction.INSTALLING_LABEL;
|
||||
this.tooltip = InstallAction.INSTALLING_LABEL;
|
||||
} else {
|
||||
if (this._manifest && this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
if (isUIExtension(this._manifest, this.productService, this.configurationService)) {
|
||||
if (prefersExecuteOnUI(this._manifest, this.productService, this.configurationService)) {
|
||||
this.label = `${InstallAction.INSTALL_LABEL} ${localize('locally', "Locally")}`;
|
||||
this.tooltip = `${InstallAction.INSTALL_LABEL} ${localize('locally', "Locally")}`;
|
||||
} else {
|
||||
@@ -217,6 +225,9 @@ export class InstallAction extends ExtensionAction {
|
||||
}
|
||||
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
this.extensionsWorkbenchService.open(this.extension);
|
||||
|
||||
alert(localize('installExtensionStart', "Installing extension {0} started. An editor is now open with more details on this extension", this.extension.displayName));
|
||||
@@ -263,7 +274,7 @@ export class InstallAction extends ExtensionAction {
|
||||
|
||||
console.error(err);
|
||||
|
||||
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService, this.productService);
|
||||
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -315,7 +326,7 @@ export abstract class InstallInOtherServerAction extends ExtensionAction {
|
||||
// disabled by extension kind or it is a language pack extension
|
||||
&& (this.extension.enablementState === EnablementState.DisabledByExtensionKind || isLanguagePackExtension(this.extension.local.manifest))
|
||||
) {
|
||||
const extensionInOtherServer = this.extensionsWorkbenchService.installed.filter(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server === this.server)[0];
|
||||
const extensionInOtherServer = this.extensionsWorkbenchService.installed.filter(e => areSameExtensions(e.identifier, this.extension!.identifier) && e.server === this.server)[0];
|
||||
if (extensionInOtherServer) {
|
||||
// Getting installed in other server
|
||||
if (extensionInOtherServer.state === ExtensionState.Installing && !extensionInOtherServer.local) {
|
||||
@@ -332,6 +343,9 @@ export abstract class InstallInOtherServerAction extends ExtensionAction {
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
if (this.server) {
|
||||
this.extensionsWorkbenchService.open(this.extension);
|
||||
alert(localize('installExtensionStart', "Installing extension {0} started. An editor is now open with more details on this extension", this.extension.displayName));
|
||||
@@ -424,12 +438,14 @@ export class UninstallAction extends ExtensionAction {
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
alert(localize('uninstallExtensionStart', "Uninstalling extension {0} started.", this.extension.displayName));
|
||||
|
||||
return this.extensionsWorkbenchService.uninstall(this.extension).then(() => {
|
||||
// {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
alert(localize('uninstallExtensionComplete', "Please reload Azure Data Studio to complete the uninstallation of the extension {0}.", this.extension.displayName));
|
||||
alert(localize('uninstallExtensionComplete', "Please reload Azure Data Studio to complete the uninstallation of the extension {0}.", this.extension!.displayName)); // {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -510,8 +526,6 @@ export class UpdateAction extends ExtensionAction {
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IProductService private readonly productService: IProductService
|
||||
) {
|
||||
super(`extensions.update`, '', UpdateAction.DisabledClass, false);
|
||||
this.update();
|
||||
@@ -540,14 +554,17 @@ export class UpdateAction extends ExtensionAction {
|
||||
this.label = this.extension.outdated ? this.getUpdateLabel(this.extension.latestVersion) : this.getUpdateLabel();
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
alert(localize('updateExtensionStart', "Updating extension {0} to version {1} started.", this.extension.displayName, this.extension.latestVersion));
|
||||
return this.install(this.extension);
|
||||
}
|
||||
|
||||
private install(extension: IExtension): Promise<void> {
|
||||
return this.extensionsWorkbenchService.install(extension).then(() => {
|
||||
alert(localize('updateExtensionComplete', "Updating extension {0} to version {1} completed.", this.extension.displayName, this.extension.latestVersion));
|
||||
alert(localize('updateExtensionComplete', "Updating extension {0} to version {1} completed.", extension.displayName, extension.latestVersion));
|
||||
}, err => {
|
||||
if (!extension.gallery) {
|
||||
return this.notificationService.error(err);
|
||||
@@ -562,7 +579,7 @@ export class UpdateAction extends ExtensionAction {
|
||||
|
||||
console.error(err);
|
||||
|
||||
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService, this.productService);
|
||||
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.identifier.id), err, this.instantiationService);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -577,8 +594,6 @@ interface IExtensionActionViewItemOptions extends IActionViewItemOptions {
|
||||
|
||||
export class ExtensionActionViewItem extends ActionViewItem {
|
||||
|
||||
protected options: IExtensionActionViewItemOptions;
|
||||
|
||||
constructor(context: any, action: IAction, options: IExtensionActionViewItemOptions = {}) {
|
||||
super(context, action, options);
|
||||
}
|
||||
@@ -586,14 +601,14 @@ export class ExtensionActionViewItem extends ActionViewItem {
|
||||
updateEnabled(): void {
|
||||
super.updateEnabled();
|
||||
|
||||
if (this.label && this.options.tabOnlyOnFocus && this.getAction().enabled && !this._hasFocus) {
|
||||
if (this.label && (<IExtensionActionViewItemOptions>this.options).tabOnlyOnFocus && this.getAction().enabled && !this._hasFocus) {
|
||||
DOM.removeTabIndexAndUpdateFocus(this.label);
|
||||
}
|
||||
}
|
||||
|
||||
private _hasFocus: boolean;
|
||||
private _hasFocus: boolean = false;
|
||||
setFocus(value: boolean): void {
|
||||
if (!this.options.tabOnlyOnFocus || this._hasFocus === value) {
|
||||
if (!(<IExtensionActionViewItemOptions>this.options).tabOnlyOnFocus || this._hasFocus === value) {
|
||||
return;
|
||||
}
|
||||
this._hasFocus = value;
|
||||
@@ -620,7 +635,7 @@ export abstract class ExtensionDropDownAction extends ExtensionAction {
|
||||
super(id, label, cssClass, enabled);
|
||||
}
|
||||
|
||||
private _actionViewItem: DropDownMenuActionViewItem;
|
||||
private _actionViewItem: DropDownMenuActionViewItem | null = null;
|
||||
createActionViewItem(): DropDownMenuActionViewItem {
|
||||
this._actionViewItem = this.instantiationService.createInstance(DropDownMenuActionViewItem, this, this.tabOnlyOnFocus);
|
||||
return this._actionViewItem;
|
||||
@@ -669,7 +684,7 @@ export class DropDownMenuActionViewItem extends ExtensionActionViewItem {
|
||||
export class ManageExtensionAction extends ExtensionDropDownAction {
|
||||
|
||||
static readonly ID = 'extensions.manage';
|
||||
private static readonly Class = 'extension-action manage';
|
||||
private static readonly Class = 'extension-action manage codicon-gear';
|
||||
private static readonly HideManageExtensionClass = `${ManageExtensionAction.Class} hide`;
|
||||
|
||||
constructor(
|
||||
@@ -712,13 +727,14 @@ export class ManageExtensionAction extends ExtensionDropDownAction {
|
||||
groups.push([this.instantiationService.createInstance(UninstallAction)]);
|
||||
groups.push([this.instantiationService.createInstance(InstallAnotherVersionAction)]);
|
||||
|
||||
const extensionActions: ExtensionAction[] = [this.instantiationService.createInstance(ExtensionInfoAction)];
|
||||
if (this.extension.local && this.extension.local.manifest.contributes && this.extension.local.manifest.contributes.configuration) {
|
||||
extensionActions.push(this.instantiationService.createInstance(ExtensionSettingsAction));
|
||||
if (this.extension) {
|
||||
const extensionActions: ExtensionAction[] = [this.instantiationService.createInstance(ExtensionInfoAction)];
|
||||
if (this.extension.local && this.extension.local.manifest.contributes && this.extension.local.manifest.contributes.configuration) {
|
||||
extensionActions.push(this.instantiationService.createInstance(ExtensionSettingsAction));
|
||||
}
|
||||
groups.push(extensionActions);
|
||||
}
|
||||
|
||||
groups.push(extensionActions);
|
||||
|
||||
groups.forEach(group => group.forEach(extensionAction => extensionAction.extension = this.extension));
|
||||
|
||||
return groups;
|
||||
@@ -754,15 +770,13 @@ export class InstallAnotherVersionAction extends ExtensionAction {
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IProductService private readonly productService: IProductService
|
||||
) {
|
||||
super(InstallAnotherVersionAction.ID, InstallAnotherVersionAction.LABEL);
|
||||
this.update();
|
||||
}
|
||||
|
||||
update(): void {
|
||||
this.enabled = this.extension && !!this.extension.gallery;
|
||||
this.enabled = !!this.extension && !!this.extension.gallery;
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
@@ -772,19 +786,19 @@ export class InstallAnotherVersionAction extends ExtensionAction {
|
||||
return this.quickInputService.pick(this.getVersionEntries(), { placeHolder: localize('selectVersion', "Select Version to Install"), matchOnDetail: true })
|
||||
.then(pick => {
|
||||
if (pick) {
|
||||
if (this.extension.version === pick.id) {
|
||||
if (this.extension!.version === pick.id) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
const promise: Promise<any> = pick.latest ? this.extensionsWorkbenchService.install(this.extension) : this.extensionsWorkbenchService.installVersion(this.extension, pick.id);
|
||||
const promise: Promise<any> = pick.latest ? this.extensionsWorkbenchService.install(this.extension!) : this.extensionsWorkbenchService.installVersion(this.extension!, pick.id);
|
||||
return promise
|
||||
.then(null, err => {
|
||||
if (!this.extension.gallery) {
|
||||
if (!this.extension!.gallery) {
|
||||
return this.notificationService.error(err);
|
||||
}
|
||||
|
||||
console.error(err);
|
||||
|
||||
return promptDownloadManually(this.extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", this.extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService, this.productService);
|
||||
return promptDownloadManually(this.extension!.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", this.extension!.identifier.id), err, this.instantiationService);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
@@ -792,8 +806,8 @@ export class InstallAnotherVersionAction extends ExtensionAction {
|
||||
}
|
||||
|
||||
private getVersionEntries(): Promise<(IQuickPickItem & { latest: boolean, id: string })[]> {
|
||||
return this.extensionGalleryService.getAllVersions(this.extension.gallery!, true)
|
||||
.then(allVersions => allVersions.map((v, i) => ({ id: v.version, label: v.version, description: `${getRelativeDateLabel(new Date(Date.parse(v.date)))}${v.version === this.extension.version ? ` (${localize('current', "Current")})` : ''}`, latest: i === 0 })));
|
||||
return this.extensionGalleryService.getAllVersions(this.extension!.gallery!, true)
|
||||
.then(allVersions => allVersions.map((v, i) => ({ id: v.version, label: v.version, description: `${getRelativeDateLabel(new Date(Date.parse(v.date)))}${v.version === this.extension!.version ? ` (${localize('current', "Current")})` : ''}`, latest: i === 0 })));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +827,10 @@ export class ExtensionInfoAction extends ExtensionAction {
|
||||
this.enabled = !!this.extension;
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
|
||||
const name = localize('extensionInfoName', 'Name: {0}', this.extension.displayName);
|
||||
const id = localize('extensionInfoId', 'Id: {0}', this.extension.identifier.id);
|
||||
@@ -843,7 +860,11 @@ export class ExtensionSettingsAction extends ExtensionAction {
|
||||
update(): void {
|
||||
this.enabled = !!this.extension;
|
||||
}
|
||||
run(): Promise<any> {
|
||||
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
this.preferencesService.openSettings(false, `@ext:${this.extension.identifier.id}`);
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -871,7 +892,10 @@ export class EnableForWorkspaceAction extends ExtensionAction {
|
||||
}
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.EnabledWorkspace);
|
||||
}
|
||||
}
|
||||
@@ -898,7 +922,10 @@ export class EnableGloballyAction extends ExtensionAction {
|
||||
}
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.EnabledGlobally);
|
||||
}
|
||||
}
|
||||
@@ -919,14 +946,17 @@ export class DisableForWorkspaceAction extends ExtensionAction {
|
||||
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY)) {
|
||||
if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension!.identifier) && this.workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY)) {
|
||||
this.enabled = this.extension.state === ExtensionState.Installed
|
||||
&& (this.extension.enablementState === EnablementState.EnabledGlobally || this.extension.enablementState === EnablementState.EnabledWorkspace)
|
||||
&& this.extensionEnablementService.canChangeEnablement(this.extension.local);
|
||||
}
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.DisabledWorkspace);
|
||||
}
|
||||
}
|
||||
@@ -946,14 +976,17 @@ export class DisableGloballyAction extends ExtensionAction {
|
||||
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))) {
|
||||
if (this.extension && this.extension.local && this.runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension!.identifier))) {
|
||||
this.enabled = this.extension.state === ExtensionState.Installed
|
||||
&& (this.extension.enablementState === EnablementState.EnabledGlobally || this.extension.enablementState === EnablementState.EnabledWorkspace)
|
||||
&& this.extensionEnablementService.canChangeEnablement(this.extension.local);
|
||||
}
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
async run(): Promise<any> {
|
||||
if (!this.extension) {
|
||||
return;
|
||||
}
|
||||
return this.extensionsWorkbenchService.setEnablement(this.extension, EnablementState.DisabledGlobally);
|
||||
}
|
||||
}
|
||||
@@ -1038,6 +1071,7 @@ export class CheckForUpdatesAction extends Action {
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService,
|
||||
@IViewletService private readonly viewletService: IViewletService,
|
||||
@IDialogService private readonly dialogService: IDialogService,
|
||||
@INotificationService private readonly notificationService: INotificationService
|
||||
) {
|
||||
super(id, label, '', true);
|
||||
@@ -1046,7 +1080,7 @@ export class CheckForUpdatesAction extends Action {
|
||||
private checkUpdatesAndNotify(): void {
|
||||
const outdated = this.extensionsWorkbenchService.outdated;
|
||||
if (!outdated.length) {
|
||||
this.notificationService.info(localize('noUpdatesAvailable', "All extensions are up to date."));
|
||||
this.dialogService.show(Severity.Info, localize('noUpdatesAvailable', "All extensions are up to date."), [localize('ok', "OK")]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1138,8 +1172,6 @@ export class UpdateAllAction extends Action {
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IProductService private readonly productService: IProductService
|
||||
) {
|
||||
super(id, label, '', false);
|
||||
|
||||
@@ -1163,7 +1195,7 @@ export class UpdateAllAction extends Action {
|
||||
|
||||
console.error(err);
|
||||
|
||||
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService, this.productService);
|
||||
return promptDownloadManually(extension.gallery, localize('failedToUpdate', "Failed to update \'{0}\'.", extension.identifier.id), err, this.instantiationService);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1181,7 +1213,9 @@ export class ReloadAction extends ExtensionAction {
|
||||
@IHostService private readonly hostService: IHostService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService,
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
) {
|
||||
super('extensions.reload', localize('reloadAction', "Reload"), ReloadAction.DisabledClass, false);
|
||||
this._register(this.extensionService.onDidChangeExtensions(this.updateRunningExtensions, this));
|
||||
@@ -1210,11 +1244,11 @@ export class ReloadAction extends ExtensionAction {
|
||||
}
|
||||
|
||||
private computeReloadState(): void {
|
||||
if (!this._runningExtensions) {
|
||||
if (!this._runningExtensions || !this.extension) {
|
||||
return;
|
||||
}
|
||||
const isUninstalled = this.extension.state === ExtensionState.Uninstalled;
|
||||
const runningExtension = this._runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))[0];
|
||||
const runningExtension = this._runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension!.identifier))[0];
|
||||
const isSameExtensionRunning = runningExtension && this.extension.server === this.extensionManagementServerService.getExtensionManagementServer(runningExtension.extensionLocation);
|
||||
|
||||
if (isUninstalled) {
|
||||
@@ -1233,16 +1267,37 @@ export class ReloadAction extends ExtensionAction {
|
||||
// Extension is running
|
||||
if (runningExtension) {
|
||||
if (isEnabled) {
|
||||
if (!this.extensionService.canAddExtension(toExtensionDescription(this.extension.local))) {
|
||||
if (isSameExtensionRunning) {
|
||||
if (this.extension.version !== runningExtension.version) {
|
||||
// No Reload is required if extension can run without reload
|
||||
if (this.extensionService.canAddExtension(toExtensionDescription(this.extension.local))) {
|
||||
return;
|
||||
}
|
||||
if (isSameExtensionRunning) {
|
||||
// Different version of same extension is running. Requires reload to run the current version
|
||||
if (this.extension.version !== runningExtension.version) {
|
||||
this.enabled = true;
|
||||
this.label = localize('reloadRequired', "Reload Required");
|
||||
this.tooltip = localize('postUpdateTooltip', "Please reload Azure Data Studio to enable the updated extension."); // {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
}
|
||||
} else {
|
||||
const runningExtensionServer = this.extensionManagementServerService.getExtensionManagementServer(runningExtension.extensionLocation);
|
||||
if (this.extension.server === this.extensionManagementServerService.localExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
// This extension prefers to run on UI/Local side but is running in remote
|
||||
if (prefersExecuteOnUI(this.extension.local!.manifest, this.productService, this.configurationService)) {
|
||||
this.enabled = true;
|
||||
this.label = localize('reloadRequired', "Reload Required");
|
||||
// {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
this.tooltip = localize('postUpdateTooltip', "Please reload Azure Data Studio to enable the updated extension.");
|
||||
this.tooltip = localize('postEnableTooltip', "Please reload Azure Data Studio to enable this extension."); // {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
}
|
||||
}
|
||||
if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.localExtensionManagementServer) {
|
||||
// This extension prefers to run on Workspace/Remote side but is running in local
|
||||
if (prefersExecuteOnWorkspace(this.extension.local!.manifest, this.productService, this.configurationService)) {
|
||||
this.enabled = true;
|
||||
this.label = localize('reloadRequired', "Reload Required");
|
||||
this.tooltip = localize('postEnableTooltip', "Please reload Azure Data Studio to enable this extension."); // {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (isSameExtensionRunning) {
|
||||
this.enabled = true;
|
||||
@@ -1265,7 +1320,7 @@ export class ReloadAction extends ExtensionAction {
|
||||
|
||||
const otherServer = this.extension.server ? this.extension.server === this.extensionManagementServerService.localExtensionManagementServer ? this.extensionManagementServerService.remoteExtensionManagementServer : this.extensionManagementServerService.localExtensionManagementServer : null;
|
||||
if (otherServer && this.extension.enablementState === EnablementState.DisabledByExtensionKind) {
|
||||
const extensionInOtherServer = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server === otherServer)[0];
|
||||
const extensionInOtherServer = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension!.identifier) && e.server === otherServer)[0];
|
||||
// Same extension in other server exists and
|
||||
if (extensionInOtherServer && extensionInOtherServer.local && this.extensionEnablementService.isEnabled(extensionInOtherServer.local)) {
|
||||
this.enabled = true;
|
||||
@@ -1323,8 +1378,8 @@ export class SetColorThemeAction extends ExtensionAction {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
let extensionThemes = SetColorThemeAction.getColorThemes(this.colorThemes, this.extension);
|
||||
const currentTheme = this.colorThemes.filter(t => t.settingsId === this.configurationService.getValue(COLOR_THEME_SETTING))[0];
|
||||
let extensionThemes = SetColorThemeAction.getColorThemes(this.colorThemes, this.extension!);
|
||||
const currentTheme = this.colorThemes.filter(t => t.settingsId === this.configurationService.getValue(COLOR_THEME_SETTING))[0] || this.workbenchThemeService.getColorTheme();
|
||||
showCurrentTheme = showCurrentTheme || extensionThemes.some(t => t.id === currentTheme.id);
|
||||
if (showCurrentTheme) {
|
||||
extensionThemes = extensionThemes.filter(t => t.id !== currentTheme.id);
|
||||
@@ -1389,7 +1444,7 @@ export class SetFileIconThemeAction extends ExtensionAction {
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
let extensionThemes = SetFileIconThemeAction.getFileIconThemes(this.fileIconThemes, this.extension);
|
||||
let extensionThemes = SetFileIconThemeAction.getFileIconThemes(this.fileIconThemes, this.extension!);
|
||||
const currentTheme = this.fileIconThemes.filter(t => t.settingsId === this.configurationService.getValue(ICON_THEME_SETTING))[0] || this.workbenchThemeService.getFileIconTheme();
|
||||
showCurrentTheme = showCurrentTheme || extensionThemes.some(t => t.id === currentTheme.id);
|
||||
if (showCurrentTheme) {
|
||||
@@ -1518,7 +1573,7 @@ export class ClearExtensionsInputAction extends Action {
|
||||
value: string,
|
||||
@IViewletService private readonly viewletService: IViewletService
|
||||
) {
|
||||
super(id, label, 'clear-extensions', true);
|
||||
super(id, label, 'codicon-clear-all', true);
|
||||
this.onSearchChange(value);
|
||||
this._register(onSearchChange(this.onSearchChange, this));
|
||||
}
|
||||
@@ -1643,9 +1698,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action {
|
||||
label: string = InstallWorkspaceRecommendedExtensionsAction.LABEL,
|
||||
recommendations: IExtensionRecommendation[],
|
||||
@IViewletService private readonly viewletService: IViewletService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||
@@ -1676,7 +1729,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action {
|
||||
private async installExtension(extension: IExtension): Promise<void> {
|
||||
try {
|
||||
if (extension.local && extension.gallery) {
|
||||
if (isUIExtension(extension.local.manifest, this.productService, this.configurationService)) {
|
||||
if (prefersExecuteOnUI(extension.local.manifest, this.productService, this.configurationService)) {
|
||||
if (this.extensionManagementServerService.localExtensionManagementServer) {
|
||||
await this.extensionManagementServerService.localExtensionManagementServer.extensionManagementService.installFromGallery(extension.gallery);
|
||||
return;
|
||||
@@ -1689,7 +1742,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action {
|
||||
await this.extensionWorkbenchService.install(extension);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService, this.productService);
|
||||
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1704,11 +1757,8 @@ export class InstallRecommendedExtensionAction extends Action {
|
||||
constructor(
|
||||
extensionId: string,
|
||||
@IViewletService private readonly viewletService: IViewletService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IOpenerService private readonly openerService: IOpenerService,
|
||||
@IExtensionsWorkbenchService private readonly extensionWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IProductService private readonly productService: IProductService
|
||||
) {
|
||||
super(InstallRecommendedExtensionAction.ID, InstallRecommendedExtensionAction.LABEL, undefined, false);
|
||||
this.extensionId = extensionId;
|
||||
@@ -1727,7 +1777,7 @@ export class InstallRecommendedExtensionAction extends Action {
|
||||
return this.extensionWorkbenchService.install(extension)
|
||||
.then(() => null, err => {
|
||||
console.error(err);
|
||||
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService, this.notificationService, this.openerService, this.productService);
|
||||
return promptDownloadManually(extension.gallery, localize('failedToInstall', "Failed to install \'{0}\'.", extension.identifier.id), err, this.instantiationService);
|
||||
});
|
||||
}
|
||||
return null;
|
||||
@@ -1742,9 +1792,8 @@ export class IgnoreExtensionRecommendationAction extends Action {
|
||||
|
||||
private static readonly Class = 'extension-action ignore';
|
||||
|
||||
extension: IExtension;
|
||||
|
||||
constructor(
|
||||
private readonly extension: IExtension,
|
||||
@IExtensionTipsService private readonly extensionsTipsService: IExtensionTipsService,
|
||||
) {
|
||||
super(IgnoreExtensionRecommendationAction.ID, 'Ignore Recommendation');
|
||||
@@ -1766,9 +1815,8 @@ export class UndoIgnoreExtensionRecommendationAction extends Action {
|
||||
|
||||
private static readonly Class = 'extension-action undo-ignore';
|
||||
|
||||
extension: IExtension;
|
||||
|
||||
constructor(
|
||||
private readonly extension: IExtension,
|
||||
@IExtensionTipsService private readonly extensionsTipsService: IExtensionTipsService,
|
||||
) {
|
||||
super(UndoIgnoreExtensionRecommendationAction.ID, 'Undo');
|
||||
@@ -2124,7 +2172,7 @@ export abstract class AbstractConfigureRecommendedExtensionsAction extends Actio
|
||||
protected getWorkspaceFolderExtensionsConfigContent(extensionsFileResource: URI): Promise<IExtensionsConfigContent> {
|
||||
return Promise.resolve(this.fileService.readFile(extensionsFileResource))
|
||||
.then(content => {
|
||||
return (<IExtensionsConfigContent>json.parse(content.value.toString()));
|
||||
return (<IExtensionsConfigContent>json.parse(content.value.toString()) || {}) as IExtensionsConfigContent; // {{SQL CARBON EDIT}} strict-null-check
|
||||
}, err => ({ recommendations: [], unwantedRecommendations: [] }));
|
||||
}
|
||||
|
||||
@@ -2412,9 +2460,9 @@ export class StatusLabelAction extends Action implements IExtensionContainer {
|
||||
private status: ExtensionState | null = null;
|
||||
private enablementState: EnablementState | null = null;
|
||||
|
||||
private _extension: IExtension;
|
||||
get extension(): IExtension { return this._extension; }
|
||||
set extension(extension: IExtension) {
|
||||
private _extension: IExtension | null = null;
|
||||
get extension(): IExtension | null { return this._extension; }
|
||||
set extension(extension: IExtension | null) {
|
||||
if (!(this._extension && extension && areSameExtensions(this._extension.identifier, extension.identifier))) {
|
||||
// Different extension. Reset
|
||||
this.initialStatus = null;
|
||||
@@ -2455,21 +2503,21 @@ export class StatusLabelAction extends Action implements IExtensionContainer {
|
||||
|
||||
const runningExtensions = await this.extensionService.getExtensions();
|
||||
const canAddExtension = () => {
|
||||
const runningExtension = runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))[0];
|
||||
if (this.extension.local) {
|
||||
if (runningExtension && this.extension.version === runningExtension.version) {
|
||||
const runningExtension = runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension!.identifier))[0];
|
||||
if (this.extension!.local) {
|
||||
if (runningExtension && this.extension!.version === runningExtension.version) {
|
||||
return true;
|
||||
}
|
||||
return this.extensionService.canAddExtension(toExtensionDescription(this.extension.local));
|
||||
return this.extensionService.canAddExtension(toExtensionDescription(this.extension!.local));
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const canRemoveExtension = () => {
|
||||
if (this.extension.local) {
|
||||
if (runningExtensions.every(e => !(areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier) && this.extension.server === this.extensionManagementServerService.getExtensionManagementServer(e.extensionLocation)))) {
|
||||
if (this.extension!.local) {
|
||||
if (runningExtensions.every(e => !(areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension!.identifier) && this.extension!.server === this.extensionManagementServerService.getExtensionManagementServer(e.extensionLocation)))) {
|
||||
return true;
|
||||
}
|
||||
return this.extensionService.canRemoveExtension(toExtensionDescription(this.extension.local));
|
||||
return this.extensionService.canRemoveExtension(toExtensionDescription(this.extension!.local));
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -2572,7 +2620,7 @@ export class ExtensionToolTipAction extends ExtensionAction {
|
||||
return this.warningAction.tooltip;
|
||||
}
|
||||
if (this.extension && this.extension.local && this.extension.state === ExtensionState.Installed && this._runningExtensions) {
|
||||
const isRunning = this._runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier));
|
||||
const isRunning = this._runningExtensions.some(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension!.identifier));
|
||||
const isEnabled = this.extensionEnablementService.isEnabled(this.extension.local);
|
||||
|
||||
if (isEnabled && isRunning) {
|
||||
@@ -2609,8 +2657,8 @@ export class ExtensionToolTipAction extends ExtensionAction {
|
||||
export class SystemDisabledWarningAction extends ExtensionAction {
|
||||
|
||||
private static readonly CLASS = 'system-disable';
|
||||
private static readonly WARNING_CLASS = `${SystemDisabledWarningAction.CLASS} warning`;
|
||||
private static readonly INFO_CLASS = `${SystemDisabledWarningAction.CLASS} info`;
|
||||
private static readonly WARNING_CLASS = `${SystemDisabledWarningAction.CLASS} codicon-warning`;
|
||||
private static readonly INFO_CLASS = `${SystemDisabledWarningAction.CLASS} codicon-info`;
|
||||
|
||||
updateWhenCounterExtensionChanges: boolean = true;
|
||||
private _runningExtensions: IExtensionDescription[] | null = null;
|
||||
@@ -2620,7 +2668,8 @@ export class SystemDisabledWarningAction extends ExtensionAction {
|
||||
@ILabelService private readonly labelService: ILabelService,
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
) {
|
||||
super('extensions.install', '', `${SystemDisabledWarningAction.CLASS} hide`, false);
|
||||
this._register(this.labelService.onDidChangeFormatters(() => this.update(), this));
|
||||
@@ -2641,37 +2690,48 @@ export class SystemDisabledWarningAction extends ExtensionAction {
|
||||
!this.extension.local ||
|
||||
!this.extension.server ||
|
||||
!this._runningExtensions ||
|
||||
!(this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) ||
|
||||
this.extension.state !== ExtensionState.Installed
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||
if (!this.extensionsWorkbenchService.installed.some(e => areSameExtensions(e.identifier, this.extension.identifier) && e.server !== this.extension.server)) {
|
||||
this.class = `${SystemDisabledWarningAction.INFO_CLASS}`;
|
||||
this.tooltip = this.extension.server === this.extensionManagementServerService.localExtensionManagementServer
|
||||
? localize('Install language pack also in remote server', "Install the language pack extension on '{0}' to enable it also there.", this.extensionManagementServerService.remoteExtensionManagementServer.label)
|
||||
: localize('Install language pack also locally', "Install the language pack extension locally to enable it also there.");
|
||||
if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||
if (!this.extensionsWorkbenchService.installed.some(e => areSameExtensions(e.identifier, this.extension!.identifier) && e.server !== this.extension!.server)) {
|
||||
this.class = `${SystemDisabledWarningAction.INFO_CLASS}`;
|
||||
this.tooltip = this.extension.server === this.extensionManagementServerService.localExtensionManagementServer
|
||||
? localize('Install language pack also in remote server', "Install the language pack extension on '{0}' to enable it also there.", this.extensionManagementServerService.remoteExtensionManagementServer.label)
|
||||
: localize('Install language pack also locally', "Install the language pack extension locally to enable it also there.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const runningExtension = this._runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension.identifier))[0];
|
||||
if (!runningExtension && this.extension.enablementState === EnablementState.DisabledByExtensionKind) {
|
||||
this.class = `${SystemDisabledWarningAction.WARNING_CLASS}`;
|
||||
const server = this.extensionManagementServerService.localExtensionManagementServer === this.extension.server ? this.extensionManagementServerService.remoteExtensionManagementServer : this.extensionManagementServerService.localExtensionManagementServer;
|
||||
this.tooltip = localize('Install in other server to enable', "Install the extension on '{0}' to enable.", server.label);
|
||||
return;
|
||||
if (this.extension.enablementState === EnablementState.DisabledByExtensionKind) {
|
||||
if (!this.extensionsWorkbenchService.installed.some(e => areSameExtensions(e.identifier, this.extension!.identifier) && e.server !== this.extension!.server)) {
|
||||
const server = this.extensionManagementServerService.localExtensionManagementServer === this.extension.server ? this.extensionManagementServerService.remoteExtensionManagementServer : this.extensionManagementServerService.localExtensionManagementServer;
|
||||
this.class = `${SystemDisabledWarningAction.WARNING_CLASS}`;
|
||||
if (server) {
|
||||
this.tooltip = localize('Install in other server to enable', "Install the extension on '{0}' to enable.", server.label);
|
||||
} else {
|
||||
this.tooltip = localize('disabled because of extension kind', "This extension cannot be enabled in the remote server.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (this.extensionEnablementService.isEnabled(this.extension.local)) {
|
||||
if (this.extensionManagementServerService.localExtensionManagementServer && this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
const runningExtension = this._runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value, uuid: e.uuid }, this.extension!.identifier))[0];
|
||||
const runningExtensionServer = runningExtension ? this.extensionManagementServerService.getExtensionManagementServer(runningExtension.extensionLocation) : null;
|
||||
if (this.extension.server === this.extensionManagementServerService.localExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.remoteExtensionManagementServer) {
|
||||
this.class = `${SystemDisabledWarningAction.INFO_CLASS}`;
|
||||
this.tooltip = localize('disabled locally', "Extension is enabled on '{0}' and disabled locally.", this.extensionManagementServerService.remoteExtensionManagementServer.label);
|
||||
if (prefersExecuteOnWorkspace(this.extension.local!.manifest, this.productService, this.configurationService)) {
|
||||
this.class = `${SystemDisabledWarningAction.INFO_CLASS}`;
|
||||
this.tooltip = localize('disabled locally', "Extension is enabled on '{0}' and disabled locally.", this.extensionManagementServerService.remoteExtensionManagementServer.label);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.localExtensionManagementServer) {
|
||||
this.class = `${SystemDisabledWarningAction.INFO_CLASS}`;
|
||||
this.tooltip = localize('disabled remotely', "Extension is enabled locally and disabled on '{0}'.", this.extensionManagementServerService.remoteExtensionManagementServer.label);
|
||||
if (prefersExecuteOnUI(this.extension.local!.manifest, this.productService, this.configurationService)) {
|
||||
this.class = `${SystemDisabledWarningAction.INFO_CLASS}`;
|
||||
this.tooltip = localize('disabled remotely', "Extension is enabled locally and disabled on '{0}'.", this.extensionManagementServerService.remoteExtensionManagementServer.label);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,10 @@ export class ExtensionDependencyChecker extends Disposable implements IWorkbench
|
||||
@IHostService private readonly hostService: IHostService
|
||||
) {
|
||||
super();
|
||||
CommandsRegistry.registerCommand('workbench.extensions.installMissingDepenencies', () => this.installMissingDependencies());
|
||||
CommandsRegistry.registerCommand('workbench.extensions.installMissingDependencies', () => this.installMissingDependencies());
|
||||
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
||||
command: {
|
||||
id: 'workbench.extensions.installMissingDepenencies',
|
||||
id: 'workbench.extensions.installMissingDependencies',
|
||||
category: localize('extensions', "Extensions"),
|
||||
title: localize('auto install missing deps', "Install Missing Dependencies")
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import { IListVirtualDelegate, IListRenderer } from 'vs/base/browser/ui/list/lis
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { isNonEmptyArray } from 'vs/base/common/arrays';
|
||||
import { IColorMapping } from 'vs/platform/theme/common/styler';
|
||||
|
||||
export interface IExtensionTemplateData {
|
||||
icon: HTMLImageElement;
|
||||
@@ -179,6 +180,7 @@ export class ExtensionsTree extends WorkbenchAsyncDataTree<IExtensionData, IExte
|
||||
constructor(
|
||||
input: IExtensionData,
|
||||
container: HTMLElement,
|
||||
overrideStyles: IColorMapping,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IListService listService: IListService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@@ -206,7 +208,8 @@ export class ExtensionsTree extends WorkbenchAsyncDataTree<IExtensionData, IExte
|
||||
{
|
||||
indent: 40,
|
||||
identityProvider,
|
||||
multipleSelectionSupport: false
|
||||
multipleSelectionSupport: false,
|
||||
overrideStyles
|
||||
},
|
||||
contextKeyService, listService, themeService, configurationService, keybindingService, accessibilityService
|
||||
);
|
||||
|
||||
@@ -46,7 +46,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { IAddedViewDescriptorRef } from 'vs/workbench/browser/parts/views/views';
|
||||
import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet';
|
||||
import { ViewletPane } from 'vs/workbench/browser/parts/views/paneViewlet';
|
||||
import { Query } from 'vs/workbench/contrib/extensions/common/extensionQuery';
|
||||
import { SuggestEnabledInput, attachSuggestEnabledInputBoxStyler } from 'vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput';
|
||||
import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
@@ -446,7 +446,7 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
|
||||
if (this.searchBox) {
|
||||
this.searchBox.layout({ height: 20, width: dimension.width - 34 });
|
||||
}
|
||||
super.layout(new Dimension(dimension.width, dimension.height - 38));
|
||||
super.layout(new Dimension(dimension.width, dimension.height - 41));
|
||||
}
|
||||
|
||||
getOptimalWidth(): number {
|
||||
@@ -531,13 +531,13 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
|
||||
this.nonEmptyWorkspaceContextKey.set(this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY);
|
||||
this.defaultViewsContextKey.set(!value);
|
||||
|
||||
return this.progress(Promise.all(this.panels.map(view =>
|
||||
return this.progress(Promise.all(this.panes.map(view =>
|
||||
(<ExtensionsListView>view).show(this.normalizedQuery())
|
||||
.then(model => this.alertSearchResult(model.length, view.id))
|
||||
))).then(() => undefined);
|
||||
}
|
||||
|
||||
protected onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPanel[] {
|
||||
protected onDidAddViews(added: IAddedViewDescriptorRef[]): ViewletPane[] {
|
||||
const addedViews = super.onDidAddViews(added);
|
||||
this.progress(Promise.all(addedViews.map(addedView =>
|
||||
(<ExtensionsListView>addedView).show(this.normalizedQuery())
|
||||
@@ -568,12 +568,12 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
|
||||
}
|
||||
|
||||
private count(): number {
|
||||
return this.panels.reduce((count, view) => (<ExtensionsListView>view).count() + count, 0);
|
||||
return this.panes.reduce((count, view) => (<ExtensionsListView>view).count() + count, 0);
|
||||
}
|
||||
|
||||
private focusListView(): void {
|
||||
if (this.count() > 0) {
|
||||
this.panels[0].focus();
|
||||
this.panes[0].focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import { InstallWorkspaceRecommendedExtensionsAction, ConfigureWorkspaceFolderRe
|
||||
import { WorkbenchPagedList } from 'vs/platform/list/browser/listService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet';
|
||||
import { ViewletPane, IViewletPaneOptions } from 'vs/workbench/browser/parts/views/paneViewlet';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { distinct, coalesce, firstIndex } from 'vs/base/common/arrays';
|
||||
import { IExperimentService, IExperiment, ExperimentActionType } from 'vs/workbench/contrib/experiments/common/experimentService';
|
||||
@@ -47,6 +47,7 @@ import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { SeverityIcon } from 'vs/platform/severityIcon/common/severityIcon';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
|
||||
|
||||
class ExtensionsViewState extends Disposable implements IExtensionsViewState {
|
||||
@@ -72,7 +73,7 @@ export interface ExtensionsListViewOptions extends IViewletViewOptions {
|
||||
|
||||
class ExtensionListViewWarning extends Error { }
|
||||
|
||||
export class ExtensionsListView extends ViewletPanel {
|
||||
export class ExtensionsListView extends ViewletPane {
|
||||
|
||||
protected readonly server: IExtensionManagementServer | undefined;
|
||||
private bodyTemplate: {
|
||||
@@ -105,7 +106,7 @@ export class ExtensionsListView extends ViewletPanel {
|
||||
@IProductService protected readonly productService: IProductService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
) {
|
||||
super({ ...(options as IViewletPanelOptions), ariaHeaderLabel: options.title, showActionsAlways: true }, keybindingService, contextMenuService, configurationService, contextKeyService);
|
||||
super({ ...(options as IViewletPaneOptions), ariaHeaderLabel: options.title, showActionsAlways: true }, keybindingService, contextMenuService, configurationService, contextKeyService);
|
||||
this.server = options.server;
|
||||
}
|
||||
|
||||
@@ -125,11 +126,14 @@ export class ExtensionsListView extends ViewletPanel {
|
||||
const delegate = new Delegate();
|
||||
const extensionsViewState = new ExtensionsViewState();
|
||||
const renderer = this.instantiationService.createInstance(Renderer, extensionsViewState);
|
||||
this.list = this.instantiationService.createInstance(WorkbenchPagedList, 'Extensions', extensionsList, delegate, [renderer], {
|
||||
this.list = this.instantiationService.createInstance<typeof WorkbenchPagedList, WorkbenchPagedList<IExtension>>(WorkbenchPagedList, 'Extensions', extensionsList, delegate, [renderer], {
|
||||
ariaLabel: localize('extensions', "Extensions"),
|
||||
multipleSelectionSupport: false,
|
||||
setRowLineHeight: false,
|
||||
horizontalScrolling: false
|
||||
horizontalScrolling: false,
|
||||
overrideStyles: {
|
||||
listBackground: SIDE_BAR_BACKGROUND
|
||||
}
|
||||
});
|
||||
this._register(this.list.onContextMenu(e => this.onContextMenu(e), this));
|
||||
this._register(this.list.onFocusChange(e => extensionsViewState.onFocusChange(coalesce(e.elements)), this));
|
||||
|
||||
@@ -121,18 +121,18 @@ export class RatingsWidget extends ExtensionWidget {
|
||||
const rating = Math.round(this.extension.rating * 2) / 2;
|
||||
|
||||
if (this.small) {
|
||||
append(this.container, $('span.full.star'));
|
||||
append(this.container, $('span.codicon.codicon-star-full'));
|
||||
|
||||
const count = append(this.container, $('span.count'));
|
||||
count.textContent = String(rating);
|
||||
} else {
|
||||
for (let i = 1; i <= 5; i++) {
|
||||
if (rating >= i) {
|
||||
append(this.container, $('span.full.star'));
|
||||
append(this.container, $('span.codicon.codicon-star-full'));
|
||||
} else if (rating >= i - 0.5) {
|
||||
append(this.container, $('span.half.star'));
|
||||
append(this.container, $('span.codicon.codicon-star-half'));
|
||||
} else {
|
||||
append(this.container, $('span.empty.star'));
|
||||
append(this.container, $('span.codicon.codicon-star-empty'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,12 +525,12 @@ export class ExtensionsWorkbenchService extends Disposable implements IExtension
|
||||
@IOpenerService private readonly openerService: IOpenerService // {{SQL CARBON EDIT}}
|
||||
) {
|
||||
super();
|
||||
if (this.extensionManagementServerService.localExtensionManagementServer) {
|
||||
if (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 ? 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) {
|
||||
if (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 ? e.extension : undefined)));
|
||||
this._register(Event.filter(this.remoteExtensions.onChange, e => !!e && e.operation === InstallOperation.Install)(e => this.onDidInstallExtension(e!.extension)));
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10 12.6L10.7 13.3L12.3 11.7L13.9 13.3L14.7 12.6L13 11L14.7 9.40005L13.9 8.60005L12.3 10.3L10.7 8.60005L10 9.40005L11.6 11L10 12.6Z" fill="#C5C5C5"/>
|
||||
<path d="M1 4L15 4L15 3L1 3L1 4Z" fill="#C5C5C5"/>
|
||||
<path d="M1 7L15 7L15 6L1 6L1 7Z" fill="#C5C5C5"/>
|
||||
<path d="M9 9.5L9 9L1 9L1 10L9 10L9 9.5Z" fill="#C5C5C5"/>
|
||||
<path d="M9 13L9 12.5L9 12L1 12L1 13L9 13Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 484 B |
@@ -1,7 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10 12.6L10.7 13.3L12.3 11.7L13.9 13.3L14.7 12.6L13 11L14.7 9.40005L13.9 8.60005L12.3 10.3L10.7 8.60005L10 9.40005L11.6 11L10 12.6Z" fill="white"/>
|
||||
<path d="M1 4L15 4L15 3L1 3L1 4Z" fill="white"/>
|
||||
<path d="M1 7L15 7L15 6L1 6L1 7Z" fill="white"/>
|
||||
<path d="M9 9.5L9 9L1 9L1 10L9 10L9 9.5Z" fill="white"/>
|
||||
<path d="M9 13L9 12.5L9 12L1 12L1 13L9 13Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 474 B |
@@ -1,7 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10 12.6L10.7 13.3L12.3 11.7L13.9 13.3L14.7 12.6L13 11L14.7 9.40005L13.9 8.60005L12.3 10.3L10.7 8.60005L10 9.40005L11.6 11L10 12.6Z" fill="#424242"/>
|
||||
<path d="M1 4L15 4L15 3L1 3L1 4Z" fill="#424242"/>
|
||||
<path d="M1 7L15 7L15 6L1 6L1 7Z" fill="#424242"/>
|
||||
<path d="M9 9.5L9 9L1 9L1 10L9 10L9 9.5Z" fill="#424242"/>
|
||||
<path d="M9 13L9 12.5L9 12L1 12L1 13L9 13Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 484 B |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
@@ -12,18 +12,6 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .action-label.clear-extensions {
|
||||
background: url('clear-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-action-bar .action-item .action-label.clear-extensions {
|
||||
background: url('clear-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .monaco-action-bar .action-item .action-label.clear-extensions {
|
||||
background: url('clear-hc.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .action-label.extension-action.multiserver.install:after,
|
||||
.monaco-action-bar .action-item .action-label.extension-action.multiserver.update:after,
|
||||
.monaco-action-bar .action-item .action-label.extension-action.extension-editor-dropdown-action.dropdown:after {
|
||||
@@ -70,12 +58,18 @@
|
||||
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .action-label.disable-status {
|
||||
margin-left: 0;
|
||||
margin-top: 6px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .action-label.system-disable,
|
||||
.extensions-viewlet>.extensions .extension>.details>.footer>.monaco-action-bar .action-item .action-label.system-disable {
|
||||
margin: 0.15em;
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .action-label.system-disable {
|
||||
margin-right: 0.15em;
|
||||
}
|
||||
|
||||
.extensions-viewlet>.extensions .extension>.details>.footer>.monaco-action-bar .action-item .action-label.system-disable.codicon-info,
|
||||
.extensions-viewlet>.extensions .extension>.details>.footer>.monaco-action-bar .action-item .action-label.system-disable.codicon-warning {
|
||||
margin-top: 0.25em;
|
||||
margin-left: 0.1em;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .action-label.system-disable.codicon {
|
||||
@@ -104,17 +98,10 @@
|
||||
height: 18px;
|
||||
width: 10px;
|
||||
border: none;
|
||||
background: url('configure-light.svg') center center no-repeat;
|
||||
color: inherit;
|
||||
background: none;
|
||||
outline-offset: 0px;
|
||||
margin-top: 0.15em
|
||||
}
|
||||
|
||||
.vs-dark .extensions-viewlet>.extensions .extension>.details>.footer>.monaco-action-bar .action-item .action-label.extension-action.manage {
|
||||
background: url('configure-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .extensions-viewlet>.extensions .extension>.details>.footer>.monaco-action-bar .action-item .action-label.extension-action.manage {
|
||||
background: url('configure-hc.svg') center center no-repeat;
|
||||
margin-top: 0.2em;
|
||||
}
|
||||
|
||||
.extension-editor > .header.recommended > .details > .recommendation > .monaco-action-bar .actions-container {
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
padding-left: 20px;
|
||||
overflow: hidden;
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .title {
|
||||
@@ -77,6 +78,7 @@
|
||||
padding: 0px 4px;
|
||||
border-radius: 4px;
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -98,6 +100,7 @@
|
||||
padding: 0px 4px;
|
||||
border-radius: 4px;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .subtitle {
|
||||
@@ -111,6 +114,13 @@
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .subtitle,
|
||||
.extension-editor > .header > .details > .subtitle .install,
|
||||
.extension-editor > .header > .details > .subtitle .rating {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .subtitle > .install > .count {
|
||||
margin-left: 6px;
|
||||
}
|
||||
@@ -219,6 +229,7 @@
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
user-select: text;
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content.loading {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 1.5L15 0H22.5L24 1.5V9L22.5 10.5H15L13.5 9V1.5ZM15 1.5V9H22.5V1.5H15ZM0 15V6L1.5 4.5H9L10.5 6V13.5H18L19.5 15V22.5L18 24H10.5H9H1.5L0 22.5V15ZM9 13.5V6H1.5V13.5H9ZM9 15H1.5V22.5H9V15ZM10.5 22.5H18V15H10.5V22.5Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 385 B |
@@ -1,8 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.monaco-workbench .activitybar > .content .monaco-action-bar .action-label.extensions {
|
||||
-webkit-mask: url('extensions-activity-bar.svg') no-repeat 50% 50%;
|
||||
}
|
||||
@@ -21,10 +21,11 @@
|
||||
padding: 4px;
|
||||
border: 1px solid transparent;
|
||||
-webkit-appearance: textfield;
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions {
|
||||
height: calc(100% - 38px);
|
||||
height: calc(100% - 41px);
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension-view-header .monaco-action-bar {
|
||||
@@ -89,7 +90,7 @@
|
||||
top: 1px;
|
||||
left: 1px;
|
||||
color: inherit;
|
||||
font-size: 90%;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension {
|
||||
@@ -190,20 +191,28 @@
|
||||
font-size: 80%;
|
||||
padding-left: 6px;
|
||||
min-width: fit-content;
|
||||
min-width: -moz-fit-content;
|
||||
}
|
||||
|
||||
.extensions-viewlet:not(.narrow) > .extensions .extension > .details > .header-container > .header > .version {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count,
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .ratings {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count:not(:empty) {
|
||||
font-size: 80%;
|
||||
margin: 0 6px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .install-count > .codicon {
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header .codicon {
|
||||
font-size: 120%;
|
||||
margin-right: 2px;
|
||||
-webkit-mask: inherit;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .ratings {
|
||||
|
||||
@@ -11,40 +11,24 @@
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.extension-ratings > .star {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
.extension-ratings > .star:not(:first-child) {
|
||||
.extension-ratings > .codicon[class*='codicon-star']:not(:first-child) {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.extension-ratings.small > .star {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-image: url('star-small.svg');
|
||||
}
|
||||
|
||||
.extension-ratings > .full {
|
||||
background-image: url('star-full.svg');
|
||||
}
|
||||
|
||||
.extension-ratings > .half {
|
||||
background-image: url('star-half.svg');
|
||||
}
|
||||
|
||||
.extension-ratings > .empty {
|
||||
background-image: url('star-empty.svg');
|
||||
}
|
||||
|
||||
.extension-ratings > .count {
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.extension-ratings.small > .count {
|
||||
margin-left: 2px;
|
||||
}
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* TODO @misolori make this a color token */
|
||||
.extension-ratings .codicon-star-full,
|
||||
.extension-ratings .codicon-star-half {
|
||||
color: #FF8E00 !important;
|
||||
}
|
||||
|
||||
.extension-ratings .codicon-star-empty {
|
||||
opacity: .4;
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g opacity="0.5">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.59454 6.25211L8 1L6.40546 6.25211H1L5.37311 9.65247L3.7496 15L8 11.695L12.2504 15L10.6269 9.65247L15 6.25211H9.59454ZM2.34804 6.72168H6.72044L8 2.50706L8.00002 2.50708L6.72046 6.7217H2.34805L2.34804 6.72168ZM5.88539 9.4722L4.57848 13.7769L4.57851 13.7769L5.8854 9.47221L5.88539 9.4722ZM13.6519 6.7217L13.652 6.72168H9.27956L9.27958 6.7217H13.6519ZM4.90113 7.6229H7.26847L8.00002 5.21332L8.73156 7.6229H11.0989L9.18369 9.1121L9.91523 11.5217L8.00002 10.0325L6.0848 11.5217L6.81635 9.1121L4.90113 7.6229Z" fill="#C5C5C5"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 699 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.59454 6.25211L8 1L6.40546 6.25211H1L5.37311 9.65247L3.7496 15L8 11.695L12.2504 15L10.6269 9.65247L15 6.25211H9.59454Z" fill="#FF8E00"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 291 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.40546 6.25211L8 1L9.59454 6.25211H15L10.6269 9.65247L12.2504 15L8 11.695L3.7496 15L5.37311 9.65247L1 6.25211H6.40546ZM8 10.0325L8.00002 10.0325L9.91523 11.5217L9.18369 9.1121L11.0989 7.6229H8.73156L8.00002 5.21332L8 5.21338V10.0325V10.0325ZM8 2.50714L8.00002 2.50708L8 2.50706V2.50714ZM13.6519 6.7217L13.652 6.72168H9.27956L9.27958 6.7217H13.6519Z" fill="#FF8E00"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 521 B |
@@ -1,10 +0,0 @@
|
||||
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0)">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.99659 3.90757L5 0.625L4.00341 3.90757H0.625L3.35819 6.0328L2.3435 9.375L5 7.3094L7.6565 9.375L6.64181 6.0328L9.375 3.90757H5.99659Z" fill="#FF8E00"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0">
|
||||
<rect width="10" height="10" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 431 B |
@@ -81,7 +81,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio
|
||||
|
||||
if (visible) {
|
||||
const indicator: IStatusbarEntry = {
|
||||
text: nls.localize('profilingExtensionHost', "$(sync~spin) Profiling Extension Host"),
|
||||
text: '$(sync~spin) ' + nls.localize('profilingExtensionHost', "Profiling Extension Host"),
|
||||
tooltip: nls.localize('selectAndStartDebug', "Click to stop profiling."),
|
||||
command: 'workbench.action.extensionHostProfilder.stop'
|
||||
};
|
||||
@@ -89,7 +89,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio
|
||||
const timeStarted = Date.now();
|
||||
const handle = setInterval(() => {
|
||||
if (this.profilingStatusBarIndicator) {
|
||||
this.profilingStatusBarIndicator.update({ ...indicator, text: nls.localize('profilingExtensionHostTime', "$(sync~spin) Profiling Extension Host ({0} sec)", Math.round((new Date().getTime() - timeStarted) / 1000)), });
|
||||
this.profilingStatusBarIndicator.update({ ...indicator, text: '$(sync~spin) ' + nls.localize('profilingExtensionHostTime', "Profiling Extension Host ({0} sec)", Math.round((new Date().getTime() - timeStarted) / 1000)), });
|
||||
}
|
||||
}, 1000);
|
||||
this.profilingStatusBarIndicatorLabelUpdater.value = toDisposable(() => clearInterval(handle));
|
||||
|
||||
@@ -34,7 +34,7 @@ workbenchRegistry.registerWorkbenchContribution(ExtensionsAutoProfiler, Lifecycl
|
||||
|
||||
// Running Extensions Editor
|
||||
|
||||
const runtimeExtensionsEditorDescriptor = new EditorDescriptor(
|
||||
const runtimeExtensionsEditorDescriptor = EditorDescriptor.create(
|
||||
RuntimeExtensionsEditor,
|
||||
RuntimeExtensionsEditor.ID,
|
||||
localize('runtimeExtension', "Running Extensions")
|
||||
@@ -58,7 +58,7 @@ Registry.as<IEditorInputFactoryRegistry>(EditorInputExtensions.EditorInputFactor
|
||||
// Global actions
|
||||
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
||||
|
||||
actionRegistry.registerWorkbenchAction(new SyncActionDescriptor(ShowRuntimeExtensionsAction, ShowRuntimeExtensionsAction.ID, ShowRuntimeExtensionsAction.LABEL), 'Show Running Extensions', localize('developer', "Developer"));
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.create(ShowRuntimeExtensionsAction, ShowRuntimeExtensionsAction.ID, ShowRuntimeExtensionsAction.LABEL), 'Show Running Extensions', localize('developer', "Developer"));
|
||||
|
||||
class ExtensionsContributions implements IWorkbenchContribution {
|
||||
|
||||
@@ -66,7 +66,7 @@ class ExtensionsContributions implements IWorkbenchContribution {
|
||||
@IWorkbenchEnvironmentService workbenchEnvironmentService: IWorkbenchEnvironmentService
|
||||
) {
|
||||
if (workbenchEnvironmentService.extensionsPath) {
|
||||
const openExtensionsFolderActionDescriptor = new SyncActionDescriptor(OpenExtensionsFolderAction, OpenExtensionsFolderAction.ID, OpenExtensionsFolderAction.LABEL);
|
||||
const openExtensionsFolderActionDescriptor = SyncActionDescriptor.create(OpenExtensionsFolderAction, OpenExtensionsFolderAction.ID, OpenExtensionsFolderAction.LABEL);
|
||||
actionRegistry.registerWorkbenchAction(openExtensionsFolderActionDescriptor, 'Extensions: Open Extensions Folder', ExtensionsLabel);
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
command: {
|
||||
id: DebugExtensionHostAction.ID,
|
||||
title: DebugExtensionHostAction.LABEL,
|
||||
iconLocation: {
|
||||
icon: {
|
||||
dark: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/start-dark.svg`)),
|
||||
light: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/start-light.svg`)),
|
||||
}
|
||||
@@ -115,7 +115,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
command: {
|
||||
id: StartExtensionHostProfileAction.ID,
|
||||
title: StartExtensionHostProfileAction.LABEL,
|
||||
iconLocation: {
|
||||
icon: {
|
||||
dark: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/profile-start-dark.svg`)),
|
||||
light: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/profile-start-light.svg`)),
|
||||
}
|
||||
@@ -128,7 +128,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
command: {
|
||||
id: StopExtensionHostProfileAction.ID,
|
||||
title: StopExtensionHostProfileAction.LABEL,
|
||||
iconLocation: {
|
||||
icon: {
|
||||
dark: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/profile-stop-dark.svg`)),
|
||||
light: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/profile-stop-light.svg`)),
|
||||
}
|
||||
@@ -141,7 +141,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
command: {
|
||||
id: SaveExtensionHostProfileAction.ID,
|
||||
title: SaveExtensionHostProfileAction.LABEL,
|
||||
iconLocation: {
|
||||
icon: {
|
||||
dark: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/save-dark.svg`)),
|
||||
light: URI.parse(registerAndGetAmdImageURL(`vs/workbench/contrib/extensions/browser/media/save-light.svg`)),
|
||||
},
|
||||
|
||||
@@ -45,6 +45,7 @@ import { SlowExtensionAction } from 'vs/workbench/contrib/extensions/electron-br
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { editorBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
|
||||
export const IExtensionHostProfileService = createDecorator<IExtensionHostProfileService>('extensionHostProfileService');
|
||||
export const CONTEXT_PROFILE_SESSION_STATE = new RawContextKey<string>('profileSessionState', 'none');
|
||||
@@ -405,12 +406,15 @@ export class RuntimeExtensionsEditor extends BaseEditor {
|
||||
}
|
||||
};
|
||||
|
||||
this._list = this._instantiationService.createInstance(WorkbenchList,
|
||||
this._list = this._instantiationService.createInstance<typeof WorkbenchList, WorkbenchList<IRuntimeExtension>>(WorkbenchList,
|
||||
'RuntimeExtensions',
|
||||
parent, delegate, [renderer], {
|
||||
multipleSelectionSupport: false,
|
||||
setRowLineHeight: false,
|
||||
horizontalScrolling: false
|
||||
horizontalScrolling: false,
|
||||
overrideStyles: {
|
||||
listBackground: editorBackground
|
||||
}
|
||||
});
|
||||
|
||||
this._list.splice(0, this._list.length, this._elements || undefined);
|
||||
|
||||
@@ -497,7 +497,7 @@ suite('ExtensionsActions Test', () => {
|
||||
.then(extensions => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('extension-action manage', testObject.class);
|
||||
assert.equal('extension-action manage codicon-gear', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -512,7 +512,7 @@ suite('ExtensionsActions Test', () => {
|
||||
.then(page => {
|
||||
testObject.extension = page.firstPage[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action manage hide', testObject.class);
|
||||
assert.equal('extension-action manage codicon-gear hide', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -529,7 +529,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
installEvent.fire({ identifier: gallery.identifier, gallery });
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action manage hide', testObject.class);
|
||||
assert.equal('extension-action manage codicon-gear hide', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -547,7 +547,7 @@ suite('ExtensionsActions Test', () => {
|
||||
didInstallEvent.fire({ identifier: gallery.identifier, gallery, operation: InstallOperation.Install, local: aLocalExtension('a', gallery, gallery) });
|
||||
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('extension-action manage', testObject.class);
|
||||
assert.equal('extension-action manage codicon-gear', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -562,7 +562,7 @@ suite('ExtensionsActions Test', () => {
|
||||
.then(extensions => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('extension-action manage', testObject.class);
|
||||
assert.equal('extension-action manage codicon-gear', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -579,7 +579,7 @@ suite('ExtensionsActions Test', () => {
|
||||
uninstallEvent.fire(local.identifier);
|
||||
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action manage', testObject.class);
|
||||
assert.equal('extension-action manage codicon-gear', testObject.class);
|
||||
assert.equal('Uninstalling', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -1362,8 +1362,8 @@ suite('ExtensionsActions Test', () => {
|
||||
test('Test ReloadAction when extension is not installed but extension from different server is installed and running', async () => {
|
||||
// multi server setup
|
||||
const gallery = aGalleryExtension('a');
|
||||
const localExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file('pub.a') });
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const localExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file('pub.a') });
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localExtension]), createExtensionManagementService([remoteExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1391,8 +1391,8 @@ suite('ExtensionsActions Test', () => {
|
||||
test('Test ReloadAction when extension is uninstalled but extension from different server is installed and running', async () => {
|
||||
// multi server setup
|
||||
const gallery = aGalleryExtension('a');
|
||||
const localExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file('pub.a') });
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const localExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file('pub.a') });
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const localExtensionManagementService = createExtensionManagementService([localExtension]);
|
||||
const uninstallEvent = new Emitter<IExtensionIdentifier>();
|
||||
const onDidUninstallEvent = new Emitter<{ identifier: IExtensionIdentifier }>();
|
||||
@@ -1433,7 +1433,7 @@ suite('ExtensionsActions Test', () => {
|
||||
const remoteExtensionManagementService = createExtensionManagementService([]);
|
||||
const onDidInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
remoteExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event;
|
||||
const localExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file('pub.a') });
|
||||
const localExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file('pub.a') });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localExtension]), remoteExtensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1456,20 +1456,20 @@ suite('ExtensionsActions Test', () => {
|
||||
assert.ok(testObject.extension);
|
||||
assert.ok(!testObject.enabled);
|
||||
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
onDidInstallEvent.fire({ identifier: remoteExtension.identifier, local: remoteExtension, operation: InstallOperation.Install });
|
||||
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal(testObject.tooltip, 'Please reload Azure Data Studio to enable this extension.'); // {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
});
|
||||
|
||||
test('Test ReloadAction is disabled when remote ui extension is installed in local server', async () => {
|
||||
test('Test ReloadAction when ui extension is disabled on remote server and installed in local server', async () => {
|
||||
// multi server setup
|
||||
const gallery = aGalleryExtension('a');
|
||||
const localExtensionManagementService = createExtensionManagementService([]);
|
||||
const onDidInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
localExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event;
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, localExtensionManagementService, createExtensionManagementService([remoteExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1478,7 +1478,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
const onDidChangeExtensionsEmitter: Emitter<void> = new Emitter<void>();
|
||||
instantiationService.stub(IExtensionService, <Partial<IExtensionService>>{
|
||||
getExtensions: () => Promise.resolve([ExtensionsActions.toExtensionDescription(remoteExtension)]),
|
||||
getExtensions: () => Promise.resolve([]),
|
||||
onDidChangeExtensions: onDidChangeExtensionsEmitter.event,
|
||||
canAddExtension: (extension) => false
|
||||
});
|
||||
@@ -1492,20 +1492,21 @@ suite('ExtensionsActions Test', () => {
|
||||
assert.ok(testObject.extension);
|
||||
assert.ok(!testObject.enabled);
|
||||
|
||||
const localExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file('pub.a') });
|
||||
const localExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file('pub.a') });
|
||||
onDidInstallEvent.fire({ identifier: localExtension.identifier, local: localExtension, operation: InstallOperation.Install });
|
||||
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal(testObject.tooltip, 'Please reload Azure Data Studio to enable this extension.'); // {{SQL CARBON EDIT}} - replace Visual Studio Code with Azure Data Studio
|
||||
});
|
||||
|
||||
test('Test ReloadAction for remote ui extension is disabled when it is installed and enabled in local server', async () => {
|
||||
// multi server setup
|
||||
const gallery = aGalleryExtension('a');
|
||||
const localExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file('pub.a') });
|
||||
const localExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file('pub.a') });
|
||||
const localExtensionManagementService = createExtensionManagementService([localExtension]);
|
||||
const onDidInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
localExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event;
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, localExtensionManagementService, createExtensionManagementService([remoteExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1529,40 +1530,9 @@ suite('ExtensionsActions Test', () => {
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test ReloadAction for local ui extension is disabled when it is installed and enabled in remote server', async () => {
|
||||
// multi server setup
|
||||
const gallery = aGalleryExtension('a');
|
||||
const localExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file('pub.a') });
|
||||
const localExtensionManagementService = createExtensionManagementService([localExtension]);
|
||||
const onDidInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
localExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event;
|
||||
const remoteExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file('pub.a').with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, localExtensionManagementService, createExtensionManagementService([remoteExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
|
||||
instantiationService.set(IExtensionsWorkbenchService, workbenchService);
|
||||
|
||||
const onDidChangeExtensionsEmitter: Emitter<void> = new Emitter<void>();
|
||||
instantiationService.stub(IExtensionService, <Partial<IExtensionService>>{
|
||||
getExtensions: () => Promise.resolve([ExtensionsActions.toExtensionDescription(remoteExtension)]),
|
||||
onDidChangeExtensions: onDidChangeExtensionsEmitter.event,
|
||||
canAddExtension: (extension) => false
|
||||
});
|
||||
const testObject: ExtensionsActions.ReloadAction = instantiationService.createInstance(ExtensionsActions.ReloadAction);
|
||||
instantiationService.createInstance(ExtensionContainers, [testObject]);
|
||||
instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(gallery));
|
||||
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
const extensions = await workbenchService.queryLocal(extensionManagementServerService.localExtensionManagementServer!);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.extension);
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test remote install action is enabled for local workspace extension', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1586,7 +1556,7 @@ suite('ExtensionsActions Test', () => {
|
||||
const remoteExtensionManagementService: IExtensionManagementService = createExtensionManagementService();
|
||||
const onInstallExtension = new Emitter<InstallExtensionEvent>();
|
||||
remoteExtensionManagementService.onInstallExtension = onInstallExtension.event;
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), remoteExtensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1619,7 +1589,7 @@ suite('ExtensionsActions Test', () => {
|
||||
remoteExtensionManagementService.onInstallExtension = onInstallExtension.event;
|
||||
const onDidInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
remoteExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event;
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), remoteExtensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1644,14 +1614,14 @@ suite('ExtensionsActions Test', () => {
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
|
||||
const installedExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const installedExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
onDidInstallEvent.fire({ identifier: installedExtension.identifier, local: installedExtension, operation: InstallOperation.Install });
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test remote install action is enabled for disabled local workspace extension', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1673,7 +1643,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test remote install action is disabled when extension is not set', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]));
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
|
||||
@@ -1708,7 +1678,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test remote install action is disabled for local workspace extension which is disabled in env', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]));
|
||||
instantiationService.stub(IWorkbenchEnvironmentService, { disableExtensions: true } as IWorkbenchEnvironmentService);
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
@@ -1731,7 +1701,7 @@ suite('ExtensionsActions Test', () => {
|
||||
// single server setup
|
||||
const workbenchService = instantiationService.get(IExtensionsWorkbenchService);
|
||||
const extensionManagementServerService = instantiationService.get(IExtensionManagementServerService);
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localWorkspaceExtension]);
|
||||
instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(aGalleryExtension('a', { identifier: localWorkspaceExtension.identifier })));
|
||||
const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.RemoteInstallAction);
|
||||
@@ -1750,7 +1720,7 @@ suite('ExtensionsActions Test', () => {
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, extensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [localWorkspaceExtension]);
|
||||
const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
|
||||
instantiationService.set(IExtensionsWorkbenchService, workbenchService);
|
||||
@@ -1771,8 +1741,8 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test remote install action is disabled for local workspace extension if it is installed in remote', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), createExtensionManagementService([remoteWorkspaceExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1792,7 +1762,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test remote install action is enabled for local workspace extension if it has not gallery', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1811,7 +1781,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test remote install action is disabled for local workspace system extension', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceSystemExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`), type: ExtensionType.System });
|
||||
const localWorkspaceSystemExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`), type: ExtensionType.System });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceSystemExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1830,7 +1800,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test remote install action is disabled for local ui extension if it is not installed in remote', async () => {
|
||||
// multi server setup
|
||||
const localUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) });
|
||||
const localUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1849,8 +1819,8 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test remote install action is disabled for local ui extension if it is also installed in remote', async () => {
|
||||
// multi server setup
|
||||
const localUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const localUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localUIExtension]), createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1913,9 +1883,9 @@ suite('ExtensionsActions Test', () => {
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled for remote ui extension', async () => {
|
||||
test('Test local install action is enabled for remote ui extension', async () => {
|
||||
// multi server setup
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1929,7 +1899,9 @@ suite('ExtensionsActions Test', () => {
|
||||
const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!);
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test local install action when installing remote ui extension', async () => {
|
||||
@@ -1937,7 +1909,7 @@ suite('ExtensionsActions Test', () => {
|
||||
const localExtensionManagementService: IExtensionManagementService = createExtensionManagementService();
|
||||
const onInstallExtension = new Emitter<InstallExtensionEvent>();
|
||||
localExtensionManagementService.onInstallExtension = onInstallExtension.event;
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, localExtensionManagementService, createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1953,12 +1925,56 @@ suite('ExtensionsActions Test', () => {
|
||||
const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!);
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
|
||||
onInstallExtension.fire({ identifier: remoteUIExtension.identifier, gallery });
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
});
|
||||
|
||||
test('Test local install action when installing remote ui extension is finished', async () => {
|
||||
// multi server setup
|
||||
const localExtensionManagementService: IExtensionManagementService = createExtensionManagementService();
|
||||
const onInstallExtension = new Emitter<InstallExtensionEvent>();
|
||||
localExtensionManagementService.onInstallExtension = onInstallExtension.event;
|
||||
const onDidInstallEvent = new Emitter<DidInstallExtensionEvent>();
|
||||
localExtensionManagementService.onDidInstallExtension = onDidInstallEvent.event;
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, localExtensionManagementService, createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
|
||||
instantiationService.stub(IExtensionsWorkbenchService, workbenchService, 'open', undefined);
|
||||
instantiationService.set(IExtensionsWorkbenchService, workbenchService);
|
||||
|
||||
const gallery = aGalleryExtension('a', { identifier: remoteUIExtension.identifier });
|
||||
instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage(gallery));
|
||||
const testObject: ExtensionsActions.InstallAction = instantiationService.createInstance(ExtensionsActions.LocalInstallAction);
|
||||
instantiationService.createInstance(ExtensionContainers, [testObject]);
|
||||
|
||||
const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!);
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
|
||||
onInstallExtension.fire({ identifier: remoteUIExtension.identifier, gallery });
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
|
||||
const installedExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`) });
|
||||
onDidInstallEvent.fire({ identifier: installedExtension.identifier, local: installedExtension, operation: InstallOperation.Install });
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled for disabled remote ui extension', async () => {
|
||||
test('Test local install action is enabled for disabled remote ui extension', async () => {
|
||||
// multi server setup
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -1973,12 +1989,14 @@ suite('ExtensionsActions Test', () => {
|
||||
const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!);
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled when extension is not set', async () => {
|
||||
// multi server setup
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
|
||||
@@ -2013,7 +2031,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test local install action is disabled for remote ui extension which is disabled in env', async () => {
|
||||
// multi server setup
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
instantiationService.stub(IWorkbenchEnvironmentService, { disableExtensions: true } as IWorkbenchEnvironmentService);
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
@@ -2034,7 +2052,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test local install action is disabled when local server is not available', async () => {
|
||||
// single server setup
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aSingleRemoteExtensionManagementServerService(instantiationService, createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -2054,8 +2072,8 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test local install action is disabled for remote ui extension if it is installed in local', async () => {
|
||||
// multi server setup
|
||||
const localUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const localUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localUIExtension]), createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -2073,13 +2091,13 @@ suite('ExtensionsActions Test', () => {
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled for remote UI extension if it uninstalled locally', async () => {
|
||||
test('Test local install action is disabled for remoteUI extension if it is uninstalled locally', async () => {
|
||||
// multi server setup
|
||||
const extensionManagementService = instantiationService.get(IExtensionManagementService);
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), extensionManagementService);
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', [remoteUIExtension]);
|
||||
const workbenchService: IExtensionsWorkbenchService = instantiationService.createInstance(ExtensionsWorkbenchService);
|
||||
instantiationService.set(IExtensionsWorkbenchService, workbenchService);
|
||||
@@ -2091,15 +2109,16 @@ suite('ExtensionsActions Test', () => {
|
||||
const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!);
|
||||
await workbenchService.queryGallery(CancellationToken.None);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
|
||||
uninstallEvent.fire(remoteUIExtension.identifier);
|
||||
assert.ok(!testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled for remote UI extension if it has gallery', async () => {
|
||||
test('Test local install action is enabled for remote UI extension if it has gallery', async () => {
|
||||
// multi server setup
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteUIExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUIExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -2113,12 +2132,12 @@ suite('ExtensionsActions Test', () => {
|
||||
const extensions = await workbenchService.queryLocal(extensionManagementServerService.remoteExtensionManagementServer!);
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.extension);
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.ok(testObject.enabled);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled for remote UI system extension', async () => {
|
||||
// multi server setup
|
||||
const remoteUISystemExtension = aLocalExtension('a', { extensionKind: 'ui' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }), type: ExtensionType.System });
|
||||
const remoteUISystemExtension = aLocalExtension('a', { extensionKind: ['ui'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }), type: ExtensionType.System });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteUISystemExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -2137,7 +2156,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test local install action is disabled for remote workspace extension if it is not installed in local', async () => {
|
||||
// multi server setup
|
||||
const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService(), createExtensionManagementService([remoteWorkspaceExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
@@ -2156,8 +2175,8 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
test('Test local install action is disabled for remote workspace extension if it is also installed in local', async () => {
|
||||
// multi server setup
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspae' }, { location: URI.file(`pub.a`) });
|
||||
const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: 'workspace' }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const localWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspae'] }, { location: URI.file(`pub.a`) });
|
||||
const remoteWorkspaceExtension = aLocalExtension('a', { extensionKind: ['workspace'] }, { location: URI.file(`pub.a`).with({ scheme: Schemas.vscodeRemote }) });
|
||||
const extensionManagementServerService = aMultiExtensionManagementServerService(instantiationService, createExtensionManagementService([localWorkspaceExtension]), createExtensionManagementService([remoteWorkspaceExtension]));
|
||||
instantiationService.stub(IExtensionManagementServerService, extensionManagementServerService);
|
||||
instantiationService.stub(IExtensionEnablementService, new TestExtensionEnablementService(instantiationService));
|
||||
|
||||
@@ -206,7 +206,7 @@ suite.skip('ExtensionsTipsService Test', () => { // {{SQL CARBON EDIT}} skip sui
|
||||
...{
|
||||
extensionTips: {
|
||||
'ms-vscode.csharp': '{**/*.cs,**/project.json,**/global.json,**/*.csproj,**/*.sln,**/appsettings.json}',
|
||||
'msjsdiag.debugger-for-chrome': '{**/*.ts,**/*.tsx**/*.js,**/*.jsx,**/*.es6,**/.babelrc}',
|
||||
'msjsdiag.debugger-for-chrome': '{**/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.es6,**/*.mjs,**/*.cjs,**/.babelrc}',
|
||||
'lukehoban.Go': '**/*.go'
|
||||
},
|
||||
extensionImportantTips: {
|
||||
@@ -501,6 +501,7 @@ suite.skip('ExtensionsTipsService Test', () => { // {{SQL CARBON EDIT}} skip sui
|
||||
const ignoredExtensionId = 'Some.Extension';
|
||||
instantiationService.stub(IStorageService, <any>{ // {{SQL CARBON EDIT}} strict-null-checks?
|
||||
get: (a: string, b: StorageScope, c?: boolean) => a === 'extensionsAssistant/ignored_recommendations' ? '["ms-vscode.vscode"]' : c,
|
||||
getBoolean: (a: string, b: StorageScope, c: boolean) => c,
|
||||
store: (...args: any[]) => {
|
||||
storageSetterTarget(...args);
|
||||
}
|
||||
@@ -519,7 +520,7 @@ suite.skip('ExtensionsTipsService Test', () => { // {{SQL CARBON EDIT}} skip sui
|
||||
|
||||
test('ExtensionTipsService: Get file based recommendations from storage (old format)', () => {
|
||||
const storedRecommendations = '["ms-vscode.csharp", "ms-python.python", "ms-vscode.vscode-typescript-tslint-plugin"]';
|
||||
instantiationService.stub(IStorageService, <Partial<IStorageService>>{ get: (a: string, b: StorageScope, c?: string) => a === 'extensionsAssistant/recommendations' ? storedRecommendations : c });
|
||||
instantiationService.stub(IStorageService, <Partial<IStorageService>>{ get: (a: string, b: StorageScope, c?: string) => a === 'extensionsAssistant/recommendations' ? storedRecommendations : c, getBoolean: (a: string, b: StorageScope, c: boolean) => c });
|
||||
|
||||
return setUpFolderWorkspace('myFolder', []).then(() => {
|
||||
testObject = instantiationService.createInstance(ExtensionTipsService);
|
||||
@@ -538,7 +539,7 @@ suite.skip('ExtensionsTipsService Test', () => { // {{SQL CARBON EDIT}} skip sui
|
||||
const now = Date.now();
|
||||
const tenDaysOld = 10 * milliSecondsInADay;
|
||||
const storedRecommendations = `{"ms-vscode.csharp": ${now}, "ms-python.python": ${now}, "ms-vscode.vscode-typescript-tslint-plugin": ${now}, "lukehoban.Go": ${tenDaysOld}}`;
|
||||
instantiationService.stub(IStorageService, <Partial<IStorageService>>{ get: (a: string, b: StorageScope, c?: string) => a === 'extensionsAssistant/recommendations' ? storedRecommendations : c });
|
||||
instantiationService.stub(IStorageService, <Partial<IStorageService>>{ get: (a: string, b: StorageScope, c?: string) => a === 'extensionsAssistant/recommendations' ? storedRecommendations : c, getBoolean: (a: string, b: StorageScope, c: boolean) => c });
|
||||
|
||||
return setUpFolderWorkspace('myFolder', []).then(() => {
|
||||
testObject = instantiationService.createInstance(ExtensionTipsService);
|
||||
|
||||