change active-editor to ${activeEditorLanguage} (for #78903)

This commit is contained in:
Benjamin Pasero 2020-01-06 15:25:29 +01:00
parent 2c92f67ec5
commit c4192e9bd3
4 changed files with 7 additions and 7 deletions

View file

@ -36,8 +36,8 @@ export class SettingsDocument {
if (location.path[0] === 'files.defaultLanguage') {
return this.provideLanguageCompletionItems(location, range).then(items => {
// Add special item 'active-editor'
return [this.newSimpleCompletionItem(JSON.stringify('active-editor'), range, localize('activeEditor', "Use the language mode of the currently active text editor if any")), ...items];
// Add special item '${activeEditorLanguage}'
return [this.newSimpleCompletionItem(JSON.stringify('${activeEditorLanguage}'), range, localize('activeEditor', "Use the language of the currently active text editor if any")), ...items];
});
}

View file

@ -232,8 +232,8 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin
setMode(mode: string): void {
let actualMode: string | undefined = undefined;
if (mode === 'active-editor') {
// support the special 'active-editor' mode by
if (mode === '${activeEditorLanguage}') {
// support the special '${activeEditorLanguage}' mode by
// looking up the language mode from the currently
// active text editor if any
actualMode = this.editorService.activeTextEditorMode;

View file

@ -314,7 +314,7 @@ configurationRegistry.registerConfiguration({
'files.hotExit': hotExitConfiguration,
'files.defaultLanguage': {
'type': 'string',
'description': nls.localize('defaultLanguage', "The default language mode that is assigned to new files. If configured to `active-editor`, will use the language mode of the currently active text editor if any.")
'description': nls.localize('defaultLanguage', "The default language mode that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language mode of the currently active text editor if any.")
},
'files.maxMemoryForLargeFilesMB': {
'type': 'number',

View file

@ -236,9 +236,9 @@ suite('Workbench untitled text editors', () => {
input.dispose();
});
test('Untitled created with files.defaultLanguage setting (active-editor)', () => {
test('Untitled created with files.defaultLanguage setting (${activeEditorLanguage})', () => {
const config = accessor.testConfigurationService;
config.setUserConfiguration('files', { 'defaultLanguage': 'active-editor' });
config.setUserConfiguration('files', { 'defaultLanguage': '${activeEditorLanguage}' });
accessor.editorService.activeTextEditorMode = 'typescript';