本文整理汇总了TypeScript中vs/editor/common/modes.TokenMetadata类的典型用法代码示例。如果您正苦于以下问题:TypeScript TokenMetadata类的具体用法?TypeScript TokenMetadata怎么用?TypeScript TokenMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TokenMetadata类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _setTokens
_setTokens(topLevelLanguageId: LanguageId, lineIndex: number, lineTextLength: number, tokens: Uint32Array): void {
let target: ModelLineTokens;
if (lineIndex < this._tokens.length && this._tokens[lineIndex]) {
target = this._tokens[lineIndex];
} else {
target = new ModelLineTokens(null);
this._tokens[lineIndex] = target;
}
if (lineTextLength === 0) {
let hasDifferentLanguageId = false;
if (tokens && tokens.length > 1) {
hasDifferentLanguageId = (TokenMetadata.getLanguageId(tokens[1]) !== topLevelLanguageId);
}
if (!hasDifferentLanguageId) {
target._lineTokens = EMPTY_LINE_TOKENS;
return;
}
}
if (!tokens || tokens.length === 0) {
tokens = new Uint32Array(2);
tokens[0] = 0;
tokens[1] = getDefaultMetadata(topLevelLanguageId);
}
LineTokens.convertToEndOffset(tokens, lineTextLength);
target._lineTokens = tokens.buffer;
}
示例2: getInlineStyle
public getInlineStyle(tokenIndex: number, colorMap: string[]): string {
const metadata = this._tokens[(tokenIndex << 1) + 1];
return TokenMetadata.getInlineStyleFromMetadata(metadata, colorMap);
}
示例3: getClassName
public getClassName(tokenIndex: number): string {
const metadata = this._tokens[(tokenIndex << 1) + 1];
return TokenMetadata.getClassNameFromMetadata(metadata);
}
示例4: getForeground
public getForeground(tokenIndex: number): ColorId {
const metadata = this._tokens[(tokenIndex << 1) + 1];
return TokenMetadata.getForeground(metadata);
}
示例5: getStandardTokenType
public getStandardTokenType(tokenIndex: number): StandardTokenType {
const metadata = this._tokens[(tokenIndex << 1) + 1];
return TokenMetadata.getTokenType(metadata);
}
示例6: getLanguageId
public getLanguageId(tokenIndex: number): LanguageId {
const metadata = this._tokens[(tokenIndex << 1) + 1];
return TokenMetadata.getLanguageId(metadata);
}
示例7: getInlineStyle
public getInlineStyle(colorMap: string[]): string {
return TokenMetadata.getInlineStyleFromMetadata(this._metadata, colorMap);
}
示例8: getType
public getType(): string {
return TokenMetadata.getClassNameFromMetadata(this._metadata);
}
示例9: getForeground
public getForeground(): ColorId {
return TokenMetadata.getForeground(this._metadata);
}