Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix label formatter caching take 2 #151236

Merged
merged 1 commit into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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