本文整理汇总了TypeScript中vs/editor/common/model/model.Model.getLineDecorations方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Model.getLineDecorations方法的具体用法?TypeScript Model.getLineDecorations怎么用?TypeScript Model.getLineDecorations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/editor/common/model/model.Model
的用法示例。
在下文中一共展示了Model.getLineDecorations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('full line decoration', () => {
addDecoration(thisModel, 1, 1, 2, 1, 'myType');
var line1Decorations = thisModel.getLineDecorations(1);
assert.equal(line1Decorations.length, 1);
assert.equal(line1Decorations[0].options.className, 'myType');
var line2Decorations = thisModel.getLineDecorations(1);
assert.equal(line2Decorations.length, 1);
assert.equal(line2Decorations[0].options.className, 'myType');
lineHasNoDecorations(thisModel, 3);
lineHasNoDecorations(thisModel, 4);
lineHasNoDecorations(thisModel, 5);
});
示例2: lineHasDecorations
function lineHasDecorations(model: Model, lineNumber: number, decorations: { start: number; end: number; className: string; }[]) {
var lineDecorations = [];
var decs = model.getLineDecorations(lineNumber);
for (var i = 0, len = decs.length; i < len; i++) {
lineDecorations.push({
start: decs[i].range.startColumn,
end: decs[i].range.endColumn,
className: decs[i].options.className
});
}
assert.deepEqual(lineDecorations, decorations, 'Line decorations');
}