mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
update text file editor model when file associations change
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user