update text file editor model when file associations change

This commit is contained in:
Benjamin Pasero
2016-09-15 15:51:56 +02:00
parent 670f83c359
commit ba777300c9
4 changed files with 47 additions and 7 deletions

View File

@@ -153,6 +153,20 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd
this.textEditorModel.setValueFromRawText(rawText);
}
/**
* Updates the text editor model mode based on the settings and configuration.
*/
protected updateTextEditorModelMode(mime?: string): void {
if (!this.textEditorModel) {
return;
}
const firstLineText = this.getFirstLineText(this.textEditorModel.getValue());
const mode = this.getOrCreateMode(this.modeService, mime, firstLineText);
this.textEditorModel.setMode(mode);
}
/**
* Returns the textual value of this editor model or null if it has not yet been created.
*/