本文整理汇总了TypeScript中vs/editor/common/viewLayout/viewLineParts.createLineParts函数的典型用法代码示例。如果您正苦于以下问题:TypeScript createLineParts函数的具体用法?TypeScript createLineParts怎么用?TypeScript createLineParts使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createLineParts函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('createLineParts can handle unsorted inline decorations', () => {
let lineParts = createLineParts(
1,
1,
'Hello world',
4,
new ViewLineTokens([new ViewLineToken(0, '')], 0, 'Hello world'.length),
[
new InlineDecoration(new Range(1, 5, 1, 7), 'a'),
new InlineDecoration(new Range(1, 1, 1, 3), 'b'),
new InlineDecoration(new Range(1, 2, 1, 8), 'c'),
],
'none'
);
// 01234567890
// Hello world
// ----aa-----
// bb---------
// -cccccc----
assert.deepEqual(lineParts.parts, [
new ViewLineToken(0, ' b'),
new ViewLineToken(1, ' b c'),
new ViewLineToken(2, ' c'),
new ViewLineToken(4, ' a c'),
new ViewLineToken(6, ' c'),
new ViewLineToken(7, ''),
]);
});
示例2: testCreateLineParts
function testCreateLineParts(lineContent: string, tokens: ViewLineToken[], fauxIndentLength: number, renderWhitespace: 'none' | 'boundary' | 'all', expected: ViewLineToken[]): void {
let lineParts = createLineParts(1, 1, lineContent, 4, new ViewLineTokens(tokens, fauxIndentLength, lineContent.length), [], renderWhitespace);
let actual = lineParts.getParts();
assert.deepEqual(actual, expected);
}
示例3: testCreateLineParts
function testCreateLineParts(lineContent: string, tokens: ViewLineToken[], fauxIndentLength: number, renderWhitespace:boolean, indentGuides:number, expected:ViewLineToken[]): void {
let lineParts = createLineParts(1, 1, lineContent, 4, new ViewLineTokens(tokens, fauxIndentLength, lineContent.length), [], renderWhitespace, indentGuides);
let actual = lineParts.getParts();
assert.deepEqual(actual, expected);
}