editorTestUtils.ts 624 字节
Newer Older
E
Erich Gamma 已提交
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
'use strict';

A
Alex Dima 已提交
7
import {Model} from 'vs/editor/common/model/model';
E
Erich Gamma 已提交
8

A
Alex Dima 已提交
9
export function withEditorModel(text:string[], callback:(model:Model) => void): void {
10
	var model = new Model(text.join('\n'), Model.DEFAULT_CREATION_OPTIONS, null);
E
Erich Gamma 已提交
11 12 13
	callback(model);
	model.dispose();
}