mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 00:30:29 -04:00
Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)
This commit is contained in:
@@ -27,7 +27,7 @@ import { IExtensionsWorkbenchService, IExtensionsViewPaneContainer, VIEWLET_ID,
|
||||
import { /*RatingsWidget, InstallCountWidget, */RemoteBadgeWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets';
|
||||
import { EditorOptions } from 'vs/workbench/common/editor';
|
||||
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 { CombinedInstallAction, UpdateAction, ExtensionEditorDropDownAction, ReloadAction, MaliciousStatusLabelAction, IgnoreExtensionRecommendationAction, UndoIgnoreExtensionRecommendationAction, EnableDropDownAction, DisableDropDownAction, StatusLabelAction, SetFileIconThemeAction, SetColorThemeAction, RemoteInstallAction, ExtensionToolTipAction, SystemDisabledWarningAction, LocalInstallAction, SyncIgnoredIconAction, SetProductIconThemeAction } 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, matchesScheme } from 'vs/platform/opener/common/opener';
|
||||
@@ -40,7 +40,7 @@ import { Color } from 'vs/base/common/color';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { ExtensionsTree, ExtensionData } from 'vs/workbench/contrib/extensions/browser/extensionsViewer';
|
||||
import { ExtensionsTree, ExtensionData, ExtensionsGridView, getExtensions } from 'vs/workbench/contrib/extensions/browser/extensionsViewer';
|
||||
import { ShowCurrentReleaseNotesActionId } from 'vs/workbench/contrib/update/common/update';
|
||||
import { KeybindingParser } from 'vs/base/common/keybindingParser';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
@@ -132,7 +132,6 @@ const NavbarSection = {
|
||||
Contributions: 'contributions',
|
||||
Changelog: 'changelog',
|
||||
Dependencies: 'dependencies',
|
||||
ExtensionPack: 'extensionPack'
|
||||
};
|
||||
|
||||
interface ILayoutParticipant {
|
||||
@@ -320,8 +319,6 @@ export class ExtensionEditor extends BaseEditor {
|
||||
|
||||
private async updateTemplate(input: ExtensionsInput, template: IExtensionEditorTemplate, preserveFocus: boolean): Promise<void> {
|
||||
const runningExtensions = await this.extensionService.getExtensions();
|
||||
const colorThemes = await this.workbenchThemeService.getColorThemes();
|
||||
const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
|
||||
|
||||
this.activeElement = null;
|
||||
this.editorLoadComplete = false;
|
||||
@@ -422,10 +419,13 @@ export class ExtensionEditor extends BaseEditor {
|
||||
const systemDisabledWarningAction = this.instantiationService.createInstance(SystemDisabledWarningAction);
|
||||
const actions = [
|
||||
reloadAction,
|
||||
this.instantiationService.createInstance(SyncIgnoredIconAction),
|
||||
this.instantiationService.createInstance(StatusLabelAction),
|
||||
this.instantiationService.createInstance(UpdateAction),
|
||||
this.instantiationService.createInstance(SetColorThemeAction, colorThemes),
|
||||
this.instantiationService.createInstance(SetFileIconThemeAction, fileIconThemes),
|
||||
this.instantiationService.createInstance(SetColorThemeAction, await this.workbenchThemeService.getColorThemes()),
|
||||
this.instantiationService.createInstance(SetFileIconThemeAction, await this.workbenchThemeService.getFileIconThemes()),
|
||||
this.instantiationService.createInstance(SetProductIconThemeAction, await this.workbenchThemeService.getProductIconThemes()),
|
||||
|
||||
this.instantiationService.createInstance(EnableDropDownAction),
|
||||
this.instantiationService.createInstance(DisableDropDownAction, runningExtensions),
|
||||
this.instantiationService.createInstance(RemoteInstallAction),
|
||||
@@ -457,9 +457,6 @@ export class ExtensionEditor extends BaseEditor {
|
||||
if (manifest) {
|
||||
combinedInstallAction.manifest = manifest;
|
||||
}
|
||||
if (extension.extensionPack.length) {
|
||||
template.navbar.push(NavbarSection.ExtensionPack, localize('extensionPack', "Extension Pack"), localize('extensionsPack', "Set of extensions that can be installed together"));
|
||||
}
|
||||
if (manifest && manifest.contributes) {
|
||||
template.navbar.push(NavbarSection.Contributions, localize('contributions', "Feature Contributions"), localize('contributionstooltip', "Lists contributions to VS Code by this extension"));
|
||||
}
|
||||
@@ -597,7 +594,6 @@ export class ExtensionEditor extends BaseEditor {
|
||||
case NavbarSection.Contributions: return this.openContributions(template);
|
||||
case NavbarSection.Changelog: return this.openChangelog(template);
|
||||
case NavbarSection.Dependencies: return this.openDependencies(extension, template);
|
||||
case NavbarSection.ExtensionPack: return this.openExtensionPack(extension, template);
|
||||
}
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
@@ -852,10 +848,37 @@ export class ExtensionEditor extends BaseEditor {
|
||||
</html>`;
|
||||
}
|
||||
|
||||
private openReadme(template: IExtensionEditorTemplate): Promise<IActiveElement> {
|
||||
private async openReadme(template: IExtensionEditorTemplate): Promise<IActiveElement> {
|
||||
const manifest = await this.extensionManifest!.get().promise;
|
||||
if (manifest && manifest.extensionPack && manifest.extensionPack.length) {
|
||||
return this.openExtensionPackReadme(manifest, template);
|
||||
}
|
||||
return this.openMarkdown(this.extensionReadme!.get(), localize('noReadme', "No README available."), template);
|
||||
}
|
||||
|
||||
private async openExtensionPackReadme(manifest: IExtensionManifest, template: IExtensionEditorTemplate): Promise<IActiveElement> {
|
||||
const extensionPackReadme = append(template.content, $('div', { class: 'extension-pack-readme' }));
|
||||
extensionPackReadme.style.margin = '0 auto';
|
||||
extensionPackReadme.style.maxWidth = '882px';
|
||||
|
||||
const extensionPack = append(extensionPackReadme, $('div', { class: 'extension-pack' }));
|
||||
toggleClass(extensionPackReadme, 'narrow', manifest.extensionPack!.length <= 2);
|
||||
|
||||
const extensionPackHeader = append(extensionPack, $('div.header'));
|
||||
extensionPackHeader.textContent = localize('extension pack', "Extension Pack ({0})", manifest.extensionPack!.length);
|
||||
const extensionPackContent = append(extensionPack, $('div', { class: 'extension-pack-content' }));
|
||||
extensionPackContent.setAttribute('tabindex', '0');
|
||||
append(extensionPack, $('div.footer'));
|
||||
const readmeContent = append(extensionPackReadme, $('div.readme-content'));
|
||||
|
||||
await Promise.all([
|
||||
this.renderExtensionPack(manifest, extensionPackContent),
|
||||
this.openMarkdown(this.extensionReadme!.get(), localize('noReadme', "No README available."), { ...template, ...{ content: readmeContent } }),
|
||||
]);
|
||||
|
||||
return { focus: () => extensionPackContent.focus() };
|
||||
}
|
||||
|
||||
private openChangelog(template: IExtensionEditorTemplate): Promise<IActiveElement> {
|
||||
return this.openMarkdown(this.extensionChangelog!.get(), localize('noChangelog', "No Changelog available."), template);
|
||||
}
|
||||
@@ -938,28 +961,19 @@ export class ExtensionEditor extends BaseEditor {
|
||||
return Promise.resolve({ focus() { dependenciesTree.domFocus(); } });
|
||||
}
|
||||
|
||||
private openExtensionPack(extension: IExtension, template: IExtensionEditorTemplate): Promise<IActiveElement> {
|
||||
private async renderExtensionPack(manifest: IExtensionManifest, parent: HTMLElement): Promise<void> {
|
||||
const content = $('div', { class: 'subcontent' });
|
||||
const scrollableContent = new DomScrollableElement(content, {});
|
||||
append(template.content, scrollableContent.getDomNode());
|
||||
this.contentDisposables.add(scrollableContent);
|
||||
const scrollableContent = new DomScrollableElement(content, { useShadows: false });
|
||||
append(parent, scrollableContent.getDomNode());
|
||||
|
||||
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();
|
||||
extensionsPackTree.layout(scrollDimensions.height);
|
||||
};
|
||||
const removeLayoutParticipant = arrays.insert(this.layoutParticipants, { layout });
|
||||
this.contentDisposables.add(toDisposable(removeLayoutParticipant));
|
||||
|
||||
this.contentDisposables.add(extensionsPackTree);
|
||||
const extensionsGridView = this.instantiationService.createInstance(ExtensionsGridView, content);
|
||||
const extensions: IExtension[] = await getExtensions(manifest.extensionPack!, this.extensionsWorkbenchService);
|
||||
extensionsGridView.setExtensions(extensions);
|
||||
scrollableContent.scanDomNode();
|
||||
return Promise.resolve({ focus() { extensionsPackTree.domFocus(); } });
|
||||
|
||||
this.contentDisposables.add(scrollableContent);
|
||||
this.contentDisposables.add(extensionsGridView);
|
||||
this.contentDisposables.add(toDisposable(arrays.insert(this.layoutParticipants, { layout: () => scrollableContent.scanDomNode() })));
|
||||
}
|
||||
|
||||
private renderSettings(container: HTMLElement, manifest: IExtensionManifest, onDetailsToggle: Function): boolean {
|
||||
|
||||
@@ -29,7 +29,7 @@ import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { buttonBackground, buttonForeground, buttonHoverBackground, contrastBorder, registerColor, foreground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
@@ -52,7 +52,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
import { coalesce } from 'vs/base/common/arrays';
|
||||
import { IWorkbenchThemeService, ThemeSettings, IWorkbenchFileIconTheme, IWorkbenchColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWorkbenchThemeService, IWorkbenchTheme, IWorkbenchColorTheme, IWorkbenchFileIconTheme, IWorkbenchProductIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { ILabelService } from 'vs/platform/label/common/label';
|
||||
import { prefersExecuteOnUI, prefersExecuteOnWorkspace } from 'vs/workbench/services/extensions/common/extensionsUtil';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
@@ -142,6 +142,10 @@ function getRelativeDateLabel(date: Date): string {
|
||||
}
|
||||
|
||||
export abstract class ExtensionAction extends Action implements IExtensionContainer {
|
||||
static readonly EXTENSION_ACTION_CLASS = 'extension-action';
|
||||
static readonly TEXT_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} text`;
|
||||
static readonly LABEL_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} label`;
|
||||
static readonly ICON_ACTION_CLASS = `${ExtensionAction.EXTENSION_ACTION_CLASS} icon`;
|
||||
private _extension: IExtension | null = null;
|
||||
get extension(): IExtension | null { return this._extension; }
|
||||
set extension(extension: IExtension | null) { this._extension = extension; this.update(); }
|
||||
@@ -153,9 +157,8 @@ export class InstallAction extends ExtensionAction {
|
||||
private static readonly INSTALL_LABEL = localize('install', "Install");
|
||||
private static readonly INSTALLING_LABEL = localize('installing', "Installing");
|
||||
|
||||
private static readonly Class = 'extension-action prominent install';
|
||||
private static readonly InstallingClass = 'extension-action install installing';
|
||||
|
||||
private static readonly Class = `${ExtensionAction.LABEL_ACTION_CLASS} prominent install`;
|
||||
private static readonly InstallingClass = `${ExtensionAction.LABEL_ACTION_CLASS} install installing`;
|
||||
|
||||
private _manifest: IExtensionManifest | null = null;
|
||||
set manifest(manifest: IExtensionManifest) {
|
||||
@@ -239,17 +242,15 @@ export class InstallAction extends ExtensionAction {
|
||||
if (extension && extension.local) {
|
||||
const runningExtension = await this.getRunningExtension(extension.local);
|
||||
if (runningExtension) {
|
||||
const colorThemes = await this.workbenchThemeService.getColorThemes();
|
||||
const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
|
||||
if (SetColorThemeAction.getColorThemes(colorThemes, this.extension).length) {
|
||||
const action = this.instantiationService.createInstance(SetColorThemeAction, colorThemes);
|
||||
action.extension = extension;
|
||||
return action.run({ showCurrentTheme: true, ignoreFocusLost: true });
|
||||
}
|
||||
if (SetFileIconThemeAction.getFileIconThemes(fileIconThemes, this.extension).length) {
|
||||
const action = this.instantiationService.createInstance(SetFileIconThemeAction, fileIconThemes);
|
||||
action.extension = extension;
|
||||
return action.run({ showCurrentTheme: true, ignoreFocusLost: true });
|
||||
let action = await SetColorThemeAction.create(this.workbenchThemeService, this.instantiationService, extension)
|
||||
|| await SetFileIconThemeAction.create(this.workbenchThemeService, this.instantiationService, extension)
|
||||
|| await SetProductIconThemeAction.create(this.workbenchThemeService, this.instantiationService, extension);
|
||||
if (action) {
|
||||
try {
|
||||
return action.run({ showCurrentTheme: true, ignoreFocusLost: true });
|
||||
} finally {
|
||||
action.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,8 +302,8 @@ export abstract class InstallInOtherServerAction extends ExtensionAction {
|
||||
protected static readonly INSTALL_LABEL = localize('install', "Install");
|
||||
protected static readonly INSTALLING_LABEL = localize('installing', "Installing");
|
||||
|
||||
private static readonly Class = 'extension-action prominent install';
|
||||
private static readonly InstallingClass = 'extension-action install installing';
|
||||
private static readonly Class = `${ExtensionAction.LABEL_ACTION_CLASS} prominent install`;
|
||||
private static readonly InstallingClass = `${ExtensionAction.LABEL_ACTION_CLASS} install installing`;
|
||||
|
||||
updateWhenCounterExtensionChanges: boolean = true;
|
||||
|
||||
@@ -394,8 +395,8 @@ export class UninstallAction extends ExtensionAction {
|
||||
private static readonly UninstallLabel = localize('uninstallAction', "Uninstall");
|
||||
private static readonly UninstallingLabel = localize('Uninstalling', "Uninstalling");
|
||||
|
||||
private static readonly UninstallClass = 'extension-action uninstall';
|
||||
private static readonly UnInstallingClass = 'extension-action uninstall uninstalling';
|
||||
private static readonly UninstallClass = `${ExtensionAction.LABEL_ACTION_CLASS} uninstall`;
|
||||
private static readonly UnInstallingClass = `${ExtensionAction.LABEL_ACTION_CLASS} uninstall uninstalling`;
|
||||
|
||||
constructor(
|
||||
@IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService
|
||||
@@ -450,7 +451,7 @@ export class UninstallAction extends ExtensionAction {
|
||||
|
||||
export class CombinedInstallAction extends ExtensionAction {
|
||||
|
||||
private static readonly NoExtensionClass = 'extension-action prominent install no-extension';
|
||||
private static readonly NoExtensionClass = `${ExtensionAction.LABEL_ACTION_CLASS} prominent install no-extension`;
|
||||
private installAction: InstallAction;
|
||||
private uninstallAction: UninstallAction;
|
||||
|
||||
@@ -517,7 +518,7 @@ export class CombinedInstallAction extends ExtensionAction {
|
||||
|
||||
export class UpdateAction extends ExtensionAction {
|
||||
|
||||
private static readonly EnabledClass = 'extension-action prominent update';
|
||||
private static readonly EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} prominent update`;
|
||||
private static readonly DisabledClass = `${UpdateAction.EnabledClass} disabled`;
|
||||
|
||||
constructor(
|
||||
@@ -701,7 +702,8 @@ export function getContextMenuActions(menuService: IMenuService, contextKeyServi
|
||||
export class ManageExtensionAction extends ExtensionDropDownAction {
|
||||
|
||||
static readonly ID = 'extensions.manage';
|
||||
private static readonly Class = 'extension-action manage codicon-gear';
|
||||
|
||||
private static readonly Class = `${ExtensionAction.ICON_ACTION_CLASS} manage codicon-gear`;
|
||||
private static readonly HideManageExtensionClass = `${ManageExtensionAction.Class} hide`;
|
||||
|
||||
constructor(
|
||||
@@ -719,19 +721,22 @@ export class ManageExtensionAction extends ExtensionDropDownAction {
|
||||
this.update();
|
||||
}
|
||||
|
||||
getActionGroups(runningExtensions: IExtensionDescription[], colorThemes: IWorkbenchColorTheme[], fileIconThemes: IWorkbenchFileIconTheme[]): IAction[][] {
|
||||
async getActionGroups(runningExtensions: IExtensionDescription[]): Promise<IAction[][]> {
|
||||
const groups: ExtensionAction[][] = [];
|
||||
if (this.extension) {
|
||||
const extensionColorThemes = SetColorThemeAction.getColorThemes(colorThemes, this.extension);
|
||||
const extensionFileIconThemes = SetFileIconThemeAction.getFileIconThemes(fileIconThemes, this.extension);
|
||||
if (extensionColorThemes.length || extensionFileIconThemes.length) {
|
||||
const themesGroup: ExtensionAction[] = [];
|
||||
if (extensionColorThemes.length) {
|
||||
themesGroup.push(this.instantiationService.createInstance(SetColorThemeAction, colorThemes));
|
||||
}
|
||||
if (extensionFileIconThemes.length) {
|
||||
themesGroup.push(this.instantiationService.createInstance(SetFileIconThemeAction, fileIconThemes));
|
||||
const actions = await Promise.all([
|
||||
SetColorThemeAction.create(this.workbenchThemeService, this.instantiationService, this.extension),
|
||||
SetFileIconThemeAction.create(this.workbenchThemeService, this.instantiationService, this.extension),
|
||||
SetProductIconThemeAction.create(this.workbenchThemeService, this.instantiationService, this.extension)
|
||||
]);
|
||||
|
||||
const themesGroup: ExtensionAction[] = [];
|
||||
for (let action of actions) {
|
||||
if (action) {
|
||||
themesGroup.push(action);
|
||||
}
|
||||
}
|
||||
if (themesGroup.length) {
|
||||
groups.push(themesGroup);
|
||||
}
|
||||
}
|
||||
@@ -755,9 +760,7 @@ export class ManageExtensionAction extends ExtensionDropDownAction {
|
||||
|
||||
async run(): Promise<any> {
|
||||
const runtimeExtensions = await this.extensionService.getExtensions();
|
||||
const colorThemes = await this.workbenchThemeService.getColorThemes();
|
||||
const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
|
||||
return super.run({ actionGroups: this.getActionGroups(runtimeExtensions, colorThemes, fileIconThemes), disposeActionsOnHide: true });
|
||||
return super.run({ actionGroups: await this.getActionGroups(runtimeExtensions), disposeActionsOnHide: true });
|
||||
}
|
||||
|
||||
update(): void {
|
||||
@@ -972,8 +975,8 @@ export class DisableGloballyAction extends ExtensionAction {
|
||||
|
||||
export abstract class ExtensionEditorDropDownAction extends ExtensionDropDownAction {
|
||||
|
||||
private static readonly EnabledClass = 'extension-action extension-editor-dropdown-action';
|
||||
private static readonly EnabledDropDownClass = 'extension-action extension-editor-dropdown-action dropdown enable';
|
||||
private static readonly EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} extension-editor-dropdown-action`;
|
||||
private static readonly EnabledDropDownClass = `${ExtensionEditorDropDownAction.EnabledClass} dropdown enable`;
|
||||
private static readonly DisabledClass = `${ExtensionEditorDropDownAction.EnabledClass} disabled`;
|
||||
|
||||
constructor(
|
||||
@@ -1181,7 +1184,7 @@ export class UpdateAllAction extends Action {
|
||||
|
||||
export class ReloadAction extends ExtensionAction {
|
||||
|
||||
private static readonly EnabledClass = 'extension-action reload';
|
||||
private static readonly EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} reload`;
|
||||
private static readonly DisabledClass = `${ReloadAction.EnabledClass} disabled`;
|
||||
|
||||
updateWhenCounterExtensionChanges: boolean = true;
|
||||
@@ -1318,22 +1321,45 @@ export class ReloadAction extends ExtensionAction {
|
||||
}
|
||||
}
|
||||
|
||||
function isThemeFromExtension(theme: IWorkbenchTheme, extension: IExtension | undefined | null): boolean {
|
||||
return !!(extension && theme.extensionData && ExtensionIdentifier.equals(theme.extensionData.extensionId, extension.identifier.id));
|
||||
}
|
||||
|
||||
function getQuickPickEntries(themes: IWorkbenchTheme[], currentTheme: IWorkbenchTheme, extension: IExtension | null | undefined, showCurrentTheme: boolean): (IQuickPickItem | IQuickPickSeparator)[] {
|
||||
const picks: (IQuickPickItem | IQuickPickSeparator)[] = [];
|
||||
for (const theme of themes) {
|
||||
if (isThemeFromExtension(theme, extension) && !(showCurrentTheme && theme === currentTheme)) {
|
||||
picks.push({ label: theme.label, id: theme.id });
|
||||
}
|
||||
}
|
||||
if (showCurrentTheme) {
|
||||
picks.push(<IQuickPickSeparator>{ type: 'separator', label: localize('current', "Current") });
|
||||
picks.push(<IQuickPickItem>{ label: currentTheme.label, id: currentTheme.id });
|
||||
}
|
||||
return picks;
|
||||
}
|
||||
|
||||
|
||||
export class SetColorThemeAction extends ExtensionAction {
|
||||
|
||||
static getColorThemes(colorThemes: IWorkbenchColorTheme[], extension: IExtension): IWorkbenchColorTheme[] {
|
||||
return colorThemes.filter(c => c.extensionData && ExtensionIdentifier.equals(c.extensionData.extensionId, extension.identifier.id));
|
||||
}
|
||||
|
||||
private static readonly EnabledClass = 'extension-action theme';
|
||||
private static readonly EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`;
|
||||
private static readonly DisabledClass = `${SetColorThemeAction.EnabledClass} disabled`;
|
||||
|
||||
static async create(workbenchThemeService: IWorkbenchThemeService, instantiationService: IInstantiationService, extension: IExtension): Promise<SetColorThemeAction | undefined> {
|
||||
const themes = await workbenchThemeService.getColorThemes();
|
||||
if (themes.some(th => isThemeFromExtension(th, extension))) {
|
||||
const action = instantiationService.createInstance(SetColorThemeAction, themes);
|
||||
action.extension = extension;
|
||||
return action;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly colorThemes: IWorkbenchColorTheme[],
|
||||
private colorThemes: IWorkbenchColorTheme[],
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
@IWorkbenchThemeService private readonly workbenchThemeService: IWorkbenchThemeService,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService
|
||||
) {
|
||||
super(`extensions.colorTheme`, localize('color theme', "Set Color Theme"), SetColorThemeAction.DisabledClass, false);
|
||||
this._register(Event.any<any>(extensionService.onDidChangeExtensions, workbenchThemeService.onDidColorThemeChange)(() => this.update(), this));
|
||||
@@ -1341,36 +1367,21 @@ export class SetColorThemeAction extends ExtensionAction {
|
||||
}
|
||||
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
if (this.extension) {
|
||||
const isInstalled = this.extension.state === ExtensionState.Installed;
|
||||
if (isInstalled) {
|
||||
const extensionThemes = SetColorThemeAction.getColorThemes(this.colorThemes, this.extension);
|
||||
this.enabled = extensionThemes.length > 0;
|
||||
}
|
||||
}
|
||||
this.enabled = !!this.extension && (this.extension.state === ExtensionState.Installed) && this.colorThemes.some(th => isThemeFromExtension(th, this.extension));
|
||||
this.class = this.enabled ? SetColorThemeAction.EnabledClass : SetColorThemeAction.DisabledClass;
|
||||
}
|
||||
|
||||
async run({ showCurrentTheme, ignoreFocusLost }: { showCurrentTheme: boolean, ignoreFocusLost: boolean } = { showCurrentTheme: false, ignoreFocusLost: false }): Promise<any> {
|
||||
this.colorThemes = await this.workbenchThemeService.getColorThemes();
|
||||
|
||||
this.update();
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
let extensionThemes = SetColorThemeAction.getColorThemes(this.colorThemes, this.extension!);
|
||||
const currentTheme = this.colorThemes.filter(t => t.settingsId === this.configurationService.getValue(ThemeSettings.COLOR_THEME))[0] || this.workbenchThemeService.getColorTheme();
|
||||
showCurrentTheme = showCurrentTheme || extensionThemes.some(t => t.id === currentTheme.id);
|
||||
if (showCurrentTheme) {
|
||||
extensionThemes = extensionThemes.filter(t => t.id !== currentTheme.id);
|
||||
}
|
||||
const currentTheme = this.workbenchThemeService.getColorTheme();
|
||||
|
||||
const delayer = new Delayer<any>(100);
|
||||
const picks: (IQuickPickItem | IQuickPickSeparator)[] = [];
|
||||
picks.push(...extensionThemes.map(theme => (<IQuickPickItem>{ label: theme.label, id: theme.id })));
|
||||
if (showCurrentTheme) {
|
||||
picks.push(<IQuickPickSeparator>{ type: 'separator', label: localize('current', "Current") });
|
||||
picks.push(<IQuickPickItem>{ label: currentTheme.label, id: currentTheme.id });
|
||||
}
|
||||
const picks = getQuickPickEntries(this.colorThemes, currentTheme, this.extension, showCurrentTheme);
|
||||
const pickedTheme = await this.quickInputService.pick(
|
||||
picks,
|
||||
{
|
||||
@@ -1378,28 +1389,30 @@ export class SetColorThemeAction extends ExtensionAction {
|
||||
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setColorTheme(item.id, undefined)),
|
||||
ignoreFocusLost
|
||||
});
|
||||
let confValue = this.configurationService.inspect(ThemeSettings.COLOR_THEME);
|
||||
const target = typeof confValue.workspaceValue !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER;
|
||||
return this.workbenchThemeService.setColorTheme(pickedTheme ? pickedTheme.id : currentTheme.id, target);
|
||||
return this.workbenchThemeService.setColorTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
|
||||
}
|
||||
}
|
||||
|
||||
export class SetFileIconThemeAction extends ExtensionAction {
|
||||
|
||||
private static readonly EnabledClass = 'extension-action theme';
|
||||
private static readonly EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`;
|
||||
private static readonly DisabledClass = `${SetFileIconThemeAction.EnabledClass} disabled`;
|
||||
|
||||
|
||||
static getFileIconThemes(fileIconThemes: IWorkbenchFileIconTheme[], extension: IExtension): IWorkbenchFileIconTheme[] {
|
||||
return fileIconThemes.filter(c => c.extensionData && ExtensionIdentifier.equals(c.extensionData.extensionId, extension.identifier.id));
|
||||
static async create(workbenchThemeService: IWorkbenchThemeService, instantiationService: IInstantiationService, extension: IExtension): Promise<SetFileIconThemeAction | undefined> {
|
||||
const themes = await workbenchThemeService.getFileIconThemes();
|
||||
if (themes.some(th => isThemeFromExtension(th, extension))) {
|
||||
const action = instantiationService.createInstance(SetFileIconThemeAction, themes);
|
||||
action.extension = extension;
|
||||
return action;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private readonly fileIconThemes: IWorkbenchFileIconTheme[],
|
||||
private fileIconThemes: IWorkbenchFileIconTheme[],
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
@IWorkbenchThemeService private readonly workbenchThemeService: IWorkbenchThemeService,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService
|
||||
) {
|
||||
super(`extensions.fileIconTheme`, localize('file icon theme', "Set File Icon Theme"), SetFileIconThemeAction.DisabledClass, false);
|
||||
this._register(Event.any<any>(extensionService.onDidChangeExtensions, workbenchThemeService.onDidFileIconThemeChange)(() => this.update(), this));
|
||||
@@ -1407,36 +1420,20 @@ export class SetFileIconThemeAction extends ExtensionAction {
|
||||
}
|
||||
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
if (this.extension) {
|
||||
const isInstalled = this.extension.state === ExtensionState.Installed;
|
||||
if (isInstalled) {
|
||||
const extensionThemes = SetFileIconThemeAction.getFileIconThemes(this.fileIconThemes, this.extension);
|
||||
this.enabled = extensionThemes.length > 0;
|
||||
}
|
||||
}
|
||||
this.enabled = !!this.extension && (this.extension.state === ExtensionState.Installed) && this.fileIconThemes.some(th => isThemeFromExtension(th, this.extension));
|
||||
this.class = this.enabled ? SetFileIconThemeAction.EnabledClass : SetFileIconThemeAction.DisabledClass;
|
||||
}
|
||||
|
||||
async run({ showCurrentTheme, ignoreFocusLost }: { showCurrentTheme: boolean, ignoreFocusLost: boolean } = { showCurrentTheme: false, ignoreFocusLost: false }): Promise<any> {
|
||||
await this.update();
|
||||
this.fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
|
||||
this.update();
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
let extensionThemes = SetFileIconThemeAction.getFileIconThemes(this.fileIconThemes, this.extension!);
|
||||
const currentTheme = this.fileIconThemes.filter(t => t.settingsId === this.configurationService.getValue(ThemeSettings.ICON_THEME))[0] || this.workbenchThemeService.getFileIconTheme();
|
||||
showCurrentTheme = showCurrentTheme || extensionThemes.some(t => t.id === currentTheme.id);
|
||||
if (showCurrentTheme) {
|
||||
extensionThemes = extensionThemes.filter(t => t.id !== currentTheme.id);
|
||||
}
|
||||
const currentTheme = this.workbenchThemeService.getFileIconTheme();
|
||||
|
||||
const delayer = new Delayer<any>(100);
|
||||
const picks: (IQuickPickItem | IQuickPickSeparator)[] = [];
|
||||
picks.push(...extensionThemes.map(theme => (<IQuickPickItem>{ label: theme.label, id: theme.id })));
|
||||
if (showCurrentTheme && currentTheme.label) {
|
||||
picks.push(<IQuickPickSeparator>{ type: 'separator', label: localize('current', "Current") });
|
||||
picks.push(<IQuickPickItem>{ label: currentTheme.label, id: currentTheme.id });
|
||||
}
|
||||
const picks = getQuickPickEntries(this.fileIconThemes, currentTheme, this.extension, showCurrentTheme);
|
||||
const pickedTheme = await this.quickInputService.pick(
|
||||
picks,
|
||||
{
|
||||
@@ -1444,9 +1441,62 @@ export class SetFileIconThemeAction extends ExtensionAction {
|
||||
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setFileIconTheme(item.id, undefined)),
|
||||
ignoreFocusLost
|
||||
});
|
||||
let confValue = this.configurationService.inspect(ThemeSettings.ICON_THEME);
|
||||
const target = typeof confValue.workspaceValue !== 'undefined' ? ConfigurationTarget.WORKSPACE : ConfigurationTarget.USER;
|
||||
return this.workbenchThemeService.setFileIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, target);
|
||||
return this.workbenchThemeService.setFileIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
|
||||
}
|
||||
}
|
||||
|
||||
export class SetProductIconThemeAction extends ExtensionAction {
|
||||
|
||||
private static readonly EnabledClass = `${ExtensionAction.LABEL_ACTION_CLASS} theme`;
|
||||
private static readonly DisabledClass = `${SetProductIconThemeAction.EnabledClass} disabled`;
|
||||
|
||||
static async create(workbenchThemeService: IWorkbenchThemeService, instantiationService: IInstantiationService, extension: IExtension): Promise<SetProductIconThemeAction | undefined> {
|
||||
const themes = await workbenchThemeService.getProductIconThemes();
|
||||
if (themes.some(th => isThemeFromExtension(th, extension))) {
|
||||
const action = instantiationService.createInstance(SetProductIconThemeAction, themes);
|
||||
action.extension = extension;
|
||||
return action;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private productIconThemes: IWorkbenchProductIconTheme[],
|
||||
@IExtensionService extensionService: IExtensionService,
|
||||
@IWorkbenchThemeService private readonly workbenchThemeService: IWorkbenchThemeService,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService
|
||||
) {
|
||||
super(`extensions.productIconTheme`, localize('product icon theme', "Set Product Icon Theme"), SetProductIconThemeAction.DisabledClass, false);
|
||||
this._register(Event.any<any>(extensionService.onDidChangeExtensions, workbenchThemeService.onDidProductIconThemeChange)(() => this.update(), this));
|
||||
this.enabled = true; // enabled by default
|
||||
this.class = SetProductIconThemeAction.EnabledClass;
|
||||
// this.update();
|
||||
}
|
||||
|
||||
update(): void {
|
||||
this.enabled = !!this.extension && (this.extension.state === ExtensionState.Installed) && this.productIconThemes.some(th => isThemeFromExtension(th, this.extension));
|
||||
this.class = this.enabled ? SetProductIconThemeAction.EnabledClass : SetProductIconThemeAction.DisabledClass;
|
||||
}
|
||||
|
||||
async run({ showCurrentTheme, ignoreFocusLost }: { showCurrentTheme: boolean, ignoreFocusLost: boolean } = { showCurrentTheme: false, ignoreFocusLost: false }): Promise<any> {
|
||||
this.productIconThemes = await this.workbenchThemeService.getProductIconThemes();
|
||||
this.update();
|
||||
if (!this.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentTheme = this.workbenchThemeService.getProductIconTheme();
|
||||
|
||||
const delayer = new Delayer<any>(100);
|
||||
const picks = getQuickPickEntries(this.productIconThemes, currentTheme, this.extension, showCurrentTheme);
|
||||
const pickedTheme = await this.quickInputService.pick(
|
||||
picks,
|
||||
{
|
||||
placeHolder: localize('select product icon theme', "Select Product Icon Theme"),
|
||||
onDidFocus: item => delayer.trigger(() => this.workbenchThemeService.setProductIconTheme(item.id, undefined)),
|
||||
ignoreFocusLost
|
||||
});
|
||||
return this.workbenchThemeService.setProductIconTheme(pickedTheme ? pickedTheme.id : currentTheme.id, 'auto');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1811,7 +1861,6 @@ export class UndoIgnoreExtensionRecommendationAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class ShowRecommendedKeymapExtensionsAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.extensions.action.showRecommendedKeymapExtensions';
|
||||
@@ -2205,7 +2254,6 @@ export class ConfigureWorkspaceRecommendedExtensionsAction extends AbstractConfi
|
||||
static readonly ID = 'workbench.extensions.action.configureWorkspaceRecommendedExtensions';
|
||||
static readonly LABEL = localize('configureWorkspaceRecommendedExtensions', "Configure Recommended Extensions (Workspace)");
|
||||
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@@ -2241,7 +2289,6 @@ export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends Abstrac
|
||||
static readonly ID = 'workbench.extensions.action.configureWorkspaceFolderRecommendedExtensions';
|
||||
static readonly LABEL = localize('configureWorkspaceFolderRecommendedExtensions', "Configure Recommended Extensions (Workspace Folder)");
|
||||
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@@ -2432,7 +2479,7 @@ export class AddToWorkspaceRecommendationsAction extends AbstractConfigureRecomm
|
||||
|
||||
export class StatusLabelAction extends Action implements IExtensionContainer {
|
||||
|
||||
private static readonly ENABLED_CLASS = 'extension-status-label';
|
||||
private static readonly ENABLED_CLASS = `${ExtensionAction.TEXT_ACTION_CLASS} extension-status-label`;
|
||||
private static readonly DISABLED_CLASS = `${StatusLabelAction.ENABLED_CLASS} hide`;
|
||||
|
||||
private initialStatus: ExtensionState | null = null;
|
||||
@@ -2534,7 +2581,7 @@ export class StatusLabelAction extends Action implements IExtensionContainer {
|
||||
|
||||
export class MaliciousStatusLabelAction extends ExtensionAction {
|
||||
|
||||
private static readonly Class = 'malicious-status';
|
||||
private static readonly Class = `${ExtensionAction.TEXT_ACTION_CLASS} malicious-status`;
|
||||
|
||||
constructor(long: boolean) {
|
||||
const tooltip = localize('malicious tooltip', "This extension was reported to be problematic.");
|
||||
@@ -2556,9 +2603,38 @@ export class MaliciousStatusLabelAction extends ExtensionAction {
|
||||
}
|
||||
}
|
||||
|
||||
export class SyncIgnoredIconAction extends ExtensionAction {
|
||||
|
||||
private static readonly ENABLE_CLASS = `${ExtensionAction.ICON_ACTION_CLASS} codicon-eye-closed`;
|
||||
private static readonly DISABLE_CLASS = `${SyncIgnoredIconAction.ENABLE_CLASS} hide`;
|
||||
|
||||
constructor(
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService
|
||||
) {
|
||||
super('extensions.syncignore', '', SyncIgnoredIconAction.DISABLE_CLASS, false);
|
||||
this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectedKeys.includes('sync.ignoredExtensions'))(() => this.update()));
|
||||
this.update();
|
||||
this.tooltip = localize('syncingore.label', "This extension is ignored during sync.");
|
||||
}
|
||||
|
||||
update(): void {
|
||||
this.class = SyncIgnoredIconAction.DISABLE_CLASS;
|
||||
if (this.extension) {
|
||||
const ignoredExtensions = this.configurationService.getValue<string[]>('sync.ignoredExtensions') || [];
|
||||
if (ignoredExtensions.some(id => areSameExtensions({ id }, this.extension!.identifier))) {
|
||||
this.class = SyncIgnoredIconAction.ENABLE_CLASS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run(): Promise<any> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
export class ExtensionToolTipAction extends ExtensionAction {
|
||||
|
||||
private static readonly Class = 'disable-status';
|
||||
private static readonly Class = `${ExtensionAction.TEXT_ACTION_CLASS} disable-status`;
|
||||
|
||||
updateWhenCounterExtensionChanges: boolean = true;
|
||||
private _runningExtensions: IExtensionDescription[] | null = null;
|
||||
@@ -2635,7 +2711,7 @@ export class ExtensionToolTipAction extends ExtensionAction {
|
||||
|
||||
export class SystemDisabledWarningAction extends ExtensionAction {
|
||||
|
||||
private static readonly CLASS = 'system-disable';
|
||||
private static readonly CLASS = `${ExtensionAction.ICON_ACTION_CLASS} system-disable`;
|
||||
private static readonly WARNING_CLASS = `${SystemDisabledWarningAction.CLASS} codicon-warning`;
|
||||
private static readonly INFO_CLASS = `${SystemDisabledWarningAction.CLASS} codicon-info`;
|
||||
|
||||
@@ -2726,7 +2802,6 @@ export class DisableAllAction extends Action {
|
||||
static readonly ID = 'workbench.extensions.action.disableAll';
|
||||
static readonly LABEL = localize('disableAll', "Disable All Installed Extensions");
|
||||
|
||||
|
||||
constructor(
|
||||
id: string = DisableAllAction.ID, label: string = DisableAllAction.LABEL,
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@@ -2751,7 +2826,6 @@ export class DisableAllWorkspaceAction extends Action {
|
||||
static readonly ID = 'workbench.extensions.action.disableAllWorkspace';
|
||||
static readonly LABEL = localize('disableAllWorkspace', "Disable All Installed Extensions for this Workspace");
|
||||
|
||||
|
||||
constructor(
|
||||
id: string = DisableAllWorkspaceAction.ID, label: string = DisableAllWorkspaceAction.LABEL,
|
||||
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
|
||||
@@ -2778,7 +2852,6 @@ export class EnableAllAction extends Action {
|
||||
static readonly ID = 'workbench.extensions.action.enableAll';
|
||||
static readonly LABEL = localize('enableAll', "Enable All Extensions");
|
||||
|
||||
|
||||
constructor(
|
||||
id: string = EnableAllAction.ID, label: string = EnableAllAction.LABEL,
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@@ -2803,7 +2876,6 @@ export class EnableAllWorkspaceAction extends Action {
|
||||
static readonly ID = 'workbench.extensions.action.enableAllWorkspace';
|
||||
static readonly LABEL = localize('enableAllWorkspace', "Enable All Extensions for this Workspace");
|
||||
|
||||
|
||||
constructor(
|
||||
id: string = EnableAllWorkspaceAction.ID, label: string = EnableAllWorkspaceAction.LABEL,
|
||||
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
|
||||
@@ -3262,49 +3334,49 @@ export const extensionButtonProminentHoverBackground = registerColor('extensionB
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
const foregroundColor = theme.getColor(foreground);
|
||||
if (foregroundColor) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action.built-in-status { border-color: ${foregroundColor}; }`);
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item .action-label.extension-action.built-in-status { border-color: ${foregroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.built-in-status { border-color: ${foregroundColor}; }`);
|
||||
}
|
||||
|
||||
const buttonBackgroundColor = theme.getColor(buttonBackground);
|
||||
if (buttonBackgroundColor) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action { background-color: ${buttonBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action { background-color: ${buttonBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item .action-label.extension-action.label { background-color: ${buttonBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.label { background-color: ${buttonBackgroundColor}; }`);
|
||||
}
|
||||
|
||||
const buttonForegroundColor = theme.getColor(buttonForeground);
|
||||
if (buttonForegroundColor) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action { color: ${buttonForegroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action { color: ${buttonForegroundColor}; }`);
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item .action-label.extension-action.label { color: ${buttonForegroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.label { color: ${buttonForegroundColor}; }`);
|
||||
}
|
||||
|
||||
const buttonHoverBackgroundColor = theme.getColor(buttonHoverBackground);
|
||||
if (buttonHoverBackgroundColor) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item:hover .action-label.extension-action { background-color: ${buttonHoverBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item:hover .action-label.extension-action { background-color: ${buttonHoverBackgroundColor}; }`);
|
||||
}
|
||||
|
||||
const contrastBorderColor = theme.getColor(contrastBorder);
|
||||
if (contrastBorderColor) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action { border: 1px solid ${contrastBorderColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action { border: 1px solid ${contrastBorderColor}; }`);
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item:hover .action-label.extension-action.label { background-color: ${buttonHoverBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item:hover .action-label.extension-action.label { background-color: ${buttonHoverBackgroundColor}; }`);
|
||||
}
|
||||
|
||||
const extensionButtonProminentBackgroundColor = theme.getColor(extensionButtonProminentBackground);
|
||||
if (extensionButtonProminentBackground) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item .action-label.extension-action.label.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.label.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`);
|
||||
}
|
||||
|
||||
const extensionButtonProminentForegroundColor = theme.getColor(extensionButtonProminentForeground);
|
||||
if (extensionButtonProminentForeground) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action.prominent { color: ${extensionButtonProminentForegroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.prominent { color: ${extensionButtonProminentForegroundColor}; }`);
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item .action-label.extension-action.label.prominent { color: ${extensionButtonProminentForegroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.label.prominent { color: ${extensionButtonProminentForegroundColor}; }`);
|
||||
}
|
||||
|
||||
const extensionButtonProminentHoverBackgroundColor = theme.getColor(extensionButtonProminentHoverBackground);
|
||||
if (extensionButtonProminentHoverBackground) {
|
||||
collector.addRule(`.extension .monaco-action-bar .action-item:hover .action-label.extension-action.prominent { background-color: ${extensionButtonProminentHoverBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item:hover .action-label.extension-action.prominent { background-color: ${extensionButtonProminentHoverBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item:hover .action-label.extension-action.label.prominent { background-color: ${extensionButtonProminentHoverBackgroundColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item:hover .action-label.extension-action.label.prominent { background-color: ${extensionButtonProminentHoverBackgroundColor}; }`);
|
||||
}
|
||||
|
||||
const contrastBorderColor = theme.getColor(contrastBorder);
|
||||
if (contrastBorderColor) {
|
||||
collector.addRule(`.extension-list-item .monaco-action-bar .action-item .action-label.extension-action { border: 1px solid ${contrastBorderColor}; }`);
|
||||
collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action { border: 1px solid ${contrastBorderColor}; }`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import 'vs/css!./media/extension';
|
||||
import { append, $, addClass, removeClass, toggleClass } from 'vs/base/browser/dom';
|
||||
import { IDisposable, dispose, combinedDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
@@ -14,15 +14,13 @@ import { IPagedRenderer } from 'vs/base/browser/ui/list/listPaging';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { domEvent } from 'vs/base/browser/event';
|
||||
import { IExtension, ExtensionContainers, ExtensionState, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, MaliciousStatusLabelAction, ExtensionActionViewItem, StatusLabelAction, RemoteInstallAction, SystemDisabledWarningAction, ExtensionToolTipAction, LocalInstallAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, MaliciousStatusLabelAction, ExtensionActionViewItem, StatusLabelAction, RemoteInstallAction, SystemDisabledWarningAction, ExtensionToolTipAction, LocalInstallAction, SyncIgnoredIconAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
|
||||
import { Label, RatingsWidget, /*InstallCountWidget,*/ RecommendationWidget, RemoteBadgeWidget, TooltipWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets';
|
||||
import { Label, RatingsWidget, /*InstallCountWidget, */RecommendationWidget, RemoteBadgeWidget, TooltipWidget, ExtensionPackCountWidget as ExtensionPackBadgeWidget } from 'vs/workbench/contrib/extensions/browser/extensionsWidgets';
|
||||
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { isLanguagePackExtension, IExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { CodiconLabel } from 'vs/base/browser/ui/codiconLabel/codiconLabel';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { isLanguagePackExtension } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
export interface IExtensionsViewState {
|
||||
onFocus: Event<IExtension>;
|
||||
@@ -38,7 +36,6 @@ export interface ITemplateData {
|
||||
//installCount: HTMLElement;
|
||||
//ratings: HTMLElement;
|
||||
author: HTMLElement;
|
||||
syncIgnored: HTMLElement;
|
||||
description: HTMLElement;
|
||||
extension: IExtension | null;
|
||||
disposables: IDisposable[];
|
||||
@@ -62,17 +59,17 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
) { }
|
||||
|
||||
get templateId() { return 'extension'; }
|
||||
|
||||
renderTemplate(root: HTMLElement): ITemplateData {
|
||||
const recommendationWidget = this.instantiationService.createInstance(RecommendationWidget, root);
|
||||
const element = append(root, $('.extension'));
|
||||
const recommendationWidget = this.instantiationService.createInstance(RecommendationWidget, append(root, $('.extension-bookmark-container')));
|
||||
const element = append(root, $('.extension-list-item'));
|
||||
const iconContainer = append(element, $('.icon-container'));
|
||||
const icon = append(iconContainer, $<HTMLImageElement>('img.icon'));
|
||||
const iconRemoteBadgeWidget = this.instantiationService.createInstance(RemoteBadgeWidget, iconContainer, false);
|
||||
const extensionPackBadgeWidget = this.instantiationService.createInstance(ExtensionPackBadgeWidget, iconContainer);
|
||||
const details = append(element, $('.details'));
|
||||
const headerContainer = append(details, $('.header-container'));
|
||||
const header = append(headerContainer, $('.header'));
|
||||
@@ -84,9 +81,6 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
|
||||
const description = append(details, $('.description.ellipsis'));
|
||||
const footer = append(details, $('.footer'));
|
||||
const author = append(footer, $('.author.ellipsis'));
|
||||
const syncIgnored = append(footer, $('.sync-ignored.ellipsis'));
|
||||
const syncIgnoredLabel = new CodiconLabel(syncIgnored);
|
||||
syncIgnoredLabel.text = '$(eye-closed) ' + localize('extensionSyncIgnoredLabel', 'Sync: Ignored');
|
||||
const actionbar = new ActionBar(footer, {
|
||||
animated: false,
|
||||
actionViewItemProvider: (action: IAction) => {
|
||||
@@ -102,6 +96,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
|
||||
const reloadAction = this.instantiationService.createInstance(ReloadAction);
|
||||
const actions = [
|
||||
this.instantiationService.createInstance(StatusLabelAction),
|
||||
this.instantiationService.createInstance(SyncIgnoredIconAction),
|
||||
this.instantiationService.createInstance(UpdateAction),
|
||||
reloadAction,
|
||||
this.instantiationService.createInstance(InstallAction),
|
||||
@@ -116,6 +111,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
|
||||
const widgets = [
|
||||
recommendationWidget,
|
||||
iconRemoteBadgeWidget,
|
||||
extensionPackBadgeWidget,
|
||||
headerRemoteBadgeWidget,
|
||||
tooltipWidget,
|
||||
this.instantiationService.createInstance(Label, version, (e: IExtension) => e.version),
|
||||
@@ -129,7 +125,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
|
||||
const disposables = combinedDisposable(...actions, ...widgets, actionbar, extensionContainers, extensionTooltipAction);
|
||||
|
||||
return {
|
||||
root, element, icon, name, /*installCount,*/ syncIgnored, /*ratings,*/ author, description, disposables: [disposables], actionbar,
|
||||
root, element, icon, name, /*installCount, ratings, */author, description, disposables: [disposables], actionbar,
|
||||
extensionDisposables: [],
|
||||
set extension(extension: IExtension) {
|
||||
extensionContainers.extension = extension;
|
||||
@@ -210,24 +206,9 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
|
||||
}
|
||||
}, this, data.extensionDisposables);
|
||||
|
||||
|
||||
this.updateExtensionIgnored(extension, data);
|
||||
this.configurationService.onDidChangeConfiguration(e => {
|
||||
if (e.affectedKeys.includes('sync.ignoredExtensions')) {
|
||||
this.updateExtensionIgnored(extension, data);
|
||||
}
|
||||
}, data.extensionDisposables);
|
||||
}
|
||||
|
||||
disposeTemplate(data: ITemplateData): void {
|
||||
data.disposables = dispose(data.disposables);
|
||||
}
|
||||
|
||||
private updateExtensionIgnored(extension: IExtension, data: ITemplateData): void {
|
||||
data.syncIgnored.style.display = this.extensionIsIgnored(extension.identifier) ? 'block' : 'none';
|
||||
}
|
||||
|
||||
private extensionIsIgnored(identifier: IExtensionIdentifier): boolean {
|
||||
return (this.configurationService.getValue<string[]>('sync.ignoredExtensions') || []).some(id => areSameExtensions({ id }, identifier)); // {{SQL CARBON EDIT}} Temporary fix until VS Code fix is merged in
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable, dispose, Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IExtensionsWorkbenchService, IExtension } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
@@ -14,7 +14,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { IListService, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { IAsyncDataSource, ITreeNode } from 'vs/base/browser/ui/tree/tree';
|
||||
import { IListVirtualDelegate, IListRenderer } from 'vs/base/browser/ui/list/list';
|
||||
@@ -22,6 +22,64 @@ 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';
|
||||
import { Renderer, Delegate } from 'vs/workbench/contrib/extensions/browser/extensionsList';
|
||||
import { listFocusForeground, listFocusBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { StandardMouseEvent } from 'vs/base/browser/mouseEvent';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
|
||||
export class ExtensionsGridView extends Disposable {
|
||||
|
||||
readonly element: HTMLElement;
|
||||
private readonly renderer: Renderer;
|
||||
private readonly delegate: Delegate;
|
||||
private readonly disposableStore: DisposableStore;
|
||||
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService
|
||||
) {
|
||||
super();
|
||||
this.element = dom.append(parent, dom.$('.extensions-grid-view'));
|
||||
this.renderer = this.instantiationService.createInstance(Renderer, { onFocus: Event.None, onBlur: Event.None });
|
||||
this.delegate = new Delegate();
|
||||
this.disposableStore = new DisposableStore();
|
||||
}
|
||||
|
||||
setExtensions(extensions: IExtension[]): void {
|
||||
this.disposableStore.clear();
|
||||
extensions.forEach((e, index) => this.renderExtension(e, index));
|
||||
}
|
||||
|
||||
private renderExtension(extension: IExtension, index: number): void {
|
||||
const extensionContainer = dom.append(this.element, dom.$('.extension-container'));
|
||||
extensionContainer.style.height = `${this.delegate.getHeight()}px`;
|
||||
extensionContainer.style.width = `350px`;
|
||||
extensionContainer.setAttribute('tabindex', '0');
|
||||
|
||||
const template = this.renderer.renderTemplate(extensionContainer);
|
||||
this.disposableStore.add(toDisposable(() => this.renderer.disposeTemplate(template)));
|
||||
|
||||
const openExtensionAction = this.instantiationService.createInstance(OpenExtensionAction);
|
||||
openExtensionAction.extension = extension;
|
||||
template.name.setAttribute('tabindex', '0');
|
||||
|
||||
const handleEvent = (e: StandardMouseEvent | StandardKeyboardEvent) => {
|
||||
if (e instanceof StandardKeyboardEvent && e.keyCode !== KeyCode.Enter) {
|
||||
return;
|
||||
}
|
||||
openExtensionAction.run(e.ctrlKey || e.metaKey);
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
this.disposableStore.add(dom.addDisposableListener(template.name, dom.EventType.CLICK, (e: MouseEvent) => handleEvent(new StandardMouseEvent(e))));
|
||||
this.disposableStore.add(dom.addDisposableListener(template.name, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => handleEvent(new StandardKeyboardEvent(e))));
|
||||
this.disposableStore.add(dom.addDisposableListener(extensionContainer, dom.EventType.KEY_DOWN, (e: KeyboardEvent) => handleEvent(new StandardKeyboardEvent(e))));
|
||||
|
||||
this.renderer.renderElement(extension, index, template);
|
||||
}
|
||||
}
|
||||
|
||||
export interface IExtensionTemplateData {
|
||||
icon: HTMLImageElement;
|
||||
@@ -101,7 +159,7 @@ export class ExtensionRenderer implements IListRenderer<ITreeNode<IExtensionData
|
||||
author,
|
||||
extensionDisposables,
|
||||
set extensionData(extensionData: IExtensionData) {
|
||||
openExtensionAction.extensionData = extensionData;
|
||||
openExtensionAction.extension = extensionData.extension;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -157,19 +215,19 @@ export class UnknownExtensionRenderer implements IListRenderer<ITreeNode<IExtens
|
||||
|
||||
class OpenExtensionAction extends Action {
|
||||
|
||||
private _extensionData: IExtensionData | undefined;
|
||||
private _extension: IExtension | undefined;
|
||||
|
||||
constructor(@IExtensionsWorkbenchService private readonly extensionsWorkdbenchService: IExtensionsWorkbenchService) {
|
||||
super('extensions.action.openExtension', '');
|
||||
}
|
||||
|
||||
public set extensionData(extension: IExtensionData) {
|
||||
this._extensionData = extension;
|
||||
public set extension(extension: IExtension) {
|
||||
this._extension = extension;
|
||||
}
|
||||
|
||||
run(sideByside: boolean): Promise<any> {
|
||||
if (this._extensionData) {
|
||||
return this.extensionsWorkdbenchService.open(this._extensionData.extension, { sideByside });
|
||||
if (this._extension) {
|
||||
return this.extensionsWorkdbenchService.open(this._extension, { sideByside });
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
@@ -246,24 +304,40 @@ export class ExtensionData implements IExtensionData {
|
||||
|
||||
async getChildren(): Promise<IExtensionData[] | null> {
|
||||
if (this.hasChildren) {
|
||||
const localById = this.extensionsWorkbenchService.local.reduce((result, e) => { result.set(e.identifier.id.toLowerCase(), e); return result; }, new Map<string, IExtension>());
|
||||
const result: IExtension[] = [];
|
||||
const toQuery: string[] = [];
|
||||
for (const extensionId of this.childrenExtensionIds) {
|
||||
const id = extensionId.toLowerCase();
|
||||
const local = localById.get(id);
|
||||
if (local) {
|
||||
result.push(local);
|
||||
} else {
|
||||
toQuery.push(id);
|
||||
}
|
||||
}
|
||||
if (toQuery.length) {
|
||||
const galleryResult = await this.extensionsWorkbenchService.queryGallery({ names: toQuery, pageSize: toQuery.length }, CancellationToken.None);
|
||||
result.push(...galleryResult.firstPage);
|
||||
}
|
||||
const result: IExtension[] = await getExtensions(this.childrenExtensionIds, this.extensionsWorkbenchService);
|
||||
return result.map(extension => new ExtensionData(extension, this, this.getChildrenExtensionIds, this.extensionsWorkbenchService));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getExtensions(extensions: string[], extensionsWorkbenchService: IExtensionsWorkbenchService): Promise<IExtension[]> {
|
||||
const localById = extensionsWorkbenchService.local.reduce((result, e) => { result.set(e.identifier.id.toLowerCase(), e); return result; }, new Map<string, IExtension>());
|
||||
const result: IExtension[] = [];
|
||||
const toQuery: string[] = [];
|
||||
for (const extensionId of extensions) {
|
||||
const id = extensionId.toLowerCase();
|
||||
const local = localById.get(id);
|
||||
if (local) {
|
||||
result.push(local);
|
||||
} else {
|
||||
toQuery.push(id);
|
||||
}
|
||||
}
|
||||
if (toQuery.length) {
|
||||
const galleryResult = await extensionsWorkbenchService.queryGallery({ names: toQuery, pageSize: toQuery.length }, CancellationToken.None);
|
||||
result.push(...galleryResult.firstPage);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
|
||||
const focusBackground = theme.getColor(listFocusBackground);
|
||||
if (focusBackground) {
|
||||
collector.addRule(`.extensions-grid-view .extension-container:focus { background-color: ${focusBackground}; outline: none; }`);
|
||||
}
|
||||
const focusForeground = theme.getColor(listFocusForeground);
|
||||
if (focusForeground) {
|
||||
collector.addRule(`.extensions-grid-view .extension-container:focus { color: ${focusForeground}; }`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -41,7 +41,6 @@ import { createErrorWithActions } from 'vs/base/common/errorsWithActions';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { IAction, Action } from 'vs/base/common/actions';
|
||||
import { ExtensionType, ExtensionIdentifier, IExtensionDescription, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { SeverityIcon } from 'vs/platform/severityIcon/common/severityIcon';
|
||||
@@ -106,7 +105,6 @@ export class ExtensionsListView extends ViewPane {
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IWorkspaceContextService protected contextService: IWorkspaceContextService,
|
||||
@IExperimentService private readonly experimentService: IExperimentService,
|
||||
@IWorkbenchThemeService private readonly workbenchThemeService: IWorkbenchThemeService,
|
||||
@IExtensionManagementServerService protected readonly extensionManagementServerService: IExtensionManagementServerService,
|
||||
@IProductService protected readonly productService: IProductService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@@ -233,12 +231,10 @@ export class ExtensionsListView extends ViewPane {
|
||||
private async onContextMenu(e: IListContextMenuEvent<IExtension>): Promise<void> {
|
||||
if (e.element) {
|
||||
const runningExtensions = await this.extensionService.getExtensions();
|
||||
const colorThemes = await this.workbenchThemeService.getColorThemes();
|
||||
const fileIconThemes = await this.workbenchThemeService.getFileIconThemes();
|
||||
const manageExtensionAction = this.instantiationService.createInstance(ManageExtensionAction);
|
||||
manageExtensionAction.extension = e.element;
|
||||
if (manageExtensionAction.enabled) {
|
||||
const groups = manageExtensionAction.getActionGroups(runningExtensions, colorThemes, fileIconThemes);
|
||||
const groups = await manageExtensionAction.getActionGroups(runningExtensions);
|
||||
let actions: IAction[] = [];
|
||||
for (const menuActions of groups) {
|
||||
actions = [...actions, ...menuActions, new Separator()];
|
||||
@@ -965,7 +961,6 @@ export class ServerExtensionsView extends ExtensionsListView {
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IWorkspaceContextService contextService: IWorkspaceContextService,
|
||||
@IExperimentService experimentService: IExperimentService,
|
||||
@IWorkbenchThemeService workbenchThemeService: IWorkbenchThemeService,
|
||||
@IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@IExtensionManagementServerService extensionManagementServerService: IExtensionManagementServerService,
|
||||
@IProductService productService: IProductService,
|
||||
@@ -976,7 +971,7 @@ export class ServerExtensionsView extends ExtensionsListView {
|
||||
@IPreferencesService preferencesService: IPreferencesService,
|
||||
) {
|
||||
options.server = server;
|
||||
super(options, notificationService, keybindingService, contextMenuService, instantiationService, themeService, extensionService, extensionsWorkbenchService, editorService, tipsService, telemetryService, configurationService, contextService, experimentService, workbenchThemeService, extensionManagementServerService, productService, contextKeyService, viewDescriptorService, menuService, openerService, preferencesService);
|
||||
super(options, notificationService, keybindingService, contextMenuService, instantiationService, themeService, extensionService, extensionsWorkbenchService, editorService, tipsService, telemetryService, configurationService, contextService, experimentService, extensionManagementServerService, productService, contextKeyService, viewDescriptorService, menuService, openerService, preferencesService);
|
||||
this._register(onDidChangeTitle(title => this.updateTitle(title)));
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import 'vs/css!./media/extensionsWidgets';
|
||||
import { Disposable, toDisposable, DisposableStore, MutableDisposable } from 'vs/base/common/lifecycle';
|
||||
import { IExtension, IExtensionsWorkbenchService, IExtensionContainer } from 'vs/workbench/contrib/extensions/common/extensions';
|
||||
import { append, $, addClass } from 'vs/base/browser/dom';
|
||||
import { append, $, addClass, removeNode } from 'vs/base/browser/dom';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IExtensionTipsService, IExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
|
||||
@@ -16,6 +16,7 @@ import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeServic
|
||||
import { EXTENSION_BADGE_REMOTE_BACKGROUND, EXTENSION_BADGE_REMOTE_FOREGROUND } from 'vs/workbench/common/theme';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge';
|
||||
|
||||
export abstract class ExtensionWidget extends Disposable implements IExtensionContainer {
|
||||
private _extension: IExtension | null = null;
|
||||
@@ -222,7 +223,7 @@ export class RecommendationWidget extends ExtensionWidget {
|
||||
}
|
||||
const extRecommendations = this.extensionTipsService.getAllRecommendationsWithReason();
|
||||
if (extRecommendations[this.extension.identifier.id.toLowerCase()]) {
|
||||
this.element = append(this.parent, $('div.bookmark'));
|
||||
this.element = append(this.parent, $('div.extension-bookmark'));
|
||||
const recommendation = append(this.element, $('.recommendation'));
|
||||
append(recommendation, $('span.codicon.codicon-star'));
|
||||
const applyBookmarkStyle = (theme: IColorTheme) => {
|
||||
@@ -285,7 +286,7 @@ class RemoteBadge extends Disposable {
|
||||
@IExtensionManagementServerService private readonly extensionManagementServerService: IExtensionManagementServerService
|
||||
) {
|
||||
super();
|
||||
this.element = $('div.extension-remote-badge');
|
||||
this.element = $('div.extension-badge.extension-remote-badge');
|
||||
this.render();
|
||||
}
|
||||
|
||||
@@ -315,3 +316,32 @@ class RemoteBadge extends Disposable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class ExtensionPackCountWidget extends ExtensionWidget {
|
||||
|
||||
private element: HTMLElement | undefined;
|
||||
|
||||
constructor(
|
||||
private readonly parent: HTMLElement,
|
||||
) {
|
||||
super();
|
||||
this.render();
|
||||
this._register(toDisposable(() => this.clear()));
|
||||
}
|
||||
|
||||
private clear(): void {
|
||||
if (this.element) {
|
||||
removeNode(this.element);
|
||||
}
|
||||
}
|
||||
|
||||
render(): void {
|
||||
this.clear();
|
||||
if (!this.extension || !this.extension.extensionPack.length) {
|
||||
return;
|
||||
}
|
||||
this.element = append(this.parent, $('.extension-badge.extension-pack-badge'));
|
||||
const countBadge = new CountBadge(this.element);
|
||||
countBadge.setCount(this.extension.extensionPack.length);
|
||||
}
|
||||
}
|
||||
|
||||
173
src/vs/workbench/contrib/extensions/browser/media/extension.css
Normal file
173
src/vs/workbench/contrib/extensions/browser/media/extension.css
Normal file
@@ -0,0 +1,173 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.extension-bookmark-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.extension-bookmark-container > .extension-bookmark {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.extension-list-item {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 0 0 16px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.extension-list-item > .icon-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.extension-list-item > .icon-container > .icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
padding: 10px 14px 10px 0;
|
||||
flex-shrink: 0;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.extension-list-item > .icon-container .extension-badge {
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.extension-list-item > .icon-container .extension-badge.extension-remote-badge {
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.extension-list-item > .icon-container .extension-remote-badge .codicon {
|
||||
color: currentColor;
|
||||
}
|
||||
|
||||
.extension-list-item > .details {
|
||||
flex: 1;
|
||||
padding: 4px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container {
|
||||
height: 19px;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
padding-right: 11px;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header > .name {
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header > .version {
|
||||
opacity: 0.85;
|
||||
font-size: 80%;
|
||||
padding-left: 6px;
|
||||
min-width: fit-content;
|
||||
min-width: -moz-fit-content;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header > .version {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header > .install-count,
|
||||
.extension-list-item > .details > .header-container > .header > .ratings {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header > .install-count:not(:empty) {
|
||||
font-size: 80%;
|
||||
margin: 0 6px;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header .codicon {
|
||||
font-size: 120%;
|
||||
margin-right: 2px;
|
||||
-webkit-mask: inherit;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header > .ratings {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header > .extension-remote-badge-container {
|
||||
margin-left: 6px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header .extension-remote-badge .codicon {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header .extension-remote-badge {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
border-radius: 20px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .header-container > .header .extension-remote-badge > .codicon {
|
||||
font-size: 12px;
|
||||
color: currentColor;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .description {
|
||||
padding-right: 11px;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-right: 7px;
|
||||
height: 18px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .footer > .author {
|
||||
flex: 1;
|
||||
font-size: 90%;
|
||||
opacity: 0.9;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.extension-list-item .ellipsis {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .footer > .monaco-action-bar > .actions-container {
|
||||
flex-wrap: wrap-reverse;
|
||||
}
|
||||
|
||||
.extension-list-item > .details > .footer > .monaco-action-bar > .actions-container .extension-action.label {
|
||||
max-width: 150px;
|
||||
}
|
||||
@@ -12,6 +12,17 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .action-label.extension-action.text,
|
||||
.monaco-action-bar .action-item .action-label.extension-action.label {
|
||||
line-height: 14px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .action-label.extension-action.icon {
|
||||
height: 18px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.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 {
|
||||
@@ -20,6 +31,7 @@
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-action.hide,
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-action.ignore,
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-action.undo-ignore,
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-action.install:not(.installing),
|
||||
@@ -31,6 +43,7 @@
|
||||
.monaco-action-bar .action-item.disabled .action-label.disable-status.hide,
|
||||
.monaco-action-bar .action-item.disabled .action-label.system-disable.hide,
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-status-label.hide,
|
||||
.monaco-action-bar .action-item .action-label.extension-action.manage.hide,
|
||||
.monaco-action-bar .action-item.disabled .action-label.malicious-status.not-malicious {
|
||||
display: none;
|
||||
}
|
||||
@@ -40,70 +53,11 @@
|
||||
padding-right: 4px;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .action-label.disable-status,
|
||||
.monaco-action-bar .action-item .action-label.malicious-status,
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-status-label {
|
||||
opacity: 0.9;
|
||||
line-height: initial;
|
||||
padding: 0 5px;
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-action {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.monaco-action-bar .action-item .action-label.disable-status,
|
||||
.monaco-action-bar .action-item .action-label.malicious-status {
|
||||
border-radius: 4px;
|
||||
color: inherit;
|
||||
background-color: transparent;
|
||||
.monaco-action-bar .action-item.disabled .action-label.extension-action.text {
|
||||
opacity: 0.9;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.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 {
|
||||
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 {
|
||||
opacity: 1;
|
||||
height: 18px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.extension-status-label,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.disable-status,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.malicious-status {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.extension-status-label:hover,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.disable-status:hover,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.malicious-status:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.extensions-viewlet>.extensions .extension>.details>.footer>.monaco-action-bar .action-item .action-label.extension-action.manage.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.extensions-viewlet>.extensions .extension>.details>.footer>.monaco-action-bar .action-item .action-label.extension-action.manage {
|
||||
height: 18px;
|
||||
width: 10px;
|
||||
border: none;
|
||||
color: inherit;
|
||||
background: none;
|
||||
outline-offset: 0px;
|
||||
margin-top: 0.25em;
|
||||
}
|
||||
|
||||
.extension-editor > .header.recommended > .details > .recommendation > .monaco-action-bar .actions-container {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
@@ -154,16 +154,32 @@
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .action-label {
|
||||
font-weight: 600;
|
||||
margin: 4px 8px 4px 0px;
|
||||
padding: 1px 6px;
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .extension-action {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .extension-action {
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .extension-action.label {
|
||||
font-weight: 600;
|
||||
padding: 1px 6px;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .action-label.system-disable {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.extension-status-label,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.disable-status,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.malicious-status {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.extension-status-label:hover,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.disable-status:hover,
|
||||
.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.malicious-status:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .subtext-container {
|
||||
display: block;
|
||||
float: left;
|
||||
@@ -183,6 +199,7 @@
|
||||
margin-top: 5px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.extension-editor > .header > .details > .subtext-container > .monaco-action-bar .action-label {
|
||||
margin-top: 4px;
|
||||
margin-left: 4px;
|
||||
@@ -190,6 +207,10 @@
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.extension-editor > .header.recommended > .details > .recommendation > .monaco-action-bar .actions-container {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.extension-editor > .body {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
@@ -247,6 +268,52 @@
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme > .extension-pack {
|
||||
height: 224px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme.narrow > .extension-pack {
|
||||
height: 142px;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme > .readme-content {
|
||||
height: calc(100% - 224px);
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme.narrow > .readme-content {
|
||||
height: calc(100% - 142px);
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme > .extension-pack > .header,
|
||||
.extension-editor > .body > .content > .extension-pack-readme > .extension-pack > .footer {
|
||||
margin-bottom: 10px;
|
||||
margin-right: 30px;
|
||||
font-weight: bold;
|
||||
font-size: 120%;
|
||||
border-bottom: 1px solid rgba(128, 128, 128, 0.22);
|
||||
padding: 4px 6px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme > .extension-pack > .extension-pack-content {
|
||||
height: calc(100% - 60px);
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .extension-pack-readme > .extension-pack > .extension-pack-content > .monaco-scrollable-element {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content .extension-pack-readme > .extension-pack > .extension-pack-content > .monaco-scrollable-element > .subcontent {
|
||||
height: 100%;
|
||||
overflow-y: scroll;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.extension-editor > .body > .content > .monaco-scrollable-element > .subcontent {
|
||||
height: 100%;
|
||||
padding: 20px;
|
||||
@@ -398,3 +465,25 @@
|
||||
font-weight: 600;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.extension-editor .extensions-grid-view {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.extension-editor .extensions-grid-view > .extension-container {
|
||||
margin: 0 10px 20px 0;
|
||||
}
|
||||
|
||||
.extension-editor .extensions-grid-view .extension-list-item {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.extension-editor .extensions-grid-view .extension-list-item > .details .header > .name {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.extension-editor .extensions-grid-view > .extension-container:focus > .extension-list-item > .details .header > .name,
|
||||
.extension-editor .extensions-grid-view > .extension-container:focus > .extension-list-item > .details .header > .name:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
@@ -74,241 +74,47 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .bookmark {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .bookmark > .recommendation {
|
||||
border-right: 20px solid transparent;
|
||||
border-top: 20px solid;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .bookmark > .recommendation > .codicon {
|
||||
.extensions-viewlet > .extensions .extension-list-item {
|
||||
position: absolute;
|
||||
top: 1px;
|
||||
left: 1px;
|
||||
color: inherit;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0 0 0 16px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension.loading {
|
||||
.extensions-viewlet > .extensions .extension-list-item.loading {
|
||||
background: url('loading.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .icon-container {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .icon-container > .icon {
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
padding: 10px 14px 10px 0;
|
||||
flex-shrink: 0;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .icon-container .extension-remote-badge {
|
||||
position: absolute;
|
||||
right: 5px;
|
||||
bottom: 5px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
border-radius: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .icon-container .extension-remote-badge .codicon {
|
||||
color: currentColor;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .details > .header-container > .header > .extension-remote-badge-container {
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .details > .header-container > .header .extension-remote-badge {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
line-height: 14px;
|
||||
border-radius: 20px;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .monaco-list-row > .extension > .details > .header-container > .header .extension-remote-badge > .codicon {
|
||||
font-size: 12px;
|
||||
color: currentColor;
|
||||
}
|
||||
|
||||
.extensions-viewlet.narrow > .extensions .extension > .icon-container,
|
||||
.extensions-viewlet > .extensions .extension.loading > .icon-container {
|
||||
.extensions-viewlet.narrow > .extensions .extension-list-item > .icon-container,
|
||||
.extensions-viewlet > .extensions .extension-list-item.loading > .icon-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details {
|
||||
flex: 1;
|
||||
padding: 4px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container {
|
||||
height: 19px;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
padding-right: 11px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .name {
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .version {
|
||||
opacity: 0.85;
|
||||
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 .codicon {
|
||||
font-size: 120%;
|
||||
margin-right: 2px;
|
||||
-webkit-mask: inherit;
|
||||
}
|
||||
|
||||
.extensions-viewlet>.extensions .extension>.details>.header-container>.header .extension-remote-badge .codicon {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .header-container > .header > .ratings {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.extensions-viewlet:not(.narrow) > .extensions .extension > .details > .header-container > .header > .extension-remote-badge-container,
|
||||
.extensions-viewlet.narrow > .extensions .extension > .details > .header-container > .header > .ratings,
|
||||
.extensions-viewlet.narrow > .extensions .extension > .details > .header-container > .header > .install-count {
|
||||
.extensions-viewlet:not(.narrow) > .extensions .extension-list-item > .details > .header-container > .header > .extension-remote-badge-container,
|
||||
.extensions-viewlet.narrow > .extensions .extension-list-item > .details > .header-container > .header > .ratings,
|
||||
.extensions-viewlet.narrow > .extensions .extension-list-item > .details > .header-container > .header > .install-count {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .description {
|
||||
padding-right: 11px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-right: 7px;
|
||||
height: 24px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer > .author {
|
||||
flex: 1;
|
||||
font-size: 90%;
|
||||
opacity: 0.9;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer > .sync-ignored {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer > .sync-ignored > .codicon {
|
||||
font-size: 14px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .selected .extension > .details > .footer > .author,
|
||||
.extensions-viewlet > .extensions .selected.focused .extension > .details > .footer > .author {
|
||||
.extensions-viewlet > .extensions .selected .extension-list-item > .details > .footer > .author,
|
||||
.extensions-viewlet > .extensions .selected.focused .extension-list-item > .details > .footer > .author {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer > .monaco-action-bar > .actions-container {
|
||||
flex-wrap: wrap-reverse;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer > .monaco-action-bar > .actions-container .extension-action {
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
.extensions-viewlet.narrow > .extensions .extension > .details > .footer > .monaco-action-bar > .actions-container .extension-action {
|
||||
.extensions-viewlet.narrow > .extensions .extension-list-item > .details > .footer > .monaco-action-bar > .actions-container .extension-action {
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer > .monaco-action-bar .action-label {
|
||||
margin-top: 0.3em;
|
||||
margin-left: 0.3em;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension > .details > .footer > .monaco-action-bar .action-label:not(:empty) {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .bookmark,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .bookmark,
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .icon-container > .icon,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .icon-container > .icon,
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .details > .header-container,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .details > .header-container,
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .details > .description,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .details > .description,
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .details > .footer > .author,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension > .details > .footer > .author {
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .icon-container > .icon,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .icon-container > .icon,
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .details > .header-container,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .details > .header-container,
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .details > .description,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .details > .description,
|
||||
.vs .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .details > .footer > .author,
|
||||
.vs-dark .extensions-viewlet > .extensions .monaco-list-row.disabled > .extension-list-item > .details > .footer > .author {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.extensions-viewlet > .extensions .extension .ellipsis {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.extensions-badge.progress-badge > .badge-content {
|
||||
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgdmlld0JveD0iMiAyIDE0IDE0IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDIgMiAxNCAxNCI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTkgMTZjLTMuODYgMC03LTMuMTQtNy03czMuMTQtNyA3LTdjMy44NTkgMCA3IDMuMTQxIDcgN3MtMy4xNDEgNy03IDd6bTAtMTIuNmMtMy4wODggMC01LjYgMi41MTMtNS42IDUuNnMyLjUxMiA1LjYgNS42IDUuNiA1LjYtMi41MTIgNS42LTUuNi0yLjUxMi01LjYtNS42LTUuNnptMy44NiA3LjFsLTMuMTYtMS44OTZ2LTMuODA0aC0xLjR2NC41OTZsMy44NCAyLjMwNS43Mi0xLjIwMXoiLz48L3N2Zz4=");
|
||||
background-position: center center;
|
||||
|
||||
@@ -32,3 +32,24 @@
|
||||
.extension-ratings .codicon-star-empty {
|
||||
opacity: .4;
|
||||
}
|
||||
|
||||
.extension-bookmark {
|
||||
display: inline-block;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.extension-bookmark > .recommendation {
|
||||
border-right: 20px solid transparent;
|
||||
border-top: 20px solid;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.extension-bookmark > .recommendation > .codicon {
|
||||
position: absolute;
|
||||
bottom: 9px;
|
||||
left: 1px;
|
||||
color: inherit;
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = paged.firstPage[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('Install', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -148,7 +148,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
assert.equal('extension-action label install installing', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -215,7 +215,7 @@ suite('ExtensionsActions Test', () => {
|
||||
uninstallEvent.fire(local.identifier);
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('Uninstalling', testObject.label);
|
||||
assert.equal('extension-action uninstall uninstalling', testObject.class);
|
||||
assert.equal('extension-action label uninstall uninstalling', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -230,7 +230,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Uninstall', testObject.label);
|
||||
assert.equal('extension-action uninstall', testObject.class);
|
||||
assert.equal('extension-action label uninstall', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -245,7 +245,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('Uninstall', testObject.label);
|
||||
assert.equal('extension-action uninstall', testObject.class);
|
||||
assert.equal('extension-action label uninstall', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -281,7 +281,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Uninstall', testObject.label);
|
||||
assert.equal('extension-action uninstall', testObject.class);
|
||||
assert.equal('extension-action label uninstall', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -290,7 +290,7 @@ suite('ExtensionsActions Test', () => {
|
||||
instantiationService.createInstance(ExtensionContainers, [testObject]);
|
||||
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action prominent install no-extension', testObject.class);
|
||||
assert.equal('extension-action label prominent install no-extension', testObject.class);
|
||||
});
|
||||
|
||||
test('Test CombinedInstallAction when extension is system extension', () => {
|
||||
@@ -303,7 +303,7 @@ suite('ExtensionsActions Test', () => {
|
||||
.then(extensions => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action prominent install no-extension', testObject.class);
|
||||
assert.equal('extension-action label prominent install no-extension', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -319,7 +319,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = paged.firstPage[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -334,7 +334,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Uninstall', testObject.label);
|
||||
assert.equal('extension-action uninstall', testObject.class);
|
||||
assert.equal('extension-action label uninstall', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -351,7 +351,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
assert.equal('extension-action label install installing', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -370,7 +370,7 @@ suite('ExtensionsActions Test', () => {
|
||||
installEvent.fire({ identifier: gallery.identifier, gallery });
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
assert.equal('extension-action label install installing', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -386,7 +386,7 @@ suite('ExtensionsActions Test', () => {
|
||||
uninstallEvent.fire(local.identifier);
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('Uninstalling', testObject.label);
|
||||
assert.equal('extension-action uninstall uninstalling', testObject.class);
|
||||
assert.equal('extension-action label uninstall uninstalling', testObject.class);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -498,7 +498,7 @@ suite('ExtensionsActions Test', () => {
|
||||
.then(extensions => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('extension-action manage codicon-gear', testObject.class);
|
||||
assert.equal('extension-action icon manage codicon-gear', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -513,7 +513,7 @@ suite('ExtensionsActions Test', () => {
|
||||
.then(page => {
|
||||
testObject.extension = page.firstPage[0];
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action manage codicon-gear hide', testObject.class);
|
||||
assert.equal('extension-action icon manage codicon-gear hide', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -530,7 +530,7 @@ suite('ExtensionsActions Test', () => {
|
||||
|
||||
installEvent.fire({ identifier: gallery.identifier, gallery });
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action manage codicon-gear hide', testObject.class);
|
||||
assert.equal('extension-action icon manage codicon-gear hide', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -548,7 +548,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 codicon-gear', testObject.class);
|
||||
assert.equal('extension-action icon manage codicon-gear', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -563,7 +563,7 @@ suite('ExtensionsActions Test', () => {
|
||||
.then(extensions => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('extension-action manage codicon-gear', testObject.class);
|
||||
assert.equal('extension-action icon manage codicon-gear', testObject.class);
|
||||
assert.equal('', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -580,7 +580,7 @@ suite('ExtensionsActions Test', () => {
|
||||
uninstallEvent.fire(local.identifier);
|
||||
|
||||
assert.ok(!testObject.enabled);
|
||||
assert.equal('extension-action manage codicon-gear', testObject.class);
|
||||
assert.equal('extension-action icon manage codicon-gear', testObject.class);
|
||||
assert.equal('Uninstalling', testObject.tooltip);
|
||||
});
|
||||
});
|
||||
@@ -1549,7 +1549,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test remote install action when installing local workspace extension', async () => {
|
||||
@@ -1575,12 +1575,12 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
|
||||
onInstallExtension.fire({ identifier: localWorkspaceExtension.identifier, gallery });
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
assert.equal('extension-action label install installing', testObject.class);
|
||||
});
|
||||
|
||||
test('Test remote install action when installing local workspace extension is finished', async () => {
|
||||
@@ -1608,12 +1608,12 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
|
||||
onInstallExtension.fire({ identifier: localWorkspaceExtension.identifier, gallery });
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Installing', testObject.label);
|
||||
assert.equal('extension-action install installing', testObject.class);
|
||||
assert.equal('extension-action label install installing', testObject.class);
|
||||
|
||||
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 });
|
||||
@@ -1639,7 +1639,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test remote install action is disabled when extension is not set', async () => {
|
||||
@@ -1856,7 +1856,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install in remote', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test remote install action is disabled if local language pack extension is uninstalled', async () => {
|
||||
@@ -1902,7 +1902,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test local install action when installing remote ui extension', async () => {
|
||||
@@ -1928,12 +1928,12 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label 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);
|
||||
assert.equal('extension-action label install installing', testObject.class);
|
||||
});
|
||||
|
||||
test('Test local install action when installing remote ui extension is finished', async () => {
|
||||
@@ -1961,12 +1961,12 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label 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);
|
||||
assert.equal('extension-action label 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 });
|
||||
@@ -1992,7 +1992,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled when extension is not set', async () => {
|
||||
@@ -2212,7 +2212,7 @@ suite('ExtensionsActions Test', () => {
|
||||
testObject.extension = extensions[0];
|
||||
assert.ok(testObject.enabled);
|
||||
assert.equal('Install Locally', testObject.label);
|
||||
assert.equal('extension-action prominent install', testObject.class);
|
||||
assert.equal('extension-action label prominent install', testObject.class);
|
||||
});
|
||||
|
||||
test('Test local install action is disabled if remote language pack extension is uninstalled', async () => {
|
||||
|
||||
Reference in New Issue
Block a user