OpenDataDSL for VS Code
Write, run and debug OpenDataDSL (ODSL) scripts in VS Code, and work with the scripts, types, processes and other items on the OpenDataDSL platform without leaving the editor.
What is OpenDataDSL?
OpenDataDSL is a data management platform for the energy and commodity markets. At its core is ODSL, a simple programming language with data management as its specialist capability. It has specific constructs allowing you to:
- Create data models that mimic the real world, and relationships between your data objects
- Work with complex data types such as timeseries, forward curves and matrices
- Collect data from anywhere on the internet, and transform it from one format to another
- Build derived and calculated data, and forward curves
- Automate data processing and delivery with processes and workflows
Getting started
- Install the extension, then open a folder for your scripts.
- Open or create a file ending in
.odsl. The extension starts its language server and asks you to sign in to OpenDataDSL the first time.
- Choose the stage and data environment to work with: select ODSL in the status bar.
- Press
Ctrl+Enter to run the script, or F5 to debug it.
Editing
- Syntax highlighting for ODSL, including doc comments,
//#region blocks, ${service:...} references, #CONSTANTS and periods such as 3M
- Code completion, hover information, signature help and problems as you type, from the ODSL language server
- Completion of script ids in
import ${script:"..."}, and of the functions of the scripts you import, with their descriptions on hover
- The Outline view, breadcrumbs and Go to Symbol (
Ctrl+Shift+O) list your functions and regions
- Snippets for functions, loops, regions, imports and the script header
Running and debugging
- Run and Debug links above each function and
//#region: run or debug just that function (you give its arguments, which are remembered) or that region
Ctrl+Enter runs the script, Ctrl+Shift+Enter the region at the cursor, F5 debugs the script; Run the selected text runs a selection
- The editor's text runs as it is, saved or not. A file
<script>.input.json next to the script is its input variable (ODSL: Edit the script's input)
- Output, the result and any error (with a link to its line) go to the Debug Console; ODSL: Show the result of the last run shows the whole result as JSON
- Breakpoints with conditions, hit counts and log points; pause; step over, into and out by function
- The Call Stack shows each function call, including the functions of the scripts you import, which open read only so you can step through them
- Watches, hover and the Debug Console take any ODSL expression
Runs and debugging happen on your computer, as you: scripts read and write data on the platform with your own access.
Stages and data environments
- The status bar shows where you are connected, for example ODSL: prod · production. Select it, or the top of the Platform panel, to change the stage
- Stages:
prod and preview, and for administrators also dev and local
- Within a stage, choose the data environment (
production, preview or others your company has): the Platform panel, code completion, runs and debugging all use it, and it is remembered for each stage
Select the OpenDataDSL icon in the Activity Bar.
- Scripts (in folders, as in the portal's Script Manager), types, transformers, actions, workflows, processes and calendars of the stage and data environment
- Select a script to open it as a file in your folder; when your file differs from the platform's version you can compare them or take the platform's
- Right-click an item to copy its reference or id, or delete it; start a new private script from the button next to private
- Lists are read when you open them; refresh one group or the whole panel from its buttons
Uploading scripts
- Right-click a script in the editor or the Explorer and select Upload this script
- Select several scripts or a folder in the Explorer and select Upload scripts to the platform: every script in the folder and its subfolders is uploaded, after you confirm, with progress you can cancel
- You choose the data environment to upload to each time
- A script opened from the Platform panel uploads back to its own id. A script written in VS Code uploads as the name of the folder open in VS Code and its path there, without the extension:
eon\load-prices.odsl in the folder odsl-demo uploads as odsl-demo\eon\load-prices
Commands and keys
| Command |
Key |
| ODSL: Run the script |
Ctrl+Enter |
| ODSL: Run the region at the cursor |
Ctrl+Shift+Enter |
| Debug the script |
F5 |
| ODSL: Run a function... / Debug a function... |
|
| ODSL: Choose the stage to connect to |
|
| ODSL: Choose the data environment |
|
| ODSL: Edit the script's input |
|
| ODSL: Show the result of the last run |
|
| ODSL: Refresh the Platform panel |
|
Extension settings
odsl.environment: The stage to connect to (prod, preview, dev or local). Empty uses the stage in %APPDATA%\ODSL\.odslenv, else prod
odsl.codeLens: Show the Run and Debug links above functions and regions (default true)
odsl.port: The port of the local ODSL process (default 8008)
Requirements
The extension includes the Java runtime it needs on Windows. On other systems, install Java 17 or later, with JAVA_HOME set to its location or java on the path.
Links
| |