Syntax highlighting support for SuperDB query languages:
- SPQ (SuperSQL) - The SuperDB query language
| Component | Location | Purpose |
|---|---|---|
| TextMate bundle | supersql/spq.tmbundle/ |
Syntax highlighting (regex-based) |
| LSP server | lsp/ |
Language server for completions, diagnostics (details) |
| Editor | Method | Status |
|---|---|---|
| JetBrains IDEs | TextMate Bundles plugin | Working |
| VS Code | Extension (coming soon) | Planned |
| Sublime Text | TextMate bundle | Should work |
| GitHub | Linguist PR | Planned |
- Install the TextMate Bundles plugin
- Go to Settings → Editor → TextMate Bundles
- Click + and select the
supersql/spq.tmbundlefolder from this repository - Click Apply and OK
Note: After making changes to the grammar, you must reload the bundle:
Settings → TextMate Bundles → Remove → Apply → Re-add → Close
Copy the .tmb bundle folders to your Sublime Text Packages directory.
The grammar supports the full SuperSQL language as defined in the Super compiler:
// Single-line comment
-- SQL-style comment
/* Multi-line
block comment */const pi = 3.14159
func double(x): (x * 2)
op myOperator(): (over this | yield {result: x})from "data.json"
| where status == "active"
| cut name, email
| sort -timestamp
| head 10SELECT id, name, COUNT(*) AS total
FROM users
WHERE status = 'active'
GROUP BY category
HAVING total > 5
ORDER BY name ASC
LIMIT 100f"Hello, {name}!"
f'Count: {count(this)}'uint8, uint16, uint32, uint64, uint128, uint256
int8, int16, int32, int64, int128, int256
float16, float32, float64, float128, float256
decimal32, decimal64, decimal128, decimal256
bool, bytes, string, ip, net, type, null, duration, time, error|> // Pipe
:= // Assignment
:: :> // Type cast
... // Spread
== != <> // Comparison
&& || ! // LogicalThe TextMate grammar (spq.tmLanguage.json) is organized into these scopes:
| Scope | Description |
|---|---|
comment.* |
Comments (//, --, /* */) |
string.* |
String literals and f-strings |
constant.language.* |
true, false, null |
constant.numeric.* |
Numbers (int, float, hex) |
keyword.control.* |
const, func, op, type |
keyword.other.sql.* |
SQL keywords |
keyword.operator.* |
Operators |
support.function.* |
Built-in functions |
support.function.operator.* |
Pipeline operators |
support.function.aggregate.* |
Aggregate functions |
support.type.* |
Type names |
- Edit
supersql/spq.tmbundle/Syntaxes/spq.tmLanguage.json - Use
supersql/sample.spqto verify highlighting - Reload in your editor (see installation notes above)
Keywords are defined in the repository section of the grammar file. To add a new keyword:
- Find the appropriate category (
functions-builtin,sql-keywords, etc.) - Add the keyword to the regex pattern
- Test with a sample file
- VS Code extension
- GitHub Linguist PR for
.spqfile highlighting - Language Server Protocol (LSP) for rich IDE features
- IntelliJ native plugin
MIT