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


TypeScript Selection.createSelection方法代码示例

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


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

示例1: test

	test('Get selected changes test - one change partially seleceted with multiple selections', () => {
		var selections: Selection[] = [];
		selections.push(Selection.createSelection(2, 2, 5, 5),  Selection.createSelection(7, 2, 9, 1));
		var changes: IChange[] = [];
		changes.push(createChange(1, 15, 1, 10), createChange(120, 127, 122, 126));
		var result = getSelectedChanges(changes, selections);
		var expected: IChange[] = [];
		expected.push(createChange(2, 5, 1, 10), createChange(7, 9, 1, 10));
		changesEqual(result, expected);
	});
开发者ID:CPoirot3,项目名称:vscode,代码行数:10,代码来源:stageRanges.test.ts

示例2: computeCursorState

	public computeCursorState(model:editorCommon.ITokenizedModel, helper: editorCommon.ICursorStateComputerData): Selection {
		var inverseEditOperations = helper.getInverseEditOperations();
		var srcRange = inverseEditOperations[inverseEditOperations.length - 1].range;
		return Selection.createSelection(
			srcRange.endLineNumber,
			srcRange.endColumn,
			srcRange.endLineNumber,
			srcRange.endColumn
		);
	}
开发者ID:JackWangCUMT,项目名称:vscode,代码行数:10,代码来源:replaceAllCommand.ts

示例3: computeCursorState

	public computeCursorState(model:EditorCommon.ITokenizedModel, helper: EditorCommon.ICursorStateComputerData):EditorCommon.IEditorSelection {
		var inverseEditOperations = helper.getInverseEditOperations();
		var srcRange = inverseEditOperations[0].range;
		return Selection.createSelection(
			srcRange.endLineNumber,
			this.restoreCursorToColumn,
			srcRange.endLineNumber,
			this.restoreCursorToColumn
		);
	}
开发者ID:ErickWendel,项目名称:vscode,代码行数:10,代码来源:deleteLinesCommand.ts

示例4: computeCursorState

	public computeCursorState(model:editorCommon.ITokenizedModel, helper: editorCommon.ICursorStateComputerData):Selection {
		var inverseEditOperations = helper.getInverseEditOperations();
		var srcRange = inverseEditOperations[0].range;

		if (!this._originalSelection.isEmpty()) {
			// Preserve selection and extends to typed text
			return Selection.createSelection(
				srcRange.endLineNumber,
				srcRange.endColumn - this._text.length,
				srcRange.endLineNumber,
				srcRange.endColumn
			);
		}

		return Selection.createSelection(
			srcRange.endLineNumber,
			Math.min(this._originalSelection.positionColumn, srcRange.endColumn),
			srcRange.endLineNumber,
			Math.min(this._originalSelection.positionColumn, srcRange.endColumn)
		);
	}
开发者ID:CPoirot3,项目名称:vscode,代码行数:21,代码来源:inPlaceReplaceCommand.ts


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