fix(coding): preserve contextual unicode folding

This commit is contained in:
2026-08-23 18:36:48 +08:00
parent 365c2b0f76
commit 81c3c5b5c3
2 changed files with 6 additions and 3 deletions

View File

@@ -154,7 +154,6 @@ function foldedTextWithOffsets(value: string): {
starts: number[];
ends: number[];
} {
let text = '';
const starts: number[] = [];
const ends: number[] = [];
for (let index = 0; index < value.length;) {
@@ -163,14 +162,13 @@ function foldedTextWithOffsets(value: string): {
const character = String.fromCodePoint(codePoint);
const end = index + character.length;
const folded = character.toLowerCase();
text += folded;
for (let foldedIndex = 0; foldedIndex < folded.length; foldedIndex += 1) {
starts.push(index);
ends.push(end);
}
index = end;
}
return { text, starts, ends };
return { text: value.toLowerCase(), starts, ends };
}
async function fallbackFileList(projectPath: string): Promise<string[]> {