Skip to content

Commit c5a7f04

Browse files
authored
1 parent 525b7a4 commit c5a7f04

File tree

7 files changed

+46
-6
lines changed

7 files changed

+46
-6
lines changed

src/vs/workbench/services/userDataProfile/browser/extensionsResource.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,10 @@ export abstract class ExtensionsResourceTreeItem implements IProfileResourceTree
274274
that.excludedExtensions.add(e.identifier.id.toLowerCase());
275275
}
276276
},
277-
tooltip: localize('exclude', "Select {0} Extension", e.displayName || e.identifier.id)
277+
tooltip: localize('exclude', "Select {0} Extension", e.displayName || e.identifier.id),
278+
accessibilityInformation: {
279+
label: localize('exclude', "Select {0} Extension", e.displayName || e.identifier.id),
280+
}
278281
} : undefined,
279282
command: {
280283
id: 'extension.open',

src/vs/workbench/services/userDataProfile/browser/globalStateResource.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { localize } from 'vs/nls';
99
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1010
import { ILogService } from 'vs/platform/log/common/log';
1111
import { IStorageEntry, IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
12+
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
1213
import { IUserDataProfile, ProfileResourceType } from 'vs/platform/userDataProfile/common/userDataProfile';
1314
import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService';
1415
import { API_OPEN_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands';
@@ -97,13 +98,19 @@ export abstract class GlobalStateResourceTreeItem implements IProfileResourceTre
9798
readonly collapsibleState = TreeItemCollapsibleState.Collapsed;
9899
checkbox: ITreeItemCheckboxState | undefined;
99100

100-
constructor(private readonly resource: URI) { }
101+
constructor(
102+
private readonly resource: URI,
103+
private readonly uriIdentityService: IUriIdentityService
104+
) { }
101105

102106
async getChildren(): Promise<IProfileResourceChildTreeItem[]> {
103107
return [{
104108
handle: this.resource.toString(),
105109
resourceUri: this.resource,
106110
collapsibleState: TreeItemCollapsibleState.None,
111+
accessibilityInformation: {
112+
label: this.uriIdentityService.extUri.basename(this.resource)
113+
},
107114
parent: this,
108115
command: {
109116
id: API_OPEN_EDITOR_COMMAND_ID,
@@ -122,9 +129,10 @@ export class GlobalStateResourceExportTreeItem extends GlobalStateResourceTreeIt
122129
constructor(
123130
private readonly profile: IUserDataProfile,
124131
resource: URI,
132+
@IUriIdentityService uriIdentityService: IUriIdentityService,
125133
@IInstantiationService private readonly instantiationService: IInstantiationService
126134
) {
127-
super(resource);
135+
super(resource, uriIdentityService);
128136
}
129137

130138
async hasContent(): Promise<boolean> {
@@ -147,8 +155,9 @@ export class GlobalStateResourceImportTreeItem extends GlobalStateResourceTreeIt
147155
constructor(
148156
private readonly content: string,
149157
resource: URI,
158+
@IUriIdentityService uriIdentityService: IUriIdentityService,
150159
) {
151-
super(resource);
160+
super(resource, uriIdentityService);
152161
}
153162

154163
async getContent(): Promise<string> {

src/vs/workbench/services/userDataProfile/browser/keybindingsResource.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { IUserDataProfile, ProfileResourceType } from 'vs/platform/userDataProfi
1313
import { API_OPEN_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands';
1414
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1515
import { localize } from 'vs/nls';
16+
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
1617

1718
interface IKeybindingsResourceContent {
1819
platform: Platform;
@@ -91,6 +92,7 @@ export class KeybindingsResourceTreeItem implements IProfileResourceTreeItem {
9192

9293
constructor(
9394
private readonly profile: IUserDataProfile,
95+
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
9496
@IInstantiationService private readonly instantiationService: IInstantiationService
9597
) { }
9698

@@ -104,6 +106,9 @@ export class KeybindingsResourceTreeItem implements IProfileResourceTreeItem {
104106
resourceUri: this.profile.keybindingsResource,
105107
collapsibleState: TreeItemCollapsibleState.None,
106108
parent: this,
109+
accessibilityInformation: {
110+
label: this.uriIdentityService.extUri.basename(this.profile.settingsResource)
111+
},
107112
command: {
108113
id: API_OPEN_EDITOR_COMMAND_ID,
109114
title: '',

src/vs/workbench/services/userDataProfile/browser/settingsResource.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { IUserDataProfile, ProfileResourceType } from 'vs/platform/userDataProfi
1616
import { API_OPEN_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands';
1717
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1818
import { localize } from 'vs/nls';
19+
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
1920

2021
interface ISettingsContent {
2122
settings: string | null;
@@ -110,6 +111,7 @@ export class SettingsResourceTreeItem implements IProfileResourceTreeItem {
110111

111112
constructor(
112113
private readonly profile: IUserDataProfile,
114+
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
113115
@IInstantiationService private readonly instantiationService: IInstantiationService
114116
) { }
115117

@@ -119,6 +121,9 @@ export class SettingsResourceTreeItem implements IProfileResourceTreeItem {
119121
resourceUri: this.profile.settingsResource,
120122
collapsibleState: TreeItemCollapsibleState.None,
121123
parent: this,
124+
accessibilityInformation: {
125+
label: this.uriIdentityService.extUri.basename(this.profile.settingsResource)
126+
},
122127
command: {
123128
id: API_OPEN_EDITOR_COMMAND_ID,
124129
title: '',

src/vs/workbench/services/userDataProfile/browser/snippetsResource.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export class SnippetsResourceTreeItem implements IProfileResourceTreeItem {
109109
constructor(
110110
private readonly profile: IUserDataProfile,
111111
@IInstantiationService private readonly instantiationService: IInstantiationService,
112+
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
112113
) { }
113114

114115
async getChildren(): Promise<IProfileResourceChildTreeItem[] | undefined> {
@@ -119,6 +120,9 @@ export class SnippetsResourceTreeItem implements IProfileResourceTreeItem {
119120
parent: that,
120121
resourceUri: resource,
121122
collapsibleState: TreeItemCollapsibleState.None,
123+
accessibilityInformation: {
124+
label: this.uriIdentityService.extUri.basename(resource),
125+
},
122126
checkbox: that.checkbox ? {
123127
get isChecked() { return !that.excludedSnippets.has(resource); },
124128
set isChecked(value: boolean) {
@@ -127,6 +131,9 @@ export class SnippetsResourceTreeItem implements IProfileResourceTreeItem {
127131
} else {
128132
that.excludedSnippets.add(resource);
129133
}
134+
},
135+
accessibilityInformation: {
136+
label: localize('exclude', "Select Snippet {0}", this.uriIdentityService.extUri.basename(resource)),
130137
}
131138
} : undefined,
132139
command: {

src/vs/workbench/services/userDataProfile/browser/tasksResource.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { localize } from 'vs/nls';
88
import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files';
99
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1010
import { ILogService } from 'vs/platform/log/common/log';
11+
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
1112
import { IUserDataProfile, ProfileResourceType } from 'vs/platform/userDataProfile/common/userDataProfile';
1213
import { API_OPEN_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands';
1314
import { ITreeItemCheckboxState, TreeItemCollapsibleState } from 'vs/workbench/common/views';
@@ -89,6 +90,7 @@ export class TasksResourceTreeItem implements IProfileResourceTreeItem {
8990

9091
constructor(
9192
private readonly profile: IUserDataProfile,
93+
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
9294
@IInstantiationService private readonly instantiationService: IInstantiationService
9395
) { }
9496

@@ -98,6 +100,9 @@ export class TasksResourceTreeItem implements IProfileResourceTreeItem {
98100
resourceUri: this.profile.tasksResource,
99101
collapsibleState: TreeItemCollapsibleState.None,
100102
parent: this,
103+
accessibilityInformation: {
104+
label: this.uriIdentityService.extUri.basename(this.profile.settingsResource)
105+
},
101106
command: {
102107
id: API_OPEN_EDITOR_COMMAND_ID,
103108
title: '',

src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ abstract class UserDataProfileImportExportState extends Disposable implements IT
899899
if (children) {
900900
for (const child of children) {
901901
child.checkbox = child.parent.checkbox && child.checkbox
902-
? { isChecked: child.parent.checkbox.isChecked ? child.checkbox.isChecked : false }
902+
? { ...child.checkbox, isChecked: child.parent.checkbox.isChecked ? child.checkbox.isChecked : false }
903903
: undefined;
904904
}
905905
}
@@ -918,7 +918,13 @@ abstract class UserDataProfileImportExportState extends Disposable implements IT
918918
this.rootsPromise = (async () => {
919919
this.roots = await this.fetchRoots();
920920
for (const root of this.roots) {
921-
root.checkbox = { isChecked: !root.isFromDefaultProfile(), tooltip: localize('select', "Select {0}", root.label.label) };
921+
root.checkbox = {
922+
isChecked: !root.isFromDefaultProfile(),
923+
tooltip: localize('select', "Select {0}", root.label.label),
924+
accessibilityInformation: {
925+
label: localize('select', "Select {0}", root.label.label),
926+
}
927+
};
922928
if (root.isFromDefaultProfile()) {
923929
root.description = localize('from default', "From Default Profile");
924930
}

0 commit comments

Comments
 (0)