本文整理汇总了TypeScript中vs/editor/common/model/tokensBinaryEncoding.TokenMetadata类的典型用法代码示例。如果您正苦于以下问题:TypeScript TokenMetadata类的具体用法?TypeScript TokenMetadata怎么用?TypeScript TokenMetadata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TokenMetadata类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: backgroundId
public get backgroundId(): ColorId {
return TokenMetadata.getBackground(this._metadata);
}
示例2: fontStyle
public get fontStyle(): FontStyle {
return TokenMetadata.getFontStyle(this._metadata);
}
示例3: foregroundId
public get foregroundId(): ColorId {
return TokenMetadata.getForeground(this._metadata);
}
示例4: languageId
public get languageId(): LanguageId {
return TokenMetadata.getLanguageId(this._metadata);
}
示例5: tokenType
public get tokenType(): StandardTokenType {
return TokenMetadata.getTokenType(this._metadata);
}
示例6: inflate
public inflate(): ViewLineToken[] {
return TokenMetadata.inflateArr(this._tokens, this._textLength);
}
示例7: sliceAndInflate
public sliceAndInflate(startOffset: number, endOffset: number, deltaOffset: number): ViewLineToken[] {
return TokenMetadata.sliceAndInflate(this._tokens, startOffset, endOffset, deltaOffset, this._textLength);
}
示例8: getStandardTokenType
public getStandardTokenType(tokenIndex: number): StandardTokenType {
let metadata = this._tokens[(tokenIndex << 1) + 1];
return TokenMetadata.getTokenType(metadata);
}
示例9: findTokenIndexAtOffset
/**
* Find the token containing offset `offset`.
* ```
* For example, with the following tokens [0, 5), [5, 9), [9, infinity)
* Searching for 0, 1, 2, 3 or 4 will return 0.
* Searching for 5, 6, 7 or 8 will return 1.
* Searching for 9, 10, 11, ... will return 2.
* ```
* @param offset The search offset
* @return The index of the token containing the offset.
*/
public findTokenIndexAtOffset(offset: number): number {
return TokenMetadata.findIndexInSegmentsArray(this._tokens, offset);
}
示例10: getLanguageId
public getLanguageId(tokenIndex: number): LanguageId {
let metadata = this._tokens[(tokenIndex << 1) + 1];
return TokenMetadata.getLanguageId(metadata);
}