forked from posit-dev/positron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the session's pane its own seperate view container now that plot…
…s and variables go into it. (posit-dev#3129)
- Loading branch information
Showing
4 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
47 changes: 47 additions & 0 deletions
47
src/vs/workbench/contrib/positronSession/browser/positronSessionContainer.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (C) 2024 Posit Software, PBC. All rights reserved. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as nls from 'vs/nls'; | ||
import { Registry } from 'vs/platform/registry/common/platform'; | ||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; | ||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer'; | ||
import { ViewContainer, IViewContainersRegistry, ViewContainerLocation, Extensions as ViewContainerExtensions } from 'vs/workbench/common/views'; | ||
import { registerIcon } from 'vs/platform/theme/common/iconRegistry'; | ||
import { Codicon } from 'vs/base/common/codicons'; | ||
|
||
export const POSITRON_SESSION_VIEW_ID = 'workbench.panel.positronSession'; | ||
|
||
// The Positron variables view icon. | ||
export const positronSessionViewIcon = registerIcon( | ||
'positron-session-view-icon', | ||
Codicon.positronVariablesView, | ||
nls.localize('positronSessionViewIcon', 'View icon of the Positron session view.') | ||
); | ||
|
||
|
||
/** | ||
* A view container for holding views related to the positron session. | ||
* E.g. variables and plots. | ||
*/ | ||
export const POSITRON_SESSION_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>( | ||
ViewContainerExtensions.ViewContainersRegistry | ||
).registerViewContainer( | ||
{ | ||
id: POSITRON_SESSION_VIEW_ID, | ||
title: { | ||
value: nls.localize('positron.session', "Session"), | ||
original: 'Session' | ||
}, | ||
icon: positronSessionViewIcon, | ||
order: 1, | ||
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [POSITRON_SESSION_VIEW_ID, { mergeViewWithContainerWhenSingleView: true }]), | ||
storageId: POSITRON_SESSION_VIEW_ID, | ||
hideIfEmpty: false, | ||
}, | ||
ViewContainerLocation.AuxiliaryBar, | ||
{ | ||
doNotRegisterOpenCommand: true, | ||
isDefault: true | ||
} | ||
); |
This file contains 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