当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ViewLineRenderingData.isBasicASCII方法代码示例

本文整理汇总了TypeScript中vs/editor/common/viewModel/viewModel.ViewLineRenderingData.isBasicASCII方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ViewLineRenderingData.isBasicASCII方法的具体用法?TypeScript ViewLineRenderingData.isBasicASCII怎么用?TypeScript ViewLineRenderingData.isBasicASCII使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/editor/common/viewModel/viewModel.ViewLineRenderingData的用法示例。


在下文中一共展示了ViewLineRenderingData.isBasicASCII方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: _actualColorize

function _actualColorize(lines: string[], tabSize: number, tokenizationSupport: ITokenizationSupport): string {
	let html: string[] = [];
	let state = tokenizationSupport.getInitialState();

	for (let i = 0, length = lines.length; i < length; i++) {
		let line = lines[i];
		let tokenizeResult = tokenizationSupport.tokenize2(line, state, 0);
		LineTokens.convertToEndOffset(tokenizeResult.tokens, line.length);
		let lineTokens = new LineTokens(tokenizeResult.tokens, line);
		const isBasicASCII = ViewLineRenderingData.isBasicASCII(line, /* check for basic ASCII */true);
		const containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, /* check for RTL */true);
		let renderResult = renderViewLine(new RenderLineInput(
			false,
			line,
			isBasicASCII,
			containsRTL,
			0,
			lineTokens.inflate(),
			[],
			tabSize,
			0,
			-1,
			'none',
			false,
			false
		));

		html = html.concat(renderResult.html);
		html.push('<br/>');

		state = tokenizeResult.endState;
	}

	return html.join('');
}
开发者ID:costincaraivan,项目名称:vscode,代码行数:35,代码来源:colorizer.ts

示例2: _fakeColorize

function _fakeColorize(lines: string[], tabSize: number): string {
	let html: string[] = [];

	const defaultMetadata = (
		(FontStyle.None << MetadataConsts.FONT_STYLE_OFFSET)
		| (ColorId.DefaultForeground << MetadataConsts.FOREGROUND_OFFSET)
		| (ColorId.DefaultBackground << MetadataConsts.BACKGROUND_OFFSET)
	) >>> 0;

	const tokens = new Uint32Array(2);
	tokens[0] = 0;
	tokens[1] = defaultMetadata;

	for (let i = 0, length = lines.length; i < length; i++) {
		let line = lines[i];

		tokens[0] = line.length;
		const lineTokens = new LineTokens(tokens, line);

		const isBasicASCII = ViewLineRenderingData.isBasicASCII(line, /* check for basic ASCII */true);
		const containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, /* check for RTL */true);
		let renderResult = renderViewLine(new RenderLineInput(
			false,
			true,
			line,
			false,
			isBasicASCII,
			containsRTL,
			0,
			lineTokens,
			[],
			tabSize,
			0,
			-1,
			'none',
			false,
			false
		));

		html = html.concat(renderResult.html);
		html.push('<br/>');
	}

	return html.join('');
}
开发者ID:developers23,项目名称:vscode,代码行数:45,代码来源:colorizer.ts

示例3: colorizeLine

	public static colorizeLine(line: string, mightContainNonBasicASCII: boolean, mightContainRTL: boolean, tokens: IViewLineTokens, tabSize: number = 4): string {
		const isBasicASCII = ViewLineRenderingData.isBasicASCII(line, mightContainNonBasicASCII);
		const containsRTL = ViewLineRenderingData.containsRTL(line, isBasicASCII, mightContainRTL);
		let renderResult = renderViewLine(new RenderLineInput(
			false,
			line,
			isBasicASCII,
			containsRTL,
			0,
			tokens,
			[],
			tabSize,
			0,
			-1,
			'none',
			false,
			false
		));
		return renderResult.html;
	}
开发者ID:costincaraivan,项目名称:vscode,代码行数:20,代码来源:colorizer.ts


注:本文中的vs/editor/common/viewModel/viewModel.ViewLineRenderingData.isBasicASCII方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。