diff --git a/vscode-paches/0052-replace-segmenter-to-stub.patch b/vscode-paches/0052-replace-segmenter-to-stub.patch new file mode 100644 index 00000000..c8359b1a --- /dev/null +++ b/vscode-paches/0052-replace-segmenter-to-stub.patch @@ -0,0 +1,90 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= +Date: Fri, 19 Apr 2024 16:59:22 +0200 +Subject: [PATCH] replace segmenter to stub + +--- + .../common/core/wordCharacterClassifier.ts | 54 ++++++------------- + 1 file changed, 15 insertions(+), 39 deletions(-) + +diff --git a/src/vs/editor/common/core/wordCharacterClassifier.ts b/src/vs/editor/common/core/wordCharacterClassifier.ts +index b984c272657..756ff09fcf6 100644 +--- a/src/vs/editor/common/core/wordCharacterClassifier.ts ++++ b/src/vs/editor/common/core/wordCharacterClassifier.ts +@@ -16,18 +16,14 @@ export const enum WordCharacterClass { + export class WordCharacterClassifier extends CharacterClassifier { + + public readonly intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[]; +- private readonly _segmenter: Intl.Segmenter | null = null; ++ private readonly _segmenter: undefined | null = null; + private _cachedLine: string | null = null; + private _cachedSegments: IntlWordSegmentData[] = []; + + constructor(wordSeparators: string, intlSegmenterLocales: Intl.UnicodeBCP47LocaleIdentifier[]) { + super(WordCharacterClass.Regular); + this.intlSegmenterLocales = intlSegmenterLocales; +- if (this.intlSegmenterLocales.length > 0) { +- this._segmenter = new Intl.Segmenter(this.intlSegmenterLocales, { granularity: 'word' }); +- } else { +- this._segmenter = null; +- } ++ this._segmenter = null; + + for (let i = 0, len = wordSeparators.length; i < len; i++) { + this.set(wordSeparators.charCodeAt(i), WordCharacterClass.WordSeparator); +@@ -59,42 +55,22 @@ export class WordCharacterClassifier extends CharacterClassifier(10);