|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information.
|
4 | 4 | *--------------------------------------------------------------------------------------------*/
|
5 | 5 |
|
| 6 | +import { importAMDNodeModule } from 'vs/amdX'; |
6 | 7 | import { RunOnceScheduler } from 'vs/base/common/async';
|
7 | 8 | import { observableValue } from 'vs/base/common/observable';
|
| 9 | +import { setTimeout0 } from 'vs/base/common/platform'; |
8 | 10 | import { URI } from 'vs/base/common/uri';
|
9 | 11 | import { LineRange } from 'vs/editor/common/core/lineRange';
|
10 | 12 | import { LanguageId } from 'vs/editor/common/encodedTokenAttributes';
|
11 | 13 | import { IModelChangedEvent, MirrorTextModel } from 'vs/editor/common/model/mirrorTextModel';
|
12 | 14 | import { TokenizerWithStateStore } from 'vs/editor/common/model/textModelTokens';
|
13 |
| -import type { diffStateStacksRefEq, StateStack, StackDiff } from 'vscode-textmate'; |
14 | 15 | import { ContiguousMultilineTokensBuilder } from 'vs/editor/common/tokens/contiguousMultilineTokensBuilder';
|
15 | 16 | import { LineTokens } from 'vs/editor/common/tokens/lineTokens';
|
16 | 17 | import { TextMateTokenizationSupport } from 'vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport';
|
17 | 18 | import { TokenizationSupportWithLineLimit } from 'vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit';
|
18 | 19 | import { StateDeltas } from 'vs/workbench/services/textMate/browser/workerHost/textMateWorkerHost';
|
| 20 | +import type { StackDiff, StateStack, diffStateStacksRefEq } from 'vscode-textmate'; |
19 | 21 | import { TextMateTokenizationWorker } from './textMate.worker';
|
20 |
| -import { importAMDNodeModule } from 'vs/amdX'; |
21 | 22 |
|
22 | 23 | export class TextMateWorkerModel extends MirrorTextModel {
|
23 | 24 | private _tokenizationStateStore: TokenizerWithStateStore<StateStack> | null = null;
|
@@ -169,7 +170,7 @@ export class TextMateWorkerModel extends MirrorTextModel {
|
169 | 170 | const deltaMs = new Date().getTime() - startTime;
|
170 | 171 | if (deltaMs > 20) {
|
171 | 172 | // yield to check for changes
|
172 |
| - setTimeout(() => this._tokenize(), 3); |
| 173 | + setTimeout0(() => this._tokenize()); |
173 | 174 | return;
|
174 | 175 | }
|
175 | 176 | }
|
|
0 commit comments