mirror of
https://github.com/Microsoft/vscode
synced 2024-09-20 19:18:03 +00:00
Open Language Mode picker for new file (fixes #110330)
This commit is contained in:
parent
cd6fa35fb9
commit
885e66edf9
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue