本文整理匯總了TypeScript中vs/editor/common/modes/supports.isLineToken函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript isLineToken函數的具體用法?TypeScript isLineToken怎麽用?TypeScript isLineToken使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了isLineToken函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: handleEvent
return handleEvent(context, offset, (nestedMode:IMode, context:ILineContext, offset:number) => {
if (this._modeId === nestedMode.getId()) {
return (!Array.isArray(this.contribution.tokens) ||
this.contribution.tokens.length < 1 ||
isLineToken(context, offset, this.contribution.tokens));
} else if (nestedMode.declarationSupport) {
return nestedMode.declarationSupport.canFindDeclaration(context, offset);
} else {
return false;
}
});
示例2: handleEvent
return handleEvent(context, offset, (nestedMode:IMode, context:ILineContext, offset:number) => {
if (this._modeId === nestedMode.getId()) {
if (!Array.isArray(this.contribution.excludeTokens)) {
return true;
}
if (this.contribution.excludeTokens.length === 1 && this.contribution.excludeTokens[0] === '*') {
return false;
}
return !isLineToken(context, offset-1, this.contribution.excludeTokens);
} else if (nestedMode.parameterHintsSupport) {
return nestedMode.parameterHintsSupport.shouldTriggerParameterHints(context, offset);
} else {
return false;
}
});
示例3: handleEvent
return handleEvent(context, offset, (nestedMode:IMode, context:ILineContext, offset:number) => {
if (this._modeId === nestedMode.getId()) {
if (this.contribution.disableAutoTrigger) {
return false;
}
if (!Array.isArray(this.contribution.excludeTokens)) {
return true;
}
if (this.contribution.excludeTokens.length === 1 && this.contribution.excludeTokens[0] === '*') {
return false;
}
return !isLineToken(context, offset-1, this.contribution.excludeTokens, true);
} else if (nestedMode.suggestSupport) {
return nestedMode.suggestSupport.shouldAutotriggerSuggest(context, offset, triggeredByCharacter);
} else {
return false;
}
});