提交 6931d008 编写于 作者: B Benjamin Pasero

always register text mime with mimetype

上级 8b79e482
...@@ -114,7 +114,7 @@ export class LanguagesRegistry { ...@@ -114,7 +114,7 @@ export class LanguagesRegistry {
} }
if (!primaryMime) { if (!primaryMime) {
primaryMime = 'text/x-' + lang.id; primaryMime = `text/x-${lang.id}`;
this.mime2LanguageId[primaryMime] = lang.id; this.mime2LanguageId[primaryMime] = lang.id;
} }
......
...@@ -545,7 +545,10 @@ export class MainThreadModeServiceImpl extends ModeServiceImpl { ...@@ -545,7 +545,10 @@ export class MainThreadModeServiceImpl extends ModeServiceImpl {
// Register based on settings // Register based on settings
if (configuration.files && configuration.files.associations) { if (configuration.files && configuration.files.associations) {
Object.keys(configuration.files.associations).forEach(pattern => { Object.keys(configuration.files.associations).forEach(pattern => {
mime.registerTextMime({ mime: this.getMimeForMode(configuration.files.associations[pattern]), filepattern: pattern, userConfigured: true }); const langId = configuration.files.associations[pattern];
const mimetype = this.getMimeForMode(langId) || `text/x-${langId}`;
mime.registerTextMime({ mime: mimetype, filepattern: pattern, userConfigured: true });
}); });
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册