A Visual Studio Code extension for Microsoft's Keyword Query Language (KeyQL / KQL) — syntax highlighting plus a document formatter.
From a terminal:
code --install-extension keql-syntax-0.1.0.vsix
Or from inside VS Code:
Cmd/Ctrl+Shift+X).… menu at the top of the panel..keql or .kql file.The color scheme mirrors SQL, so it looks familiar in whatever theme you already use.
| Element | Example |
|---|---|
| Logical operators | AND OR NOT |
| Proximity / ranking | NEAR ONEAR XRANK WORDS |
| Property names | author: filetype: size |
| Comparison operators | : = <> < > <= >= |
| Quoted phrases | "exact phrase" |
| Numbers and dates | 1024 2026-01-01 |
| Booleans | true false |
| Wildcards | report* |
| Comments | // … |
Run Format Document to normalize operator casing and spacing and break grouped expressions onto indented lines:
(author:"Jane" OR author:"John") AND NOT filetype:pdf
becomes
(
author:"Jane"
OR author:"John"
)
AND NOT filetype:pdf
To format on save, add "[keql]": { "editor.formatOnSave": true } to your settings.