Skip to content

Commit

Permalink
Fixes #114146: Increase max BracketSelectionRangeProvider duration to…
Browse files Browse the repository at this point in the history
… 5s in unit tests
  • Loading branch information
alexdima authored and lszomoru committed Jan 15, 2021
1 parent 8f72ab2 commit 17723c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/smartSelect/bracketSelections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class BracketSelectionRangeProvider implements SelectionRangeProvider {
return result;
}

private static readonly _maxDuration = 30;
public static _maxDuration = 30;
private static readonly _maxRounds = 2;

private static _bracketsRightYield(resolve: () => void, round: number, model: ITextModel, pos: Position, ranges: Map<string, LinkedList<Range>>): void {
Expand Down
10 changes: 10 additions & 0 deletions src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ class MockJSMode extends MockMode {

suite('SmartSelect', () => {

const OriginalBracketSelectionRangeProviderMaxDuration = BracketSelectionRangeProvider._maxDuration;

suiteSetup(() => {
BracketSelectionRangeProvider._maxDuration = 5000; // 5 seconds
});

suiteTeardown(() => {
BracketSelectionRangeProvider._maxDuration = OriginalBracketSelectionRangeProviderMaxDuration;
});

let modelService: ModelServiceImpl;
let mode: MockJSMode;

Expand Down

0 comments on commit 17723c4

Please sign in to comment.