本文整理匯總了TypeScript中vs/editor/common/core/editOperation.EditOperation類的典型用法代碼示例。如果您正苦於以下問題:TypeScript EditOperation類的具體用法?TypeScript EditOperation怎麽用?TypeScript EditOperation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了EditOperation類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('decorations are updated when deleting multiple lines text', () => {
addDecoration(thisModel, 1, 2, 4, 1, 'myType');
modelHasDecoration(thisModel, 1, 2, 4, 1, 'myType');
thisModel.applyEdits([EditOperation.delete(new Range(1, 1, 3, 1))]);
modelHasDecoration(thisModel, 1, 1, 2, 1, 'myType');
});
示例2: test
test('model delete empty text', () => {
thisModel.applyEdits([EditOperation.delete(new Range(1, 1, 1, 1))]);
assert.equal(thisModel.getLineCount(), 5);
assert.equal(thisModel.getLineContent(1), 'My First Line');
});
示例3: assertEvent
return assertEvent(model.onDidSuggest, () => {
editor.executeEdits('test', [EditOperation.replace(new Range(1, 1, 1, 2), 'ä')]);
}, event => {
示例4: test
test('decorations are updated when inserting one line text before it 2', () => {
addDecoration(thisModel, 1, 1, 3, 2, 'myType');
modelHasDecoration(thisModel, 1, 1, 3, 2, 'myType');
thisModel.applyEdits([EditOperation.replace(new Range(1, 1, 1, 1), 'Hallo ')]);
modelHasDecoration(thisModel, 1, 1, 3, 2, 'myType');
});