提交 885e66ed 编写于 作者: C Christof Marti

Open Language Mode picker for new file (fixes #110330)

上级 cd6fa35f
......@@ -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<boolean>('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<boolean>('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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册