本文整理匯總了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);
}