diff --git a/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.ts b/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.ts index 4f0ea7ad4f031..61fe81d715e9e 100644 --- a/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.ts +++ b/vscode/src/vs/workbench/services/userDataProfile/browser/globalStateResource.ts @@ -13,7 +13,7 @@ import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataPro import { IUserDataProfileStorageService } from 'vs/platform/userDataProfile/common/userDataProfileStorageService'; import { API_OPEN_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; import { ITreeItemCheckboxState, TreeItemCollapsibleState } from 'vs/workbench/common/views'; -import { IProfileResource, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { IProfileResource, IProfileResourceChildTreeItem, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; interface IGlobalState { storage: IStringDictionary; @@ -74,19 +74,26 @@ export class GlobalStateResource implements IProfileResource { export abstract class GlobalStateResourceTreeItem implements IProfileResourceTreeItem { readonly type = ProfileResourceType.GlobalState; - readonly handle = 'globalState'; + readonly handle = ProfileResourceType.GlobalState; readonly label = { label: localize('globalState', "UI State") }; - readonly collapsibleState = TreeItemCollapsibleState.None; + readonly collapsibleState = TreeItemCollapsibleState.Expanded; checkbox: ITreeItemCheckboxState = { isChecked: true }; - readonly command = { - id: API_OPEN_EDITOR_COMMAND_ID, - title: '', - arguments: [this.resource, undefined, undefined] - }; constructor(private readonly resource: URI) { } - async getChildren(): Promise { return undefined; } + async getChildren(): Promise { + return [{ + handle: this.resource.toString(), + resourceUri: this.resource, + collapsibleState: TreeItemCollapsibleState.None, + parent: this, + command: { + id: API_OPEN_EDITOR_COMMAND_ID, + title: '', + arguments: [this.resource, undefined, undefined] + } + }]; + } abstract getContent(): Promise; } diff --git a/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.ts b/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.ts index 336bb9e426b36..197dc177b2bae 100644 --- a/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.ts +++ b/vscode/src/vs/workbench/services/userDataProfile/browser/keybindingsResource.ts @@ -6,7 +6,7 @@ import { VSBuffer } from 'vs/base/common/buffer'; import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; -import { IProfileResource, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { IProfileResource, IProfileResourceChildTreeItem, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; import { platform, Platform } from 'vs/base/common/platform'; import { ITreeItemCheckboxState, TreeItemCollapsibleState } from 'vs/workbench/common/views'; import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; @@ -65,22 +65,29 @@ export class KeybindingsResource implements IProfileResource { export class KeybindingsResourceTreeItem implements IProfileResourceTreeItem { readonly type = ProfileResourceType.Keybindings; - readonly handle = this.profile.keybindingsResource.toString(); + readonly handle = ProfileResourceType.Keybindings; readonly label = { label: localize('keybindings', "Keyboard Shortcuts") }; - readonly collapsibleState = TreeItemCollapsibleState.None; + readonly collapsibleState = TreeItemCollapsibleState.Expanded; checkbox: ITreeItemCheckboxState = { isChecked: true }; - readonly command = { - id: API_OPEN_EDITOR_COMMAND_ID, - title: '', - arguments: [this.profile.keybindingsResource, undefined, undefined] - }; constructor( private readonly profile: IUserDataProfile, @IInstantiationService private readonly instantiationService: IInstantiationService ) { } - async getChildren(): Promise { return undefined; } + async getChildren(): Promise { + return [{ + handle: this.profile.keybindingsResource.toString(), + resourceUri: this.profile.keybindingsResource, + collapsibleState: TreeItemCollapsibleState.None, + parent: this, + command: { + id: API_OPEN_EDITOR_COMMAND_ID, + title: '', + arguments: [this.profile.keybindingsResource, undefined, undefined] + } + }]; + } async hasContent(): Promise { const keybindingsContent = await this.instantiationService.createInstance(KeybindingsResource).getKeybindingsResourceContent(this.profile); diff --git a/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.ts b/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.ts index c2f6728942341..81e0e35478f0e 100644 --- a/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.ts +++ b/vscode/src/vs/workbench/services/userDataProfile/browser/settingsResource.ts @@ -8,7 +8,7 @@ import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platf import { FileOperationError, FileOperationResult, IFileService } from 'vs/platform/files/common/files'; import { ILogService } from 'vs/platform/log/common/log'; import { Registry } from 'vs/platform/registry/common/platform'; -import { IProfileResource, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { IProfileResource, IProfileResourceChildTreeItem, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; import { updateIgnoredSettings } from 'vs/platform/userDataSync/common/settingsMerge'; import { IUserDataSyncUtilService } from 'vs/platform/userDataSync/common/userDataSync'; import { ITreeItemCheckboxState, TreeItemCollapsibleState } from 'vs/workbench/common/views'; @@ -84,22 +84,29 @@ export class SettingsResource implements IProfileResource { export class SettingsResourceTreeItem implements IProfileResourceTreeItem { readonly type = ProfileResourceType.Settings; - readonly handle = this.profile.settingsResource.toString(); + readonly handle = ProfileResourceType.Settings; readonly label = { label: localize('settings', "Settings") }; - readonly collapsibleState = TreeItemCollapsibleState.None; + readonly collapsibleState = TreeItemCollapsibleState.Expanded; checkbox: ITreeItemCheckboxState = { isChecked: true }; - readonly command = { - id: API_OPEN_EDITOR_COMMAND_ID, - title: '', - arguments: [this.profile.settingsResource, undefined, undefined] - }; constructor( private readonly profile: IUserDataProfile, @IInstantiationService private readonly instantiationService: IInstantiationService ) { } - async getChildren(): Promise { return undefined; } + async getChildren(): Promise { + return [{ + handle: this.profile.settingsResource.toString(), + resourceUri: this.profile.settingsResource, + collapsibleState: TreeItemCollapsibleState.None, + parent: this, + command: { + id: API_OPEN_EDITOR_COMMAND_ID, + title: '', + arguments: [this.profile.settingsResource, undefined, undefined] + } + }]; + } async hasContent(): Promise { const settingsContent = await this.instantiationService.createInstance(SettingsResource).getSettingsContent(this.profile); diff --git a/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.ts b/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.ts index 7b27c485c19a7..ea48e4e9aced1 100644 --- a/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.ts +++ b/vscode/src/vs/workbench/services/userDataProfile/browser/tasksResource.ts @@ -11,7 +11,7 @@ import { ILogService } from 'vs/platform/log/common/log'; import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; import { API_OPEN_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; import { ITreeItemCheckboxState, TreeItemCollapsibleState } from 'vs/workbench/common/views'; -import { IProfileResource, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +import { IProfileResource, IProfileResourceChildTreeItem, IProfileResourceTreeItem, ProfileResourceType } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; interface ITasksResourceContent { tasks: string | null; @@ -63,22 +63,29 @@ export class TasksResource implements IProfileResource { export class TasksResourceTreeItem implements IProfileResourceTreeItem { readonly type = ProfileResourceType.Tasks; - readonly handle = this.profile.tasksResource.toString(); + readonly handle = ProfileResourceType.Tasks; readonly label = { label: localize('tasks', "User Tasks") }; - readonly collapsibleState = TreeItemCollapsibleState.None; + readonly collapsibleState = TreeItemCollapsibleState.Expanded; checkbox: ITreeItemCheckboxState = { isChecked: true }; - readonly command = { - id: API_OPEN_EDITOR_COMMAND_ID, - title: '', - arguments: [this.profile.tasksResource, undefined, undefined] - }; constructor( private readonly profile: IUserDataProfile, @IInstantiationService private readonly instantiationService: IInstantiationService ) { } - async getChildren(): Promise { return undefined; } + async getChildren(): Promise { + return [{ + handle: this.profile.tasksResource.toString(), + resourceUri: this.profile.tasksResource, + collapsibleState: TreeItemCollapsibleState.None, + parent: this, + command: { + id: API_OPEN_EDITOR_COMMAND_ID, + title: '', + arguments: [this.profile.tasksResource, undefined, undefined] + } + }]; + } async hasContent(): Promise { const tasksContent = await this.instantiationService.createInstance(TasksResource).getTasksResourceContent(this.profile);