Merge from vscode 1b314ab317fbff7d799b21754326b7d849889ceb

This commit is contained in:
ADS Merger
2020-07-15 23:51:18 +00:00
parent aae013d498
commit 9d3f12d0b7
554 changed files with 15159 additions and 8223 deletions

View File

@@ -15,7 +15,6 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
import { IWorkspaceContextService, IWorkspaceFoldersChangeEvent } from 'vs/platform/workspace/common/workspace';
import { distinct } from 'vs/base/common/arrays';
import { values } from 'vs/base/common/map';
export class ConfigBasedRecommendations extends ExtensionRecommendations {
@@ -60,8 +59,8 @@ export class ConfigBasedRecommendations extends ExtensionRecommendations {
}
}
}
this.importantTips = values(importantTips);
this.otherTips = values(otherTips).filter(tip => !importantTips.has(tip.extensionId));
this.importantTips = [...importantTips.values()];
this.otherTips = [...otherTips.values()].filter(tip => !importantTips.has(tip.extensionId));
this._recommendations = [...this.importantTips, ...this.otherTips].map(tip => this.toExtensionRecommendation(tip));
}

View File

@@ -85,10 +85,12 @@ export class ExeBasedRecommendations extends ExtensionRecommendations {
return;
}
const extensionId = recommendations[0];
const tip = importantExeBasedRecommendations[extensionId];
const message = localize('exeRecommended', "The '{0}' extension is recommended as you have {1} installed on your system.", tip.friendlyName!, tip.exeFriendlyName || basename(tip.windowsPath!));
this.promptImportantExtensionInstallNotification(extensionId, message);
for (const extensionId of recommendations) {
const tip = importantExeBasedRecommendations[extensionId];
const message = tip.isExtensionPack ? localize('extensionPackRecommended', "The '{0}' extension pack is recommended as you have {1} installed on your system.", tip.extensionName!, tip.exeFriendlyName || basename(tip.windowsPath!))
: localize('exeRecommended', "The '{0}' extension is recommended as you have {1} installed on your system.", tip.extensionName!, tip.exeFriendlyName || basename(tip.windowsPath!));
this.promptImportantExtensionInstallNotification(extensionId, message);
}
}
private groupByInstalled(recommendationsToSuggest: string[], local: ILocalExtension[]): { installed: string[], uninstalled: string[] } {
@@ -110,7 +112,7 @@ export class ExeBasedRecommendations extends ExtensionRecommendations {
source: 'executable',
reason: {
reasonId: ExtensionRecommendationReason.Executable,
reasonText: localize('exeBasedRecommendation', "This extension is recommended because you have {0} installed.", tip.friendlyName)
reasonText: localize('exeBasedRecommendation', "This extension is recommended because you have {0} installed.", tip.extensionName)
}
};
}

View File

