Turbine for VS Code
See the problems in a Turbine data contract while you type, and fix them with one key.
Turbine is a data quality tool. You write in YAML what a table must look like, and Turbine checks the real table. This extension brings those checks into your editor.
Start in 3 steps
Install the extension. Search for Turbine in the Extensions view, or run:
code --install-extension enexis.turbine-lsp
Make a Turbine Project, if you do not have one:
uv init --python 3.12
uv add "turbine-data[duckdb]"
uv run turbine init
Open the Project folder in VS Code, and open a YAML file in contracts/ or datasources/.
Try it
Open a Data Contract and delete the line status: proposed. Do not save.
A message appears on the first line:
missing required field 'status'; one of 'proposed', 'draft', 'active', 'deprecated', 'archived'
Put the cursor on that line and press Ctrl+. (Cmd+. on macOS). Select Add field 'status'. The extension writes the field and shows its five values. Select one, and press Tab.
You did not type the field, and you did not run a command.
What you get
| You want to |
Do this |
| See a problem |
Read the message at the end of the line. It appears while you type. |
| Fix a problem |
Press Ctrl+. (Cmd+. on macOS) on the line, and select the fix. |
| Know what a key means |
Hold the mouse pointer on the key. |
| See which keys or values fit |
Press Ctrl+Space. |
| Fill the fields of inserted text |
Press Tab to go to the next field. |
| Add a check |
Select Add quality check above a Dataset or a column. |
| Run a check |
Select Run ... above the check, or use the Testing panel. |
| Compare a contract with the database |
Select Validate schema on ... above the document. |
| Make a contract from a table |
Select Create contract from this datasource above a Datasource. |
The extension works on YAML documents, and on SQL and Python Check Types.
A run from the editor uses the text that you see, also before you save it. It does not write to the Run History. To keep a result, run uv run turbine check in a terminal.
If nothing happens
| You see |
Do this |
| No message on a wrong key |
Open the Project folder itself: the folder with pyproject.toml and .venv. |
| "This folder is a Turbine Project, but Turbine is not installed in it." |
Run uv sync in the Project folder. Then run Developer: Reload Window. |
| "Turbine couldn't start the configured server." |
Clear the turbine.serverPath setting. |
| "Turbine couldn't start its language server" |
Run uv sync in the Project folder. Then run Developer: Reload Window. |
| No Add quality check or Run links |
Switch on the editor.codeLens setting. |
To read the log, open View > Output and select Turbine.
Setting
turbine.serverPath is the path of the turbine-lsp program. Leave it empty. The extension then looks in the .venv of the folder, then tries uv run turbine-lsp, and then your PATH.
Good to know
- VS Code installs the Error Lens extension with this one. Error Lens puts each message at the end of its line.
- The extension does not format YAML.
- Version 0.3.0 is a new extension for Turbine 1.0. It does not have the sidebar and the commands of version 0.2.0. If your Project uses the old Turbine, keep 0.2.0: in the Extensions view, select the arrow next to Uninstall, and then Install Specific Version.
License
Apache-2.0