mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 09:10:30 -04:00
Merge from vscode 91e99652cd5fcfc072387c64e151b435e39e8dcf (#6962)
This commit is contained in:
@@ -17,6 +17,10 @@ import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { basename } from 'vs/base/common/path';
|
||||
import { IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionType } from 'vs/platform/extensions/common/extensions';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { InstallRecommendedExtensionAction } from 'vs/workbench/contrib/extensions/browser/extensionsActions';
|
||||
import { IProductService } from 'vs/platform/product/common/product';
|
||||
|
||||
const MINIMUM_FONT_SIZE = 6;
|
||||
const MAXIMUM_FONT_SIZE = 25;
|
||||
@@ -40,7 +44,10 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
|
||||
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
||||
@IExtensionManagementService private readonly _extensionManagementService: IExtensionManagementService,
|
||||
@INotificationService private readonly _notificationService: INotificationService,
|
||||
@IStorageService private readonly _storageService: IStorageService
|
||||
@IStorageService private readonly _storageService: IStorageService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IProductService private readonly productService: IProductService
|
||||
) {
|
||||
this._updateConfig();
|
||||
this._configurationService.onDidChangeConfiguration(e => {
|
||||
@@ -263,18 +270,42 @@ export class TerminalConfigHelper implements IBrowserTerminalConfigHelper {
|
||||
this.recommendationsShown = true;
|
||||
|
||||
if (platform.isWindows && shellLaunchConfig.executable && basename(shellLaunchConfig.executable).toLowerCase() === 'wsl.exe') {
|
||||
if (! await this.isExtensionInstalled('ms-vscode-remote.remote-wsl')) {
|
||||
const exeBasedExtensionTips = this.productService.exeBasedExtensionTips;
|
||||
if (!exeBasedExtensionTips || !exeBasedExtensionTips.wsl) {
|
||||
return;
|
||||
}
|
||||
const extId = exeBasedExtensionTips.wsl.recommendations[0];
|
||||
if (extId && ! await this.isExtensionInstalled(extId)) {
|
||||
this._notificationService.prompt(
|
||||
Severity.Info,
|
||||
nls.localize(
|
||||
'useWslExtension.title',
|
||||
"Check out the 'Visual Studio Code Remote - WSL' extension for a great development experience in WSL. Click [here]({0}) to learn more.",
|
||||
'https://go.microsoft.com/fwlink/?linkid=2097212'
|
||||
),
|
||||
[],
|
||||
'useWslExtension.title', "The '{0}' extension is recommended for opening a terminal in WSL.", exeBasedExtensionTips.wsl.friendlyName),
|
||||
[
|
||||
{
|
||||
label: nls.localize('install', 'Install'),
|
||||
run: () => {
|
||||
/* __GDPR__
|
||||
"terminalLaunchRecommendation:popup" : {
|
||||
"userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"extensionId": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('terminalLaunchRecommendation:popup', { userReaction: 'install', extId });
|
||||
this.instantiationService.createInstance(InstallRecommendedExtensionAction, extId).run();
|
||||
}
|
||||
}
|
||||
],
|
||||
{
|
||||
sticky: true,
|
||||
neverShowAgain: { id: 'terminalConfigHelper/launchRecommendationsIgnore', scope: NeverShowAgainScope.WORKSPACE }
|
||||
neverShowAgain: { id: 'terminalConfigHelper/launchRecommendationsIgnore', scope: NeverShowAgainScope.WORKSPACE },
|
||||
onCancel: () => {
|
||||
/* __GDPR__
|
||||
"terminalLaunchRecommendation:popup" : {
|
||||
"userReaction" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('terminalLaunchRecommendation:popup', { userReaction: 'cancelled' });
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user