Skip to content

Commit c4192e9

Browse files
author
Benjamin Pasero
committed
change active-editor to ${activeEditorLanguage} (for microsoft#78903)
1 parent 2c92f67 commit c4192e9

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

extensions/configuration-editing/src/settingsDocumentHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class SettingsDocument {
3636
if (location.path[0] === 'files.defaultLanguage') {
3737
return this.provideLanguageCompletionItems(location, range).then(items => {
3838

39-
// Add special item 'active-editor'
40-
return [this.newSimpleCompletionItem(JSON.stringify('active-editor'), range, localize('activeEditor', "Use the language mode of the currently active text editor if any")), ...items];
39+
// Add special item '${activeEditorLanguage}'
40+
return [this.newSimpleCompletionItem(JSON.stringify('${activeEditorLanguage}'), range, localize('activeEditor', "Use the language of the currently active text editor if any")), ...items];
4141
});
4242
}
4343

src/vs/workbench/common/editor/untitledTextEditorInput.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ export class UntitledTextEditorInput extends TextEditorInput implements IEncodin
232232

233233
setMode(mode: string): void {
234234
let actualMode: string | undefined = undefined;
235-
if (mode === 'active-editor') {
236-
// support the special 'active-editor' mode by
235+
if (mode === '${activeEditorLanguage}') {
236+
// support the special '${activeEditorLanguage}' mode by
237237
// looking up the language mode from the currently
238238
// active text editor if any
239239
actualMode = this.editorService.activeTextEditorMode;

src/vs/workbench/contrib/files/browser/files.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ configurationRegistry.registerConfiguration({
314314
'files.hotExit': hotExitConfiguration,
315315
'files.defaultLanguage': {
316316
'type': 'string',
317-
'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.")
317+
'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.")
318318
},
319319
'files.maxMemoryForLargeFilesMB': {
320320
'type': 'number',

src/vs/workbench/test/common/editor/untitledTextEditor.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ suite('Workbench untitled text editors', () => {
236236
input.dispose();
237237
});
238238

239-
test('Untitled created with files.defaultLanguage setting (active-editor)', () => {
239+
test('Untitled created with files.defaultLanguage setting (${activeEditorLanguage})', () => {
240240
const config = accessor.testConfigurationService;
241-
config.setUserConfiguration('files', { 'defaultLanguage': 'active-editor' });
241+
config.setUserConfiguration('files', { 'defaultLanguage': '${activeEditorLanguage}' });
242242

243243
accessor.editorService.activeTextEditorMode = 'typescript';
244244

0 commit comments

Comments
 (0)