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


TypeScript TextModel.getLineDecorations方法代碼示例

本文整理匯總了TypeScript中vs/editor/common/model/textModel.TextModel.getLineDecorations方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript TextModel.getLineDecorations方法的具體用法?TypeScript TextModel.getLineDecorations怎麽用?TypeScript TextModel.getLineDecorations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vs/editor/common/model/textModel.TextModel的用法示例。


在下文中一共展示了TextModel.getLineDecorations方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: test

	test('full line decoration', () => {
		addDecoration(thisModel, 1, 1, 2, 1, 'myType');

		let line1Decorations = thisModel.getLineDecorations(1);
		assert.equal(line1Decorations.length, 1);
		assert.equal(line1Decorations[0].options.className, 'myType');

		let 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);
	});
開發者ID:AllureFer,項目名稱:vscode,代碼行數:15,代碼來源:modelDecorations.test.ts

示例2: test

	test('multiple line decoration', () => {
		addDecoration(thisModel, 1, 2, 3, 2, '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');

		var line3Decorations = thisModel.getLineDecorations(1);
		assert.equal(line3Decorations.length, 1);
		assert.equal(line3Decorations[0].options.className, 'myType');

		lineHasNoDecorations(thisModel, 4);
		lineHasNoDecorations(thisModel, 5);
	});
開發者ID:jumpinjackie,項目名稱:sqlopsstudio,代碼行數:18,代碼來源:modelDecorations.test.ts

示例3: lineHasDecorations

function lineHasDecorations(model: TextModel, lineNumber: number, decorations: { start: number; end: number; className: string; }[]) {
	let lineDecorations = [];
	let decs = model.getLineDecorations(lineNumber);
	for (let 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');
}
開發者ID:AllureFer,項目名稱:vscode,代碼行數:12,代碼來源:modelDecorations.test.ts


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