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