當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Range.lift方法代碼示例

本文整理匯總了TypeScript中vs/editor/common/core/range.Range.lift方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Range.lift方法的具體用法?TypeScript Range.lift怎麽用?TypeScript Range.lift使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vs/editor/common/core/range.Range的用法示例。


在下文中一共展示了Range.lift方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getEditOperations

	public getEditOperations(model: editorCommon.ITokenizedModel, builder: editorCommon.IEditOperationBuilder): void {

		for (let edit of this._edits) {
			// We know that this edit.range comes from the mirror model, so it should only contain \n and no \r's
			let trimEdit = EditOperationsCommand.trimEdit(edit, model);
			if (trimEdit !== null) { // produced above in case the edit.text is identical to the existing text
				builder.addEditOperation(Range.lift(edit.range), edit.text);
			}
		}

		var selectionIsSet = false;
		if (Array.isArray(this._edits) && this._edits.length === 1 && this._initialSelection.isEmpty()) {
			if (this._edits[0].range.startColumn === this._initialSelection.endColumn &&
				this._edits[0].range.startLineNumber === this._initialSelection.endLineNumber) {
				selectionIsSet = true;
				this._selectionId = builder.trackSelection(this._initialSelection, true);
			} else if (this._edits[0].range.endColumn === this._initialSelection.startColumn &&
				this._edits[0].range.endLineNumber === this._initialSelection.startLineNumber) {
				selectionIsSet = true;
				this._selectionId = builder.trackSelection(this._initialSelection, false);
			}
		}

		if (!selectionIsSet) {
			this._selectionId = builder.trackSelection(this._initialSelection);
		}
	}
開發者ID:AlexxNica,項目名稱:sqlopsstudio,代碼行數:27,代碼來源:formatCommand.ts

示例2:

		let transformedEdits = edits.map((edit): IIdentifiedSingleEditOperation => {
			return {
				range: Range.lift(edit.range),
				text: edit.text,
				forceMoveMarkers: edit.forceMoveMarkers
			};
		});
開發者ID:developers23,項目名稱:vscode,代碼行數:7,代碼來源:mainThreadEditor.ts

示例3:

		model.pushEditOperations([initialSelection], edits.map(edit => {
			return {
				text: edit.text,
				range: Range.lift(edit.range),
				forceMoveMarkers: true
			};
		}), undoEdits => {
開發者ID:joelday,項目名稱:vscode,代碼行數:7,代碼來源:format.ts

示例4:

		model.pushEditOperations([], operations.map(o => {
			return {
				range: Range.lift(o.range),
				text: o.text,
				identifier: null,
				forceMoveMarkers: false
			};
		}), () => []);
開發者ID:13572293130,項目名稱:vscode,代碼行數:8,代碼來源:formatter.test.ts

示例5: delete

	public static delete(range:IRange): IIdentifiedSingleEditOperation {
		return {
			identifier: null,
			range: Range.lift(range),
			text: null,
			forceMoveMarkers: true
		};
	}
開發者ID:GYGit,項目名稱:vscode,代碼行數:8,代碼來源:editOperation.ts

示例6: replaceMove

	public static replaceMove(range:IRange, text:string): IIdentifiedSingleEditOperation {
		return {
			identifier: null,
			range: Range.lift(range),
			text: text,
			forceMoveMarkers: true
		};
	}
開發者ID:GYGit,項目名稱:vscode,代碼行數:8,代碼來源:editOperation.ts

示例7: function

CommonEditorRegistry.registerLanguageCommand('_executeFormatRangeProvider', function (accessor, args) {
	const { resource, range, options } = args;
	if (!(resource instanceof URI) || !Range.isIRange(range)) {
		throw illegalArgument();
	}
	const model = accessor.get(IModelService).getModel(resource);
	if (!model) {
		throw illegalArgument('resource');
	}
	return getDocumentRangeFormattingEdits(model, Range.lift(range), options);
});
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:11,代碼來源:format.ts

示例8: function

CommonEditorRegistry.registerLanguageCommand('_executeCodeActionProvider', function(accessor, args) {

	const {resource, range} = args;
	if (!(resource instanceof URI) || !Range.isIRange(range)) {
		throw illegalArgument();
	}

	const model = accessor.get(IModelService).getModel(resource);
	if (!model) {
		throw illegalArgument();
	}

	const editorRange = Range.lift(range);

	return getCodeActions(model, editorRange);
});
開發者ID:CPoirot3,項目名稱:vscode,代碼行數:16,代碼來源:quickFix.ts

示例9: computeFixes

	private computeFixes(range: IMarker | IRange): TPromise<IQuickFix2[]> {
		let model = this.editor.getModel();
		if (!CodeActionProviderRegistry.has(model)) {
			return TPromise.as(null);
		}

		if (this.quickFixRequestPromise && range === this.quickFixRequestPromiseRange) {
			return this.quickFixRequestPromise;
		}

		if (this.quickFixRequestPromise) {
			this.quickFixRequestPromise.cancel();
			this.quickFixRequestPromise = null;
		}

		this.quickFixRequestPromiseRange = range;
		this.quickFixRequestPromise = getCodeActions(model, Range.lift(range));
		return this.quickFixRequestPromise;
	}
開發者ID:1Hgm,項目名稱:vscode,代碼行數:19,代碼來源:quickFixModel.ts

示例10: symbolEntry

	private symbolEntry(name: string, type: string, description: string | undefined, range: IRange, highlights: IHighlight[], editor: ICodeEditor, decorator: IDecorator): SymbolEntry {
		return new SymbolEntry(name, type, description, Range.lift(range), highlights, editor, decorator);
	}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:3,代碼來源:quickOutline.ts


注:本文中的vs/editor/common/core/range.Range.lift方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。