當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。