-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workspace: add workbenchState
context key
#10550
Conversation
if (this.workspaceService.opened) { | ||
return this.workspaceService.isMultiRootWorkspaceOpened ? 'folder' : 'workspace'; | ||
return this.workspaceService.isMultiRootWorkspaceOpened ? 'workspace' : 'folder'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the original code might have had the logic reversed.
this.updateStyles(); | ||
this.workspaceService.onWorkspaceChanged(() => { | ||
this.updateEncodingOverrides(); | ||
updateWorkspaceFolderCountKey(); | ||
updateWorkspaceStateKey(); | ||
updateWorkbenchStateKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you expect that workspaceState
and workbenchState
may want to have different values in the future? In this code, they're updated in tandem and with the same values, so they could be combined.
The commit adds support for the `workbenchState` context key, which declares if there is no workspace (empty), a folder, or a workspace (multi-root) opened. Signed-off-by: vince-fugnitto <[email protected]>
Signed-off-by: vince-fugnitto <[email protected]>
a91b9b4
to
ad52561
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we may want to remove the workspaceState
key, but this looks good for now.
What it does
Fixes: #10549
The pull-request adds support for the
workbenchState
context key, which declares if there is no workspace (empty), a folder, or a workspace (multi-root) opened.How to test
theia
as a workspace - confirm that themaven
view in the explorer is not visibleReset Workbench Layout
- confirm that themaven
view in the explorer is not visiblepom.xml
in the workspace (one of the activation events for the view)Reset Workbench Layout
- confirm that themaven
view is now visibleReview checklist
Reminder for reviewers
Signed-off-by: vince-fugnitto [email protected]