From 6e669b1f1a52d701d451c13e2729dc83eb1dc849 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Mon, 24 Apr 2023 12:40:55 +0200 Subject: [PATCH] Fixes #180222 --- src/vs/editor/common/model/tokenizationTextModelPart.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/editor/common/model/tokenizationTextModelPart.ts b/src/vs/editor/common/model/tokenizationTextModelPart.ts index 702c300851288..600c7506bc4a9 100644 --- a/src/vs/editor/common/model/tokenizationTextModelPart.ts +++ b/src/vs/editor/common/model/tokenizationTextModelPart.ts @@ -472,6 +472,7 @@ class GrammarTokens extends Disposable { if (tokenizationSupport?.backgroundTokenizerShouldOnlyVerifyTokens && tokenizationSupport.createBackgroundTokenizer) { this._debugBackgroundTokens = new ContiguousTokensStore(this._languageIdCodec); this._debugBackgroundStates = new TrackingTokenizationStateStore(this._textModel.getLineCount()); + this._debugBackgroundTokenizer.clear(); this._debugBackgroundTokenizer.value = tokenizationSupport.createBackgroundTokenizer(this._textModel, { setTokens: (tokens) => { this._debugBackgroundTokens?.setMultilineTokens(tokens, this._textModel);