本文整理匯總了TypeScript中vs/editor/common/model/model.Model.matchBracket方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Model.matchBracket方法的具體用法?TypeScript Model.matchBracket怎麽用?TypeScript Model.matchBracket使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/editor/common/model/model.Model
的用法示例。
在下文中一共展示了Model.matchBracket方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: isBracket
function isBracket(model:Model, lineNumber1:number, column11:number, column12:number, lineNumber2:number, column21:number, column22:number) {
let match = model.matchBracket(new Position(lineNumber1, column11));
assert.deepEqual(match, [
new Range(lineNumber1, column11, lineNumber1, column12),
new Range(lineNumber2, column21, lineNumber2, column22)
], 'is matching brackets at ' + lineNumber1 + ', ' + column11);
}
示例2: isBracket2
function isBracket2(model: Model, testPosition: Position, expected: [Range, Range]): void {
let actual = model.matchBracket(testPosition);
assert.deepEqual(actual, expected, 'matches brackets at ' + testPosition);
}
示例3: isNotABracket
function isNotABracket(model: Model, lineNumber: number, column: number) {
let match = model.matchBracket(new Position(lineNumber, column));
assert.equal(match, null, 'is not matching brackets at ' + lineNumber + ', ' + column);
}