sessions: change workbench state to worksapce and do not send workspace data to ext host#298301
Merged
sessions: change workbench state to worksapce and do not send workspace data to ext host#298301
Conversation
…ce data to ext host
Contributor
bpasero
approved these changes
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new hasWorkspaceData() method to the IWorkspaceContextService interface to decouple workbench UI state from the decision of whether to send workspace data to the extension host. This enables the Sessions window to report WorkbenchState.WORKSPACE (avoiding certain EMPTY-specific UI behaviors) while still preventing workspace data from being sent to extensions.
Changes:
- Added
hasWorkspaceData()method toIWorkspaceContextServiceinterface to explicitly control whether workspace data should be sent to extension hosts - Updated Sessions workspace service to return
WORKSPACEstate but not send workspace data to extensions - Replaced
WorkbenchState.EMPTYcheck withhasWorkspaceData()call inmainThreadWorkspace.ts
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/vs/platform/workspace/common/workspace.ts |
Added hasWorkspaceData() method to IWorkspaceContextService interface with clear documentation |
src/vs/workbench/services/configuration/browser/configurationService.ts |
Implemented hasWorkspaceData() in WorkspaceService, returns true when state is not EMPTY |
src/vs/workbench/test/common/workbenchTestServices.ts |
Implemented hasWorkspaceData() in TestContextService with same logic as WorkspaceService |
src/vs/editor/standalone/browser/standaloneServices.ts |
Implemented hasWorkspaceData() in StandaloneWorkspaceContextService with same logic |
src/vs/sessions/services/workspace/browser/workspaceContextService.ts |
Changed workbench state from EMPTY to WORKSPACE, implemented hasWorkspaceData() to return false (special Sessions behavior) |
src/vs/workbench/api/browser/mainThreadWorkspace.ts |
Updated to use hasWorkspaceData() instead of checking WorkbenchState.EMPTY, removed unused WorkbenchState import |
src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts |
Added hasWorkspaceData stub to test mock implementation |
DonJayamanne
pushed a commit
that referenced
this pull request
Mar 2, 2026
…ce data to ext host (#298301)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.