Deephaven VS Code Extension
Installation
The Deephaven VS Code extension can be installed from the VS Code Marketplace or from the extension browser inside of VS Code
. The extension is currently pre-release
, so you'll need to install it as such.
Once installed, there will be a new icon in the activity bar
(the sidebar containing navigation icons). Clicking the Deephaven icon will show a new panel containing details of configured Deephaven servers. By default, the extension is configured to connect to a single Community server hosted at http:localhost:10000
.
The "SERVERS" tree will show the status of any configured servers. To run a script against a running server, simply click the Run Deephaven File
action at the top of a file supported by the server (python
or groovy
).
A new connection will show up in the "CONNECTIONS" tree, and the "PANELS" should show any variables exposed on the connection. To disconnect, hover over the connection item and click the trash icon.
Configuration
A single Community server http://localhost:10000/
is configured by default and doesn't require any additional config. Additional connections can be configured in VS Code
settings.
Note: There are some VS Code
bugs that cause some flakiness with the run
button. VS Code
v90
introduced an optional workbench.editor.alwaysShowEditorActions
setting. Setting this to true
improves the experience here. Namely the run button will not disappear when running commands or selecting its dropdown. See https://github.com/deephaven/vscode-deephaven/issues/1 for more details.
Community servers can be configured via the "deephaven.coreServers"
setting in VS Code
user or workspace settings.
Enterprise Servers
Enterprise servers can be configured via the "deephaven.enterpriseServers"
setting in VS Code
user or workspace settings.
"deephaven.enterpriseServers": [
// Simplest config is to provide the server URL
"https://my-server-a.acme.org:8123/",
// Advanced config
{
"url": "https://my-server-b.acme.org:8123/",
"label": "Server B",
// Configure PQ workers created by the extension
"experimentalWorkerConfig": {
"heapSize": 0.5
}
}
]
Workspace Setup
It is recommended to configure a virtual python environment within your VS Code
workspace. See https://code.visualstudio.com/docs/python/python-tutorial#_create-a-virtual-environment for a general overview. To get features like intellisense, you can install deephaven
pip packages in the venv
.
For example here's a minimal requirements.txt
file that enables intellisense for common Deephaven packages:
deephaven-core
deephaven-plugin-plotly-express
deephaven-plugin-ui
Note: Python code executed by the extension always runs on the server, while the local environment drives language features in VS Code
such as intellisense. Therefore, local pip installs will need to target the same versions installed on the server to ensure intellisense features match the apis running on the server. For Community, it is possible for the server to share the same environment as VS Code
. For Enterprise, they will always be separate. We plan to implement better support for this in the future.
If you want to manage Deephaven servers from within the extension, include deephaven-server
in the venv pip installation.
Once installed, clicking the "refresh" button in the server tree panel should reveal a "Managed" servers node.
Hovering over the "Managed" node shows a Play button that starts a server.
Panels
Servers Panel
The servers
panel shows the status of all configured servers.
If the deephaven-server
pip package is available your local workspace, the panel will also show a "Managed" servers node (note that managed servers are Community servers that target the current VS Code
workspace).
Connections Panel
The connections
panel shows all active connections + editors currently associated with them. Hovering over nodes will show additional contextual action icons.
Editors can be dragged from 1 active connection to another.
Panels Panel
The panels
panel shows exported variables available on an active connection. Clicking a variable will open or refresh the respective output panel.