You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Workbench components should react to workspace folder changes instead of onDidChangeLocation #350347
When a single-folder window switches Folder Location, the workspace folder URI changes, and IWorkspaceContextService.onDidChangeWorkspaceFolders fires with the old folder removed and the new one added. With #350128, that event also says the change was a Folder Location switch (isFolderLocationChange). Today several components react to IWorkspaceFolderLocationService.onDidChangeLocation instead: editor working sets, search, outline, terminal and others. So they behave differently for a location switch than for a multi-root add or remove, and they depend on the location service even though the generic folder change already covers it. #350128 moved the recently opened history to the folder change event.
Proposal: move these components to onDidChangeWorkspaceFolders, using isFolderLocationChange where they need to tell a location switch apart, and keep onDidChangeLocation only for location UI (the status bar entry, the location pill and the location picker).
Note: onWillChangeWorkspaceFolders currently fires after getWorkspace() already returns the new folders, because the configuration service updates the workspace first. A component that wants to save state for the folder being left can't rely on getWorkspace() in that event. This should be fixed or documented as part of the move.
Activity