mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 04:09:28 +00:00
Make ResourceMap treat the same file with different scheme as different
Fixes #110435
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as fileSchemes from '../utils/fileSchemes';
|
||||
|
||||
/**
|
||||
* Maps of file resources
|
||||
@@ -12,10 +13,18 @@ import * as vscode from 'vscode';
|
||||
* file systems.
|
||||
*/
|
||||
export class ResourceMap<T> {
|
||||
private readonly _map = new Map<string, { resource: vscode.Uri, value: T }>();
|
||||
|
||||
private static readonly defaultPathNormalizer = (resource: vscode.Uri): string => {
|
||||
if (resource.scheme === fileSchemes.file) {
|
||||
return resource.fsPath;
|
||||
}
|
||||
return resource.toString(true);
|
||||
};
|
||||
|
||||
private readonly _map = new Map<string, { readonly resource: vscode.Uri, value: T }>();
|
||||
|
||||
constructor(
|
||||
private readonly _normalizePath: (resource: vscode.Uri) => string | undefined = (resource) => resource.fsPath,
|
||||
private readonly _normalizePath: (resource: vscode.Uri) => string | undefined = ResourceMap.defaultPathNormalizer,
|
||||
protected readonly config: {
|
||||
readonly onCaseInsenitiveFileSystem: boolean,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user