Skip to content

QQL editor tooling

The official extension is qql-lang (publisher srimon12), displayed as "QQL: Qdrant Query Language" (extension version 0.4.0, bundling the QQL 1.7 parser). It is published on the Visual Studio Code marketplace. VSIX binaries are not committed to the repository. Build one locally with npm run package inside editors/vscode/ (requires @vscode/vsce), or download the release asset that matches your version.

Install from the marketplace
code --install-extension srimon12.qql-lang

Or install a locally built VSIX manually:

  1. Open the Extensions panel (Ctrl+Shift+X).
  2. Open the (More Actions) menu.
  3. Choose Install from VSIX... and select your built qql-lang-*.vsix.

The TextMate grammar highlights .qql files with 130+ keywords across 9 scopes, covering statements, operators, parameter placeholders (:name, ?), punctuation, strings, and comments. The same grammar powers the syntax highlighting on this website. Fenced qql code blocks in Markdown files are highlighted as well.

The extension runs the bundled qql-wasm parser on every change, debounced at ~300 ms (configurable with qql.diagnostics.debounceMs), and reports grammar errors with precise spans and stable error codes. Invalid statements are underlined directly in the editor. The status bar shows a valid statement count, or the failing error code, and clicking it re-analyzes the document.

Hovering a keyword shows its reference doc (statement, mode, clause, filter, or formula helper). Hovering a statement also shows its live execution plan: the plan for the enclosing statement, plus the compiled REST route (method and path) when the statement compiles. Plans come from the same local analysis that drives diagnostics, so they never need a server round trip.

Each top-level statement gets inline actions above its first line:

LensAction
ExplainOpen the execution plan for this statement
RESTOpen the compiled Qdrant REST route as JSON
curlCopy a ready to run curl command using qql.baseUrl

Scripts with more than one statement also get a label lens with the statement kind. Disable all lenses with qql.codeLens.enabled.

All commands work on the current document, or on the selection when text is selected. Output opens in a single reusable QQL output channel.

CommandDefault keybindingDescription
QQL: Explain Document / SelectionCtrl+K Ctrl+EPlan for the document or selection
QQL: Compile to REST RouteCtrl+K Ctrl+RCompiled route JSON
QQL: Copy as curlCtrl+K Ctrl+CClipboard curl command using qql.baseUrl
QQL: Show ASTNoneParsed AST as JSON
QQL: Re-analyze DocumentNone (click the status bar)Force a fresh parse

The title bar and the right click QQL submenu expose the same commands.

The extension registers a document formatter (Shift+Alt+F, or Format Document from the command palette). It runs the source through the bundled canonical formatter, the same AST-based formatter as qql fmt and the WASM formatQuery(), so clause order, keyword casing, whitespace, and escaping are normalized. Unparseable documents are left untouched; diagnostics report the syntax error instead.

The outline and breadcrumbs list every top-level statement with its kind and collection, with CTE definitions nested underneath. Folding covers multiline statements, parenthesized regions, comment blocks, and -- #region markers. Go to Definition jumps from a CTE reference inside PREFETCH back to its name AS ( definition.

Completions cover 130+ keywords and 28 statement snippet templates, including:

  • QUERY NEAREST / QUERY HYBRID / QUERY HYBRID DBSF
  • CTE + FUSION and CTE + RERANK
  • QUERY RECOMMEND, QUERY MMR, QUERY FORMULA
  • QUERY POINTS, QUERY ORDER BY, QUERY SAMPLE
  • UPSERT INTO, CREATE COLLECTION, CREATE INDEX
  • SCROLL, COUNT, COUNT EXACT, DELETE, DELETE PAYLOAD

Suggestions are contextual: modes after QUERY, fusion methods after FUSION, index types after TYPE. Collection names are harvested from the open file, and CTE names are suggested inside PREFETCH. Snippet prefixes include qnearest, qhybrid, qcte, qcreate, qcreatemem, qupsert, qcross, qcount, qrecommend, qquota, qsetquota, qprefix, and qslice.

SettingDefaultDescription
qql.diagnostics.debounceMs300Delay in ms before re-analyzing after edits
qql.codeLens.enabledtrueStatement CodeLens actions
qql.baseUrlhttp://localhost:6333Base URL used when generating curl commands

The extension ships a standard VS Code language configuration: Ctrl+/ toggles -- line comments, brackets {} [] () are matched and auto-closed, and single and double quotes auto-close as well.