当前位置: 首页>>代码示例>>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;未经允许,请勿转载。