本文整理匯總了TypeScript中vs/editor/test/common/modesTestUtils.createLineContext函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript createLineContext函數的具體用法?TypeScript createLineContext怎麽用?TypeScript createLineContext使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了createLineContext函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: testElectricCharacter
function testElectricCharacter(line:string, offset:number, expected:Modes.IElectricAction): void {
let state = _mode.tokenizationSupport.getInitialState();
var lineTokens = _mode.tokenizationSupport.tokenize(line, state);
let actual = _mode.richEditSupport.electricCharacter.onElectricCharacter(createLineContext(line, lineTokens), offset);
assert.deepEqual(actual, expected, 'LINE <<<' + line + '>>>, OFFSET: <<<' + offset + '>>>');
}
示例2: onEnter
return function onEnter(line:string, offset:number, state?:modes.IState): modes.IEnterAction {
state = state || mode.tokenizationSupport.getInitialState();
var lineTokens = mode.tokenizationSupport.tokenize(line, state);
return mode.electricCharacterSupport.onEnter(createLineContext(line, lineTokens), offset);
};