Bino Reports VS Code Extension
Enhanced YAML editing for Bino Reports report manifests with intelligent autocompletion, navigation, and project overview.
Features
- Language Server: Completion, hover, diagnostics, go-to-definition, find-references, rename, and quick-fixes are all served by the real
bino lsp Language Server (see the LSP docs)
- Bino Explorer Tree View: Browse all Bino documents grouped by kind (DataSource, DataSet, ReportArtefact, etc.) in the Bino Reports view
- Go to Definition / Find References / Rename: Ctrl+Click (Cmd+Click on macOS) on references like
dataset:, source:, secret:, signingProfile:, selectedStyle:, or items in dependencies: to jump to their definitions; Shift+F12/F2 work project-wide
- Dataset Autocompletion: When typing
dataset:, suggests all DataSet names and $-prefixed DataSource names from your project
- Column Introspection: When editing
scenarios:/variances: arrays or a query:/prql: block, suggests real column names from the referenced dataset via DuckDB
- SQL and PRQL in YAML:
query: and prql: blocks are highlighted as SQL and PRQL; inside them the language server completes DuckDB keywords and functions, DataSet and DataSource names after FROM/JOIN, and jumps to and shows the data of a name after FROM/JOIN
- Reference Completions: Smart completions for
signingProfile, selectedStyle, and other cross-document references
- Kind Completions: Suggests all valid document kinds when typing
kind:
- Designer: A schema-driven property-form editor for Table/Chart/Text/Tree/Grid manifests (Bino: Open Designer, or Reopen Editor With... > Bino Designer on a YAML file)
- DataSource Wizard: Scaffolds a DataSource + DataSet pair from a file or database connection (Bino: New DataSource from File/Database…)
- Tree/Table Editor & Rows Preview: A grid editor for
Tree-kind manifests, plus a live 100-row data sample for any DataSource/DataSet
- Build Tasks:
bino build runs as a bino task (Terminal > Run Build Task, or Bino: Build Report). Errors with a file and line go to the Problems panel, and a finished build offers Open PDF
- Get Started walkthrough: Install bino, create a project, add a DataSource and start the preview
- PRQL Integration: When editing
spec.prql blocks in DataSet manifests, right-click to open a dedicated PRQL editor or SQL preview (the SQL preview requires the PRQL extension)
The extension talks to bino lsp for all live editor intelligence, and to an optional
persistent bino daemon (see bino.daemon.enabled) shared by the LSP, preview, and
data-introspection features so they stay warm across requests. With no daemon running, the
extension falls back to discrete bino lsp-helper CLI calls.
Requirements
- RedHat YAML Extension (optional; adds a YAML formatter)
bino CLI must be installed and available in PATH (or configured via bino.binPath). When it is missing or older than the extension, Download bino fetches the latest release from GitHub, checks its SHA-256 checksum and keeps it in the extension's storage
- PRQL Extension (optional, for enhanced PRQL editing)
Extension Settings
bino.binPath: Path to the bino CLI executable. If not set, uses 'bino' from PATH, then a bino downloaded by the extension.
bino.columnCacheTTL: Time in milliseconds to cache column introspection results (default: 60 seconds).
bino.previewPort: Port number for the bino preview server (default: 45678).
bino.daemon.enabled: Enable the persistent background daemon for faster indexing, validation, and data introspection (default: enabled).
bino.lsp.queryDiagnostics: On save, run each DataSet query with DuckDB (LIMIT 0) and show parse and bind errors on the query line (default: off).
bino.wizard.sampleRowLimit: Max sample rows the DataSource wizard fetches when introspecting a source (default: 100).
Commands
- Bino: Refresh Index - Manually refresh the workspace index (also available via refresh button in Bino Explorer)
- Bino: Open PRQL Editor - Extract
spec.prql from the current DataSet and open it in a PRQL editor with syntax highlighting
- Bino: Open PRQL SQL Preview - Open the PRQL SQL Preview panel to see the compiled SQL (requires PRQL extension)
PRQL Support
Bino supports PRQL (Pipelined Relational Query Language) as an alternative to SQL for DataSet queries. When you have a DataSet with spec.prql:
apiVersion: bino.bi/v1alpha1
kind: DataSet
metadata:
name: sales_summary
spec:
prql: |
from sales_csv
filter amount > 0
group {region} (
aggregate {total = sum amount}
)
sort {-total}
dependencies:
- sales_csv
You can:
Edit with PRQL tooling: Place your cursor inside the prql: block and run "Bino: Open PRQL Editor" (or right-click → "Open PRQL Editor"). This opens the PRQL in a dedicated editor with syntax highlighting and diagnostics.
Preview compiled SQL: Run "Bino: Open PRQL SQL Preview" to see the SQL that DuckDB will execute. This uses the official PRQL VS Code extension's SQL Preview feature.
Execute via bino build: When you run bino build, PRQL queries are compiled and executed directly by DuckDB using the prql community extension. PRQL is not available right now: bino runs on DuckDB 2.0, and the prql extension is not published for it yet.
For the best PRQL editing experience, install the PRQL extension. Bino will prompt you to install it when it detects PRQL usage in your workspace.
How It Works
- On activation, the extension spawns
bino lsp (the Language Server) and indexes all YAML files in the workspace that contain apiVersion: bino.bi
- The Bino Explorer in the sidebar shows all indexed documents grouped by kind
- When you request completions, the language server provides context-aware suggestions:
dataset:/source: → Lists matching DataSet/DataSource names
scenarios:/variances: → Executes the referenced dataset query via DuckDB and returns column names
signingProfile:/selectedStyle: → Lists all matching SigningProfile/ComponentStyle names
- Go to Definition / Find All References / Rename work on reference fields - Ctrl+Click, Shift+F12, or F2 to navigate/refactor
- File changes trigger cache invalidation, re-indexing, and a fresh project-wide validation pass (lint findings, missing
${VAR}, engine-compat warnings)
| |