本文整理汇总了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);
}
}
示例2:
let transformedEdits = edits.map((edit): IIdentifiedSingleEditOperation => {
return {
range: Range.lift(edit.range),
text: edit.text,
forceMoveMarkers: edit.forceMoveMarkers
};
});
示例3:
model.pushEditOperations([initialSelection], edits.map(edit => {
return {
text: edit.text,
range: Range.lift(edit.range),
forceMoveMarkers: true
};
}), undoEdits => {
示例4:
model.pushEditOperations([], operations.map(o => {
return {
range: Range.lift(o.range),
text: o.text,
identifier: null,
forceMoveMarkers: false
};
}), () => []);
示例5: delete
public static delete(range:IRange): IIdentifiedSingleEditOperation {
return {
identifier: null,
range: Range.lift(range),
text: null,
forceMoveMarkers: true
};
}
示例6: replaceMove
public static replaceMove(range:IRange, text:string): IIdentifiedSingleEditOperation {
return {
identifier: null,
range: Range.lift(range),
text: text,
forceMoveMarkers: true
};
}
示例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);
});
示例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);
});
示例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;
}
示例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);
}