src/vs/workbench/common/editor/textEditorModel.ts/BaseTextEditorModel/doCreateTextEditorModel
class BaseTextEditorModel:	private doCreateTextEditorModel(value: ITextBufferFactory, languageSelection: ILanguageSelection, resource: URI | undefined): ITextModel {
		let model = resource && this.modelService.getModel(resource);
		if (!model) {
			model = this.modelService.createModel(value, languageSelection, resource);
			this.createdEditorModel = true;

			// Make sure we clean up when this model gets disposed
			this.registerModelDisposeListener(model);
		} else {
			this.updateTextEditorModel(value, languageSelection.languageIdentifier.language);
		}

		this.textEditorModelHandle = model.uri;

		return model;
	}