Skip to content

Commit ad106ae

Browse files
committed
Use sting identifier for cache
1 parent 5ef8083 commit ad106ae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/vs/workbench/services/editor/common/customEditorLabelService.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito
4040
private patterns: ICustomEditorLabelPattern[] = [];
4141
private enabled = true;
4242

43-
private cache = new MRUCache<URI, string | undefined>(1000);
43+
private cache = new MRUCache<string, string | undefined>(1000);
4444

4545
constructor(
4646
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -120,13 +120,14 @@ export class CustomEditorLabelService extends Disposable implements ICustomEdito
120120
return undefined;
121121
}
122122

123-
const cached = this.cache.get(resource);
123+
const key = resource.toString();
124+
const cached = this.cache.get(key);
124125
if (cached !== undefined) {
125126
return cached;
126127
}
127128

128129
const result = this.applyPatterns(resource);
129-
this.cache.set(resource, result);
130+
this.cache.set(key, result);
130131

131132
return result;
132133
}

0 commit comments

Comments
 (0)