Deephaven in VS Code
This extension is not yet published to the marketplace, but you can install a .vsix
directly. To get a .vsix
, you can either:
Download one from the releases/ folder.
or
Build a .vsix locally via npm run package
Then install in vscode:
Note: There are some
vscode
bugs that cause some flakiness with therun
button. vscodev90
introduced an optionalworkbench.editor.alwaysShowEditorActions
setting. Setting this totrue
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.
Core server http://localhost:10000/
is configured by default and doesn't require any additional config. Additional connections can be configured in vscode
settings.
e.g. .vscode/settings.json
{
// Core servers
"vscode-deephaven.core-servers": [
"http://localhost:10000/",
"http://localhost:10001"
]
}
To select the active connection that scripts will be run against, click the connection picker in the bottom status bar of vscode.
Note: If you don't select a connection, the first one will be automatically used the first time a script is run.
Then select one of the servers:
Scripts will be run against the active connection or default to the first connection if none is selected.
Click the caret on the Run
button in the top right of the editor and select Run Deephaven File
Note that vscode
will remember your selection so you can just click the run
button (play icon) the next time.
Click the caret on the Run
button in the top right of the editor and select Run Deephaven Selected Lines
Note that vscode
will remember your selection so you can just click the run
button (play icon) the next time.
The vscode-deephaven
extension comes with some predefined python
snippets. These insert pre-defined code snippets into an editor. To use, simply type ui
to see available snippets.
The first time a connection is made to a DHC
server, the extension will:
PSK
prompt for PSK
.If auth succeeds and connection was initiated by running a script:
On subsequent script runs, the session will be re-used and only steps 4 and 5 will run
The extension dynamically downloads and loads the DH JS API from a DH Core server.
src/jsApi.downloadDhFromServer()
At runtime, dh-internal.js
and dh-core.js
are downloaded from the running DH server (default http://localhost:10000). The files are saved to out/tmp
as .cjs
modules, and import / export are converted to cjs compatible ones.