Merge from vscode ad407028575a77ea387eb7cc219b323dc017b686

This commit is contained in:
ADS Merger
2020-08-22 06:06:52 +00:00
committed by Anthony Dresser
parent 404260b8a0
commit 4ad73d381c
480 changed files with 14360 additions and 14122 deletions

View File

@@ -451,7 +451,7 @@ export class ExtensionEditor extends BaseEditor {
}
this.setSubText(extension, reloadAction, template);
template.content.innerHTML = ''; // Clear content before setting navbar actions.
template.content.innerText = ''; // Clear content before setting navbar actions.
template.navbar.clear();
@@ -582,7 +582,7 @@ export class ExtensionEditor extends BaseEditor {
}
this.contentDisposables.clear();
template.content.innerHTML = '';
template.content.innerText = '';
this.activeElement = null;
if (id) {
this.open(id, extension, template)

View File

@@ -480,7 +480,7 @@ function overrideActionForActiveExtensionEditorWebview(command: MultiCommand | u
const editorService = accessor.get(IEditorService);
const editor = editorService.activeEditorPane;
if (editor instanceof ExtensionEditor) {
if (editor.activeWebview) {
if (editor.activeWebview?.isFocused) {
f(editor.activeWebview);
return true;
}

View File

@@ -140,6 +140,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
addClass(data.element, 'loading');
data.root.removeAttribute('aria-label');
data.root.removeAttribute('data-extension-id');
data.extensionDisposables = dispose(data.extensionDisposables);
data.icon.src = '';
data.name.textContent = '';
@@ -153,6 +154,7 @@ export class Renderer implements IPagedRenderer<IExtension, ITemplateData> {
renderElement(extension: IExtension, index: number, data: ITemplateData): void {
removeClass(data.element, 'loading');
data.root.setAttribute('data-extension-id', extension.identifier.id);
if (extension.state !== ExtensionState.Uninstalled && !extension.server) {
// Get the extension if it is installed and has no server information

View File

@@ -55,7 +55,7 @@ export class InstallCountWidget extends ExtensionWidget {
}
render(): void {
this.container.innerHTML = '';
this.container.innerText = '';
if (!this.extension) {
return;
@@ -105,7 +105,7 @@ export class RatingsWidget extends ExtensionWidget {
}
render(): void {
this.container.innerHTML = '';
this.container.innerText = '';
if (!this.extension) {
return;

View File

@@ -3,13 +3,12 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IExtensionManagementService, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ExtensionRecommendations, ExtensionRecommendation } from 'vs/workbench/contrib/extensions/browser/extensionRecommendations';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
import { ExtensionRecommendationSource, ExtensionRecommendationReason } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
import { IExtensionsViewPaneContainer, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions';
import { ExtensionRecommendationSource, ExtensionRecommendationReason, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement';
import { IExtensionsViewPaneContainer, IExtensionsWorkbenchService, IExtension } from 'vs/workbench/contrib/extensions/common/extensions';
import { CancellationToken } from 'vs/base/common/cancellation';
import { localize } from 'vs/nls';
import { StorageScope, IStorageService } from 'vs/platform/storage/common/storage';
@@ -85,7 +84,6 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
constructor(
isExtensionAllowedToBeRecommended: (extensionId: string) => boolean,
@IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService,
@IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
@IExtensionService private readonly extensionService: IExtensionService,
@IViewletService private readonly viewletService: IViewletService,
@@ -190,7 +188,7 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
return;
}
const installed = await this.extensionManagementService.getInstalled();
const installed = await this.extensionsWorkbenchService.queryLocal();
if (await this.promptRecommendedExtensionForFileType(recommendationsToPrompt, installed)) {
return;
}
@@ -211,7 +209,7 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
this.promptRecommendedExtensionForFileExtension(fileExtension, installed);
}
private async promptRecommendedExtensionForFileType(recommendations: string[], installed: ILocalExtension[]): Promise<boolean> {
private async promptRecommendedExtensionForFileType(recommendations: string[], installed: IExtension[]): Promise<boolean> {
recommendations = this.filterIgnoredOrNotAllowed(recommendations);
if (recommendations.length === 0) {
@@ -238,11 +236,15 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
return true;
}
private async promptRecommendedExtensionForFileExtension(fileExtension: string, installed: ILocalExtension[]): Promise<void> {
private async promptRecommendedExtensionForFileExtension(fileExtension: string, installed: IExtension[]): Promise<void> {
// {{SQL CARBON EDIT}} - Turn off file extension-based extensions until we have a scenario that requires this. The queryGallery isn't working correctly in ADS now.
let enableRecommendation: boolean = false;
if (!enableRecommendation) {
return;
}
const fileExtensionSuggestionIgnoreList = <string[]>JSON.parse(this.storageService.get('extensionsAssistant/fileExtensionsSuggestionIgnore', StorageScope.GLOBAL, '[]'));
if (fileExtensionSuggestionIgnoreList.indexOf(fileExtension) > -1) {
return;
} else {
const fileExtensionSuggestionIgnoreList = <string[]>JSON.parse(this.storageService.get('extensionsAssistant/fileExtensionsSuggestionIgnore', StorageScope.GLOBAL, '[]'));
if (fileExtensionSuggestionIgnoreList.indexOf(fileExtension) > -1) {
@@ -296,8 +298,13 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
}
}
private filterInstalled(recommendationsToSuggest: string[], installed: ILocalExtension[]): string[] {
const installedExtensionsIds = installed.reduce((result, i) => { result.add(i.identifier.id.toLowerCase()); return result; }, new Set<string>());
private filterInstalled(recommendationsToSuggest: string[], installed: IExtension[]): string[] {
const installedExtensionsIds = installed.reduce((result, i) => {
if (i.enablementState !== EnablementState.DisabledByExtensionKind) {
result.add(i.identifier.id.toLowerCase());
}
return result;
}, new Set<string>());
return recommendationsToSuggest.filter(id => !installedExtensionsIds.has(id.toLowerCase()));
}
@@ -321,4 +328,3 @@ export class FileBasedRecommendations extends ExtensionRecommendations {
this.storageService.store(recommendationsStorageKey, JSON.stringify(storedRecommendations), StorageScope.GLOBAL);
}
}