@@ -225,24 +225,24 @@ export class ExtensionEditor extends BaseEditor {
builtin.textContent = localize('builtin', "Built-in");
const subtitle = append(details, $('.subtitle'));
const publisher = append(subtitle, $('span.publisher.clickable', { title: localize('publisher', "Publisher name"), tabIndex: 0 }));
const publisher = append(append(subtitle, $('.subtitle-entry')), $('span.publisher.clickable', { title: localize('publisher', "Publisher name"), tabIndex: 0 }));
// {{SQL CARBON EDIT}} remove rating and install count widgets
// const installCount = append(subtitle, $('span.install', { title: localize('install count', "Install count"), tabIndex: 0 }));
// const installCount = append(append(subtitle, $('.subtitle-entry')), $('span.install', { title: localize('install count', "Install count"), tabIndex: 0 }));
// const rating = append(subtitle, $('span.rating.clickable', { title: localize('rating', "Rating"), tabIndex: 0 }));
// const rating = append(append(subtitle, $('.subtitle-entry')), $('span.rating.clickable', { title: localize('rating', "Rating"), tabIndex: 0 }));
const repository = append(subtitle, $('span.repository.clickable'));
const repository = append(append(subtitle, $('.subtitle-entry')), $('span.repository.clickable'));
repository.textContent = localize('repository', 'Repository');
repository.style.display = 'none';
repository.tabIndex = 0;
const license = append(subtitle, $('span.license.clickable'));
const license = append(append(subtitle, $('.subtitle-entry')), $('span.license.clickable'));
license.textContent = localize('license', 'License');
license.style.display = 'none';
license.tabIndex = 0;
const version = append(subtitle, $('span.version'));
const version = append(append(subtitle, $('.subtitle-entry')), $('span.version'));
version.textContent = localize('version', 'Version');
const description = append(details, $('.description'));
@@ -550,21 +550,22 @@ export class ExtensionEditor extends BaseEditor {
}
focus(): void {
if (this.activeElement) {
this.activeElement.focus();
}
this.activeElement?.focus();
}
showFind(): void {
if (this.activeElement && (<Webview>this.activeElement).showFind) {
(<Webview>this.activeElement).showFind();
}
this.activeWebview?.showFind();
}
runFindAction(previous: boolean): void {
if (this.activeElement && (<Webview>this.activeElement).runFindAction) {
(<Webview>this.activeElement).runFindAction(previous);
this.activeWebview?.runFindAction(previous);
}
public get activeWebview(): Webview | undefined {
if (!this.activeElement || !(this.activeElement as Webview).runFindAction) {
return undefined;
}
return this.activeElement as Webview;
}
private onNavbarChange(extension: IExtension, { id, focus }: { id: string | null, focus: boolean }, template: IExtensionEditorTemplate): void {

View File

@@ -19,7 +19,7 @@ import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/brow
import {
OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction,
ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, ShowBuiltInExtensionsAction, UpdateAllAction,
EnableAllAction, EnableAllWorkspaceAction, DisableAllAction, DisableAllWorkspaceAction, CheckForUpdatesAction, ShowLanguageExtensionsAction, ShowAzureExtensionsAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ConfigureRecommendedExtensionsCommandsContributor, InstallVSIXAction, ReinstallAction, InstallSpecificVersionOfExtensionAction
EnableAllAction, EnableAllWorkspaceAction, DisableAllAction, DisableAllWorkspaceAction, CheckForUpdatesAction, ShowLanguageExtensionsAction, ShowAzureExtensionsAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ConfigureRecommendedExtensionsCommandsContributor, InstallVSIXAction, ReinstallAction, InstallSpecificVersionOfExtensionAction, ClearExtensionsSearchResultsAction
} from 'vs/workbench/contrib/extensions/browser/extensionsActions';
import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput';
import { ExtensionEditor } from 'vs/workbench/contrib/extensions/browser/extensionEditor';
@@ -49,6 +49,10 @@ import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/
import { InstallExtensionQuickAccessProvider, ManageExtensionsQuickAccessProvider } from 'vs/workbench/contrib/extensions/browser/extensionsQuickAccess';
import { ExtensionRecommendationsService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationsService';
import { CONTEXT_SYNC_ENABLEMENT } from 'vs/workbench/services/userDataSync/common/userDataSync';
import { CopyAction, CutAction, PasteAction } from 'vs/editor/contrib/clipboard/clipboard';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { MultiCommand } from 'vs/editor/browser/editorExtensions';
import { Webview } from 'vs/workbench/contrib/webview/browser/webview';
// Singletons
registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService);
@@ -150,6 +154,7 @@ actionRegistry.registerWorkbenchAction(enableAllWorkspaceAction, 'Extensions: En
const checkForUpdatesAction = SyncActionDescriptor.from(CheckForUpdatesAction);
actionRegistry.registerWorkbenchAction(checkForUpdatesAction, `Extensions: Check for Extension Updates`, ExtensionsLabel);
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ClearExtensionsSearchResultsAction), 'Extensions: Clear Extensions Search Results', ExtensionsLabel);
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(EnableAutoUpdateAction), `Extensions: Enable Auto Updating Extensions`, ExtensionsLabel);
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(DisableAutoUpdateAction), `Extensions: Disable Auto Updating Extensions`, ExtensionsLabel);
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(InstallSpecificVersionOfExtensionAction), 'Install Specific Version of Extension...', ExtensionsLabel);
@@ -470,6 +475,25 @@ registerAction2(class extends Action2 {
}
});
function overrideActionForActiveExtensionEditorWebview(command: MultiCommand | undefined, f: (webview: Webview) => void) {
command?.addImplementation(105, (accessor) => {
const editorService = accessor.get(IEditorService);
const editor = editorService.activeEditorPane;
if (editor instanceof ExtensionEditor) {
if (editor.activeWebview) {
f(editor.activeWebview);
return true;
}
}
return false;
});
}
overrideActionForActiveExtensionEditorWebview(CopyAction, webview => webview.copy());
overrideActionForActiveExtensionEditorWebview(CutAction, webview => webview.cut());
overrideActionForActiveExtensionEditorWebview(PasteAction, webview => webview.paste());
const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
class ExtensionsContributions implements IWorkbenchContribution {

View File

@@ -60,6 +60,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
import { IFileDialogService, IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/progress';
import { Codicon } from 'vs/base/common/codicons';
import { IViewsService } from 'vs/workbench/common/views';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; // {{SQL CARBON EDIT}}
import product from 'vs/platform/product/common/product';
@@ -1662,19 +1663,39 @@ export class ShowDisabledExtensionsAction extends Action {
}
}
export class ClearExtensionsInputAction extends Action {
export class ClearExtensionsSearchResultsAction extends Action {
static readonly ID = 'workbench.extensions.action.clearExtensionsInput';
static readonly LABEL = localize('clearExtensionsInput', "Clear Extensions Search Results");
static readonly ID = 'workbench.extensions.action.clearExtensionsSearchResults';
static readonly LABEL = localize('clearExtensionsSearchResults', "Clear Extensions Search Results");
constructor(
id: string,
label: string,
@IViewsService private readonly viewsService: IViewsService
) {
super(id, label, 'codicon-clear-all', true);
}
async run(): Promise<void> {
const viewPaneContainer = this.viewsService.getActiveViewPaneContainerWithId(VIEWLET_ID);
if (viewPaneContainer) {
const extensionsViewPaneContainer = viewPaneContainer as IExtensionsViewPaneContainer;
extensionsViewPaneContainer.search('');
extensionsViewPaneContainer.focus();
}
}
}
export class ClearExtensionsInputAction extends ClearExtensionsSearchResultsAction {
constructor(
id: string,
label: string,
onSearchChange: Event<string>,
value: string,
@IViewletService private readonly viewletService: IViewletService
@IViewsService viewsService: IViewsService
) {
super(id, label, 'codicon-clear-all', true);
super(id, label, viewsService);
this.onSearchChange(value);
this._register(onSearchChange(this.onSearchChange, this));
}
@@ -1683,14 +1704,6 @@ export class ClearExtensionsInputAction extends Action {
this.enabled = !!value;
}
run(): Promise<void> {
return this.viewletService.openViewlet(VIEWLET_ID, true)
.then(viewlet => viewlet?.getViewPaneContainer() as IExtensionsViewPaneContainer)
.then(viewlet => {
viewlet.search('');
viewlet.focus();
});
}
}
export class ShowBuiltInExtensionsAction extends Action {

View File

@@ -9,7 +9,6 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
import { localize } from 'vs/nls';
import { values } from 'vs/base/common/map';
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { Action } from 'vs/base/common/actions';
@@ -55,7 +54,7 @@ export class ExtensionDependencyChecker extends Disposable implements IWorkbench
});
}
}
return values(missingDependencies);
return [...missingDependencies.values()];
}
private async installMissingDependencies(): Promise<void> {

View File

@@ -113,7 +113,7 @@
line-height: 20px;
}
.extension-editor > .header > .details > .subtitle > .publisher {
.extension-editor > .header > .details > .subtitle .publisher {
font-size: 18px;
}
@@ -124,12 +124,11 @@
align-items: center;
}
.extension-editor > .header > .details > .subtitle > .install > .count {
.extension-editor > .header > .details > .subtitle .install > .count {
margin-left: 6px;
}
.extension-editor > .header > .details > .subtitle > span:not(:first-child):not(:empty),
.extension-editor > .header > .details > .subtitle > a:not(:first-child):not(:empty) {
.extension-editor > .header > .details > .subtitle > div:not(:first-child):not(:empty) {
border-left: 1px solid rgba(128, 128, 128, 0.7);
margin-left: 14px;
padding-left: 14px;

View File

@@ -374,7 +374,12 @@ export class RuntimeExtensionsEditor extends BaseEditor {
]
}, "Activated by {1} because searching for {0} took too long", glob, activationId);
} else if (activationEvent === 'onStartupFinished') {
title = nls.localize('startupFinishedActivation', "Activated by {0} after start-up finished", activationId);
title = nls.localize({
key: 'startupFinishedActivation',
comment: [
'This refers to an extension. {0} will be an activation event.'
]
}, "Activated by {0} after start-up finished", activationId);
} else if (/^onLanguage:/.test(activationEvent)) {
let language = activationEvent.substr('onLanguage:'.length);
title = nls.localize('languageActivation', "Activated by {1} because you opened a {0} file", language, activationId);