Skip to content

Commit e954d50

Browse files
authored
1 parent e1338bd commit e954d50

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/services/textMate/browser/worker/textMateWorkerModel.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6+
import { importAMDNodeModule } from 'vs/amdX';
67
import { RunOnceScheduler } from 'vs/base/common/async';
78
import { observableValue } from 'vs/base/common/observable';
9+
import { setTimeout0 } from 'vs/base/common/platform';
810
import { URI } from 'vs/base/common/uri';
911
import { LineRange } from 'vs/editor/common/core/lineRange';
1012
import { LanguageId } from 'vs/editor/common/encodedTokenAttributes';
1113
import { IModelChangedEvent, MirrorTextModel } from 'vs/editor/common/model/mirrorTextModel';
1214
import { TokenizerWithStateStore } from 'vs/editor/common/model/textModelTokens';
13-
import type { diffStateStacksRefEq, StateStack, StackDiff } from 'vscode-textmate';
1415
import { ContiguousMultilineTokensBuilder } from 'vs/editor/common/tokens/contiguousMultilineTokensBuilder';
1516
import { LineTokens } from 'vs/editor/common/tokens/lineTokens';
1617
import { TextMateTokenizationSupport } from 'vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport';
1718
import { TokenizationSupportWithLineLimit } from 'vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit';
1819
import { StateDeltas } from 'vs/workbench/services/textMate/browser/workerHost/textMateWorkerHost';
20+
import type { StackDiff, StateStack, diffStateStacksRefEq } from 'vscode-textmate';
1921
import { TextMateTokenizationWorker } from './textMate.worker';
20-
import { importAMDNodeModule } from 'vs/amdX';
2122

2223
export class TextMateWorkerModel extends MirrorTextModel {
2324
private _tokenizationStateStore: TokenizerWithStateStore<StateStack> | null = null;
@@ -169,7 +170,7 @@ export class TextMateWorkerModel extends MirrorTextModel {
169170
const deltaMs = new Date().getTime() - startTime;
170171
if (deltaMs > 20) {
171172
// yield to check for changes
172-
setTimeout(() => this._tokenize(), 3);
173+
setTimeout0(() => this._tokenize());
173174
return;
174175
}
175176
}

0 commit comments

Comments
 (0)