Skip to content

Commit 921657d

Browse files
author
Benjamin Pasero
committed
untitled - ignore default language when associated path
1 parent d5501a7 commit 921657d

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/vs/workbench/services/untitled/common/untitledEditorService.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,12 @@ export class UntitledEditorService implements IUntitledEditorService {
188188
} while (Object.keys(UntitledEditorService.CACHE).indexOf(resource.toString()) >= 0);
189189
}
190190

191-
const configuration = this.configurationService.getConfiguration<IFilesConfiguration>();
192-
if (!modeId && configuration.files && configuration.files.defaultLanguage) {
193-
modeId = configuration.files.defaultLanguage;
191+
// Look up default language from settings if any
192+
if (!modeId && !hasAssociatedFilePath) {
193+
const configuration = this.configurationService.getConfiguration<IFilesConfiguration>();
194+
if (configuration.files && configuration.files.defaultLanguage) {
195+
modeId = configuration.files.defaultLanguage;
196+
}
194197
}
195198

196199
const input = this.instantiationService.createInstance(UntitledEditorInput, resource, hasAssociatedFilePath, modeId, initialValue);

0 commit comments

Comments
 (0)