Fix label formatter caching take 2

Fixes #150970
This commit is contained in:
Daniel Imms
2022-06-03 10:23:40 -07:00
parent 3cfcfa942c
commit 52b1dcc5ab
2 changed files with 2 additions and 2 deletions

View File

@@ -142,7 +142,7 @@ export class LabelService extends Disposable implements ILabelService {
this.os = OS;
this.userHome = pathService.defaultUriScheme === Schemas.file ? this.pathService.userHome({ preferLocal: true }) : undefined;
const memento = this.storedFormattersMemento = new Memento('cachedResourceFormatters', storageService);
const memento = this.storedFormattersMemento = new Memento('cachedResourceLabelFormatters', storageService);
this.storedFormatters = memento.getMemento(StorageScope.GLOBAL, StorageTarget.MACHINE);
this.formatters = this.storedFormatters?.formatters || [];

View File

@@ -166,7 +166,7 @@ suite('URI Label', () => {
test('label caching', () => {
const m = new Memento('cachedResourceFormatters', storageService).getMemento(StorageScope.GLOBAL, StorageTarget.MACHINE);
const m = new Memento('cachedResourceLabelFormatters', storageService).getMemento(StorageScope.GLOBAL, StorageTarget.MACHINE);
const makeFormatter = (scheme: string): ResourceLabelFormatter => ({ formatting: { label: `\${path} (${scheme})`, separator: '/' }, scheme });
assert.deepStrictEqual(m, {});