diff --git a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts index 36e999a0f7a90e34a90601bde90e313f8f7b5959..2a676957008baec1a2a1efe762213e7639167f81 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/browser/walkThroughPart.ts @@ -17,7 +17,7 @@ import { WalkThroughInput } from 'vs/workbench/contrib/welcome/walkThrough/brows import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IModelService } from 'vs/editor/common/services/modelService'; import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IInstantiationService, optional } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { localize } from 'vs/nls'; import { IStorageService } from 'vs/platform/storage/common/storage'; @@ -39,6 +39,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor import { CancellationToken } from 'vs/base/common/cancellation'; import { domEvent } from 'vs/base/browser/event'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { ITASExperimentService } from 'vs/workbench/services/experiment/common/experimentService'; export const WALK_THROUGH_FOCUS = new RawContextKey('interactivePlaygroundFocus', false); @@ -79,7 +80,8 @@ export class WalkThroughPart extends EditorPane { @IConfigurationService private readonly configurationService: IConfigurationService, @INotificationService private readonly notificationService: INotificationService, @IExtensionService private readonly extensionService: IExtensionService, - @IEditorGroupsService editorGroupService: IEditorGroupsService + @IEditorGroupsService editorGroupService: IEditorGroupsService, + @optional(ITASExperimentService) private tasExperimentService: ITASExperimentService | undefined, ) { super(WalkThroughPart.ID, telemetryService, themeService, storageService); this.editorFocus = WALK_THROUGH_FOCUS.bindTo(this.contextKeyService); @@ -190,8 +192,12 @@ export class WalkThroughPart extends EditorPane { return; } if (uri.scheme === 'command' && uri.path === 'workbench.action.files.newUntitledFile') { - this.openerService.open(this.addFrom(uri)) - .then(() => this.openerService.open(this.addFrom(URI.parse('command:workbench.action.editor.changeLanguageMode')))); + Promise.all([ + this.tasExperimentService?.getTreatment('newuntitledmode'), + this.openerService.open(this.addFrom(uri)), + ]).then(([newUntitledMode]) => { + return newUntitledMode && this.openerService.open(this.addFrom(URI.parse('command:workbench.action.editor.changeLanguageMode'))); + }); return; } this.openerService.open(this.addFrom(uri));