本文整理汇总了TypeScript中vs/editor/common/viewModel/viewModel.ViewLineRenderingData类的典型用法代码示例。如果您正苦于以下问题:TypeScript ViewLineRenderingData类的具体用法?TypeScript ViewLineRenderingData怎么用?TypeScript ViewLineRenderingData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ViewLineRenderingData类的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('');
}
示例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('');
}
示例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;
}