diff --git a/src/vs/editor/common/modes/monarch/monarchLexer.ts b/src/vs/editor/common/modes/monarch/monarchLexer.ts index b526fc4641fd28b6f3e324e1dcb723dd0af48331..417f02e365fdfa03c8c7f710f1ded573a9a20f65 100644 --- a/src/vs/editor/common/modes/monarch/monarchLexer.ts +++ b/src/vs/editor/common/modes/monarch/monarchLexer.ts @@ -336,14 +336,14 @@ class MonarchModernTokensCollector implements IMonarchTokensCollector { let bLen = b.length; let cLen = (c !== null ? c.length : 0); - // Fast path - if (bLen === 0) { - if (aLen === 0) { - return c; - } - if (cLen === 0) { - return a; - } + if (aLen === 0 && bLen === 0 && cLen === 0) { + return new Uint32Array(0); + } + if (aLen === 0 && bLen === 0) { + return c; + } + if (bLen === 0 && cLen === 0) { + return a; } let result = new Uint32Array(aLen + bLen + cLen);