本文整理匯總了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('');
}
示例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;
}