mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
change active-editor to ${activeEditorLanguage} (for #78903)
This commit is contained in:
parent
2c92f67ec5
commit
c4192e9bd3
|
@ -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];
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
Loading…
Reference in a new issue