src/vs/workbench/common/editor/textEditorModel.ts/BaseTextEditorModel/updateTextEditorModel
class BaseTextEditorModel:	updateTextEditorModel(newValue?: ITextBufferFactory, preferredLanguageId?: string): void {
		if (!this.isResolved()) {
			return;
		}

		// contents
		if (newValue) {
			this.modelService.updateModel(this.textEditorModel, newValue);
		}

		// language (only if specific and changed)
		if (preferredLanguageId && preferredLanguageId !== PLAINTEXT_LANGUAGE_ID && this.textEditorModel.getLanguageId() !== preferredLanguageId) {
			this.modelService.setMode(this.textEditorModel, this.languageService.createById(preferredLanguageId));
		}
	}