fix(coding): preserve contextual unicode folding
This commit is contained in:
@@ -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[]> {
|
||||
|
||||
Reference in New Issue
Block a user