fix: Normalize file path case for pairing
- Convert file1 and file2 to lowercase before adding to filePairs - Look up file pairs using lowercase file paths - This addresses case sensitivity issues in file path on Windows
This commit is contained in:
parent
86966af293
commit
9dcc0220d9
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
export class FilePairManager {
|
export class FilePairManager {
|
||||||
private static instance: FilePairManager;
|
private static instance: FilePairManager;
|
||||||
private filePairs: Map<string, [string, string]>;
|
private filePairs: Map<string, [string, string]>;
|
||||||
@ -14,11 +15,12 @@ export class FilePairManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addFilePair(file1: string, file2: string): void {
|
addFilePair(file1: string, file2: string): void {
|
||||||
this.filePairs.set(file1, [file1, file2]);
|
this.filePairs.set(file1.toLowerCase(), [file1, file2]);
|
||||||
this.filePairs.set(file2, [file1, file2]);
|
this.filePairs.set(file2.toLowerCase(), [file1, file2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
findPair(file: string): [string, string] | undefined {
|
findPair(file: string): [string, string] | undefined {
|
||||||
return this.filePairs.get(file);
|
const fileLower = file.toLowerCase();
|
||||||
|
return this.filePairs.get(fileLower);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user