Skip to content

sessions: change workbench state to worksapce and do not send workspace data to ext host#298301

Merged
sandy081 merged 1 commit intomainfrom
sandy081/subjective-possum
Feb 27, 2026
Merged

sessions: change workbench state to worksapce and do not send workspace data to ext host#298301
sandy081 merged 1 commit intomainfrom
sandy081/subjective-possum

Conversation

@sandy081
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 27, 2026 17:19
@sandy081 sandy081 enabled auto-merge (squash) February 27, 2026 17:19
@sandy081 sandy081 self-assigned this Feb 27, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/editor/contrib/snippet/test/browser/snippetVariables.test.ts

@bpasero

Matched files:

  • src/vs/platform/workspace/common/workspace.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to IWorkspaceContextService interface to explicitly control whether workspace data should be sent to extension hosts
  • Updated Sessions workspace service to return WORKSPACE state but not send workspace data to extensions
  • Replaced WorkbenchState.EMPTY check with hasWorkspaceData() call in mainThreadWorkspace.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

@sandy081 sandy081 merged commit 1bd9cbc into main Feb 27, 2026
23 checks passed
@sandy081 sandy081 deleted the sandy081/subjective-possum branch February 27, 2026 18:00
DonJayamanne pushed a commit that referenced this pull request Mar 2, 2026
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Apr 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants