-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed
Labels
debtCode quality issuesCode quality issuesimportantIssue identified as high-priorityIssue identified as high-priorityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiders
Milestone
Description
Storage state is changed directly by the layout service while applying the default layout. Eg:
vscode/src/vs/workbench/browser/layout.ts
Lines 636 to 642 in 6d70b4f
storageService.store(`${viewletId}.state.hidden`, JSON.stringify(viewsState), StorageScope.GLOBAL); | |
storageService.store(`${viewletId}.state`, JSON.stringify(viewsWorkspaceState), StorageScope.WORKSPACE); | |
} | |
} | |
if (sidebarState.length) { | |
storageService.store(ActivitybarPart.PINNED_VIEWLETS, JSON.stringify(sidebarState), StorageScope.GLOBAL); |
I do not think this is the right way to access/update the state that is internal to a specific component/service. This will break if the corresponding component/service changes its semantics. Worst that corresponding component/service owner will not be aware that something is broken. It seems keys are also hardcoded 😞
Right way to do this is to add APIs to corresponding services and let the services change their state.
I would strongly recommend to change this at the earliest.
Metadata
Metadata
Assignees
Labels
debtCode quality issuesCode quality issuesimportantIssue identified as high-priorityIssue identified as high-priorityinsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code Insiders