當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript viewLineParts.createLineParts函數代碼示例

本文整理匯總了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, ''),
		]);
	});
開發者ID:fs814,項目名稱:vscode,代碼行數:30,代碼來源:viewLineParts.test.ts

示例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);
	}
開發者ID:asotog,項目名稱:vscode,代碼行數:6,代碼來源:viewLineParts.test.ts

示例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);
	}
開發者ID:Froussios,項目名稱:vscode,代碼行數:6,代碼來源:viewLineParts.test.ts


注:本文中的vs/editor/common/viewLayout/viewLineParts.createLineParts函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。