mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 08:40:29 -04:00
Merge from vscode 6e530127a1bb8ffbd1bfb77dc680c321dc0d71f5 (#6844)
This commit is contained in:
@@ -50,11 +50,12 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten
|
||||
import { getDefaultValue } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { isUndefined } from 'vs/base/common/types';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/common/webview';
|
||||
import { IWebviewService, Webview } from 'vs/workbench/contrib/webview/browser/webview';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { renderDashboardContributions } from 'sql/workbench/parts/extensions/browser/contributionRenders'; // {{SQL CARBON EDIT}}
|
||||
import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { platform } from 'vs/base/common/process';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
function removeEmbeddedSVGs(documentContent: string): string {
|
||||
const newDocument = new DOMParser().parseFromString(documentContent, 'text/html');
|
||||
@@ -186,7 +187,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@IWorkbenchThemeService private readonly workbenchThemeService: IWorkbenchThemeService,
|
||||
@IWebviewService private readonly webviewService: IWebviewService,
|
||||
@IWebviewService private readonly webviewService: IWebviewService
|
||||
) {
|
||||
super(ExtensionEditor.ID, telemetryService, themeService, storageService);
|
||||
this.extensionReadme = null;
|
||||
@@ -355,8 +356,8 @@ export class ExtensionEditor extends BaseEditor {
|
||||
toggleClass(template.publisher, 'clickable', !!extension.url);
|
||||
toggleClass(template.rating, 'clickable', !!extension.url);
|
||||
if (extension.url) {
|
||||
this.transientDisposables.add(this.onClick(template.name, () => window.open(extension.url)));
|
||||
this.transientDisposables.add(this.onClick(template.rating, () => window.open(`${extension.url}#review-details`)));
|
||||
this.transientDisposables.add(this.onClick(template.name, () => this.openerService.open(URI.parse(extension.url!))));
|
||||
this.transientDisposables.add(this.onClick(template.rating, () => this.openerService.open(URI.parse(`${extension.url}#review-details`))));
|
||||
this.transientDisposables.add(this.onClick(template.publisher, () => {
|
||||
this.viewletService.openViewlet(VIEWLET_ID, true)
|
||||
.then(viewlet => viewlet as IExtensionsViewlet)
|
||||
@@ -364,7 +365,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
}));
|
||||
|
||||
if (extension.licenseUrl) {
|
||||
this.transientDisposables.add(this.onClick(template.license, () => window.open(extension.licenseUrl)));
|
||||
this.transientDisposables.add(this.onClick(template.license, () => this.openerService.open(URI.parse(extension.licenseUrl!))));
|
||||
template.license.style.display = 'initial';
|
||||
} else {
|
||||
template.license.style.display = 'none';
|
||||
@@ -384,7 +385,7 @@ export class ExtensionEditor extends BaseEditor {
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
|
||||
if (extension.repository) {
|
||||
this.transientDisposables.add(this.onClick(template.repository, () => window.open(extension.repository)));
|
||||
this.transientDisposables.add(this.onClick(template.repository, () => this.openerService.open(URI.parse(extension.repository!))));
|
||||
template.repository.style.display = 'initial';
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -534,8 +534,8 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
return false;
|
||||
}
|
||||
|
||||
const id = recommendationsToSuggest[0];
|
||||
const tip = this._importantExeBasedRecommendations[id];
|
||||
const extensionId = recommendationsToSuggest[0];
|
||||
const tip = this._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.notificationService.prompt(Severity.Info, message,
|
||||
@@ -548,8 +548,8 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
"extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'install', extensionId: name });
|
||||
this.instantiationService.createInstance(InstallRecommendedExtensionAction, id).run();
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'install', extensionId });
|
||||
this.instantiationService.createInstance(InstallRecommendedExtensionAction, extensionId).run();
|
||||
}
|
||||
}, {
|
||||
label: localize('showRecommendations', "Show Recommendations"),
|
||||
@@ -560,7 +560,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
"extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'show', extensionId: name });
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'show', extensionId });
|
||||
|
||||
const recommendationsAction = this.instantiationService.createInstance(ShowRecommendedExtensionsAction, ShowRecommendedExtensionsAction.ID, localize('showRecommendations', "Show Recommendations"));
|
||||
recommendationsAction.run();
|
||||
@@ -570,14 +570,14 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
label: choiceNever,
|
||||
isSecondary: true,
|
||||
run: () => {
|
||||
this.addToImportantRecommendationsIgnore(id);
|
||||
this.addToImportantRecommendationsIgnore(extensionId);
|
||||
/* __GDPR__
|
||||
"exeExtensionRecommendations:popup" : {
|
||||
"userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'neverShowAgain', extensionId: name });
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'neverShowAgain', extensionId });
|
||||
this.notificationService.prompt(
|
||||
Severity.Info,
|
||||
localize('ignoreExtensionRecommendations', "Do you want to ignore all extension recommendations?"),
|
||||
@@ -600,7 +600,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
|
||||
"extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'cancelled', extensionId: name });
|
||||
this.telemetryService.publicLog('exeExtensionRecommendations:popup', { userReaction: 'cancelled', extensionId });
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -17,6 +17,7 @@ import { join } from 'vs/base/common/path';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
abstract class RepoInfo {
|
||||
abstract get base(): string;
|
||||
@@ -117,6 +118,7 @@ class ReportExtensionSlowAction extends Action {
|
||||
readonly repoInfo: RepoInfo,
|
||||
readonly profile: IExtensionHostProfile,
|
||||
@IDialogService private readonly _dialogService: IDialogService,
|
||||
@IOpenerService private readonly _openerService: IOpenerService
|
||||
) {
|
||||
super('report.slow', localize('cmd.report', "Report Issue"));
|
||||
}
|
||||
@@ -140,7 +142,7 @@ class ReportExtensionSlowAction extends Action {
|
||||
- VSCode version: \`${pkg.version}\`\n\n${message}`);
|
||||
|
||||
const url = `${this.repoInfo.base}/${this.repoInfo.owner}/${this.repoInfo.repo}/issues/new/?body=${body}&title=${title}`;
|
||||
window.open(url);
|
||||
this._openerService.open(URI.parse(url));
|
||||
|
||||
this._dialogService.show(
|
||||
Severity.Info,
|
||||
@@ -158,6 +160,7 @@ class ShowExtensionSlowAction extends Action {
|
||||
readonly repoInfo: RepoInfo,
|
||||
readonly profile: IExtensionHostProfile,
|
||||
@IDialogService private readonly _dialogService: IDialogService,
|
||||
@IOpenerService private readonly _openerService: IOpenerService
|
||||
) {
|
||||
super('show.slow', localize('cmd.show', "Show Issues"));
|
||||
}
|
||||
@@ -172,7 +175,7 @@ class ShowExtensionSlowAction extends Action {
|
||||
|
||||
// show issues
|
||||
const url = `${this.repoInfo.base}/${this.repoInfo.owner}/${this.repoInfo.repo}/issues?utf8=✓&q=is%3Aissue+state%3Aopen+%22Extension+causes+high+cpu+load%22`;
|
||||
window.open(url);
|
||||
this._openerService.open(URI.parse(url));
|
||||
|
||||
this._dialogService.show(
|
||||
Severity.Info,
|
||||
|
||||
@@ -44,6 +44,8 @@ import { ExtensionIdentifier, ExtensionType, IExtensionDescription } from 'vs/pl
|
||||
import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
|
||||
import { SlowExtensionAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsSlowActions';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export const IExtensionHostProfileService = createDecorator<IExtensionHostProfileService>('extensionHostProfileService');
|
||||
export const CONTEXT_PROFILE_SESSION_STATE = new RawContextKey<string>('profileSessionState', 'none');
|
||||
@@ -120,7 +122,8 @@ export class RuntimeExtensionsEditor extends BaseEditor {
|
||||
@IExtensionHostProfileService private readonly _extensionHostProfileService: IExtensionHostProfileService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@ILabelService private readonly _labelService: ILabelService,
|
||||
@IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService
|
||||
@IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService,
|
||||
@IOpenerService private readonly _openerService: IOpenerService
|
||||
) {
|
||||
super(RuntimeExtensionsEditor.ID, telemetryService, themeService, storageService);
|
||||
|
||||
@@ -312,7 +315,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
|
||||
data.actionbar.push(this._instantiationService.createInstance(SlowExtensionAction, element.description, element.unresponsiveProfile), { icon: true, label: true });
|
||||
}
|
||||
if (isNonEmptyArray(element.status.runtimeErrors)) {
|
||||
data.actionbar.push(new ReportExtensionIssueAction(element), { icon: true, label: true });
|
||||
data.actionbar.push(new ReportExtensionIssueAction(element, this._openerService), { icon: true, label: true });
|
||||
}
|
||||
|
||||
let title: string;
|
||||
@@ -416,7 +419,7 @@ export class RuntimeExtensionsEditor extends BaseEditor {
|
||||
|
||||
const actions: IAction[] = [];
|
||||
|
||||
actions.push(new ReportExtensionIssueAction(e.element));
|
||||
actions.push(new ReportExtensionIssueAction(e.element, this._openerService));
|
||||
actions.push(new Separator());
|
||||
|
||||
if (e.element.marketplaceInfo) {
|
||||
@@ -480,7 +483,7 @@ export class ReportExtensionIssueAction extends Action {
|
||||
marketplaceInfo: IExtension;
|
||||
status?: IExtensionsStatus;
|
||||
unresponsiveProfile?: IExtensionHostProfile
|
||||
}) {
|
||||
}, @IOpenerService private readonly openerService: IOpenerService) {
|
||||
super(ReportExtensionIssueAction._id, ReportExtensionIssueAction._label, 'extension-action report-issue');
|
||||
this.enabled = extension.marketplaceInfo
|
||||
&& extension.marketplaceInfo.type === ExtensionType.User
|
||||
@@ -490,7 +493,7 @@ export class ReportExtensionIssueAction extends Action {
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
window.open(this._url);
|
||||
this.openerService.open(URI.parse(this._url));
|
||||
}
|
||||
|
||||
private static _generateNewIssueUrl(extension: {
|
||||
|
||||
Reference in New Issue
Block a user