Skip to content

Commit

Permalink
Merge pull request #151236 from microsoft/tyriar/150970_2
Browse files Browse the repository at this point in the history
Fix label formatter caching take 2
  • Loading branch information
Tyriar committed Jun 3, 2022
2 parents 3cfcfa9 + 52b1dcc commit 71080eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/services/label/common/labelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 || [];

Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/services/label/test/browser/label.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {});

Expand Down

0 comments on commit 71080eb

Please sign in to comment.