当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Model.getLineContent方法代码示例

本文整理汇总了TypeScript中vs/editor/common/model/model.Model.getLineContent方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Model.getLineContent方法的具体用法?TypeScript Model.getLineContent怎么用?TypeScript Model.getLineContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/editor/common/model/model.Model的用法示例。


在下文中一共展示了Model.getLineContent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: test

	test('model insert text with two newlines', () => {
		thisModel.applyEdits([EditOperation.insert(new Position(1, 3), ' new line\nOne more line in the middle\nNo longer')]);
		assert.equal(thisModel.getLineCount(), 7);
		assert.equal(thisModel.getLineContent(1), 'My new line');
		assert.equal(thisModel.getLineContent(2), 'One more line in the middle');
		assert.equal(thisModel.getLineContent(3), 'No longer First Line');
	});
开发者ID:Chan-PH,项目名称:vscode,代码行数:7,代码来源:model.test.ts

示例2: test

	test('delete word right for non-empty selection', () => {
		moveTo(thisCursor, 3, 7);
		moveRight(thisCursor, true);
		moveRight(thisCursor, true);
		deleteWordRight(thisCursor);
		assert.equal(thisModel.getLineContent(3), '    Thd Line💩');
		cursorEqual(thisCursor, 3, 7);
	});
开发者ID:amamut,项目名称:vscode,代码行数:8,代码来源:cursor.test.ts

示例3: test

	test('snippets, typing at beginning', function () {

		editor.setSelection(new Selection(1, 2, 1, 2));
		const session = new SnippetSession(editor, 'farboo$0');
		session.insert();

		editor.setSelection(new Selection(1, 2, 1, 2));
		assert.equal(session.isSelectionWithinPlaceholders(), false);
		assert.equal(session.isAtLastPlaceholder, true);

		editor.trigger('test', 'type', { text: 'XXX' });
		assert.equal(model.getLineContent(1), 'fXXXfarboounction foo() {');
		assert.equal(session.isSelectionWithinPlaceholders(), false);

		session.next();
		assertSelections(editor, new Selection(1, 11, 1, 11));
	});
开发者ID:FabianLauer,项目名称:vscode,代码行数:17,代码来源:snippetSession.test.ts

示例4: assertSingleEditOp

	function assertSingleEditOp(singleEditOp:IIdentifiedSingleEditOperation, editedLines:string[]) {
		var editOp = [singleEditOp];

		var inverseEditOp = model.applyEdits(editOp);

		assert.equal(model.getLineCount(), editedLines.length);
		for (var i = 0; i < editedLines.length; i++) {
			assert.equal(model.getLineContent(i + 1), editedLines[i]);
		}

		var originalOp = model.applyEdits(inverseEditOp);

		assert.equal(model.getLineCount(), 5);
		assert.equal(model.getLineContent(1), LINE1);
		assert.equal(model.getLineContent(2), LINE2);
		assert.equal(model.getLineContent(3), LINE3);
		assert.equal(model.getLineContent(4), LINE4);
		assert.equal(model.getLineContent(5), LINE5);

		assert.deepEqual(originalOp, editOp);
	}
开发者ID:BMGburger,项目名称:vscode,代码行数:21,代码来源:modelEditOperation.test.ts


注:本文中的vs/editor/common/model/model.Model.getLineContent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。