@innovatorved/code-lab 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +8 -4
- package/CHANGELOG.md +45 -0
- package/README.md +70 -158
- package/dist/apps/web/src/index.d.ts +34 -0
- package/dist/code-lab-sql.css +482 -0
- package/dist/code-lab-sql.d.ts +179 -0
- package/dist/code-lab-sql.esm.js +542 -0
- package/dist/code-lab-sql.umd.js +531 -0
- package/dist/code-lab.css +298 -2
- package/dist/code-lab.d.ts +110 -15
- package/dist/code-lab.esm.js +35284 -18253
- package/dist/code-lab.js +40434 -23431
- package/dist/code-lab.umd.js +65502 -0
- package/dist/diagnostics.d.ts +5 -0
- package/dist/extensions/cpp.esm.js +19532 -3772
- package/dist/extensions/cpp.js +19529 -3769
- package/dist/extensions/guided-lab.esm.js +19401 -3725
- package/dist/extensions/guided-lab.js +19400 -3724
- package/dist/extensions/python.d.ts +1 -0
- package/dist/extensions/python.esm.js +19666 -3843
- package/dist/extensions/python.js +19668 -3845
- package/dist/extensions/umbrella.d.ts +5 -0
- package/dist/index.d.ts +1 -1
- package/dist/modular-kernel.d.ts +11 -0
- package/dist/packages/commands/src/index.d.ts +96 -0
- package/dist/packages/core/src/di.d.ts +36 -0
- package/dist/packages/core/src/disposable.d.ts +27 -0
- package/dist/packages/core/src/errors.d.ts +69 -0
- package/dist/packages/core/src/events.d.ts +38 -0
- package/dist/packages/core/src/index.d.ts +6 -0
- package/dist/packages/core/src/path.d.ts +14 -0
- package/dist/packages/core/src/registry.d.ts +23 -0
- package/dist/packages/editor/src/index.d.ts +118 -0
- package/dist/packages/fs/src/backends.d.ts +37 -0
- package/dist/packages/fs/src/index.d.ts +3 -0
- package/dist/packages/fs/src/types.d.ts +40 -0
- package/dist/packages/fs/src/vfs-service.d.ts +33 -0
- package/dist/packages/preview/src/index.d.ts +34 -0
- package/dist/packages/runtime/src/index.d.ts +47 -0
- package/dist/packages/settings/src/builtin-schemas.d.ts +15 -0
- package/dist/packages/settings/src/configuration-service.d.ts +100 -0
- package/dist/packages/settings/src/index.d.ts +4 -0
- package/dist/packages/settings/src/jsonc.d.ts +20 -0
- package/dist/packages/settings/src/schema.d.ts +28 -0
- package/dist/packages/sql/src/completions.d.ts +8 -0
- package/dist/packages/sql/src/diagnostics.d.ts +2 -0
- package/dist/packages/sql/src/formatter.d.ts +2 -0
- package/dist/packages/sql/src/index.d.ts +7 -0
- package/dist/packages/sql/src/sql-editor.d.ts +2 -0
- package/dist/packages/sql/src/styles.d.ts +2 -0
- package/dist/packages/sql/src/tokenizer.d.ts +13 -0
- package/dist/packages/sql/src/types.d.ts +130 -0
- package/dist/packages/terminal/src/index.d.ts +54 -0
- package/dist/packages/ui/src/index.d.ts +4 -0
- package/dist/packages/ui/src/observability.d.ts +22 -0
- package/dist/packages/ui/src/plugin-registry.d.ts +89 -0
- package/dist/packages/ui/src/settings-dialog.d.ts +25 -0
- package/dist/packages/ui/src/themes.d.ts +35 -0
- package/dist/preview-sw.js +82 -24
- package/dist/runtime.d.ts +3 -3
- package/dist/runtime.esm.js +503 -73
- package/dist/runtime.js +501 -73
- package/dist/schemas.d.ts +234 -814
- package/dist/schemas.esm.js +19401 -3725
- package/dist/schemas.js +19404 -3728
- package/dist/scm.d.ts +13 -2
- package/dist/search.d.ts +5 -1
- package/dist/shell.d.ts +1 -1
- package/dist/shell.esm.js +435 -54
- package/dist/shell.js +435 -54
- package/dist/terminal.esm.js +242 -54
- package/dist/terminal.js +242 -54
- package/dist/workbench/diff-editor.d.ts +1 -0
- package/dist/workbench/index.d.ts +1 -1
- package/dist/workbench/styles.d.ts +1 -1
- package/dist/zip.d.ts +4 -3
- package/package.json +37 -8
- package/packages/commands/README.md +7 -0
- package/packages/commands/package.json +16 -0
- package/packages/commands/src/index.ts +467 -0
- package/packages/commands/tsconfig.json +22 -0
- package/packages/core/README.md +12 -0
- package/packages/core/package.json +13 -0
- package/packages/core/src/di.ts +147 -0
- package/packages/core/src/disposable.ts +112 -0
- package/packages/core/src/errors.ts +205 -0
- package/packages/core/src/events.ts +157 -0
- package/packages/core/src/index.ts +49 -0
- package/packages/core/src/path.ts +118 -0
- package/packages/core/src/registry.ts +61 -0
- package/packages/core/tsconfig.json +19 -0
- package/packages/editor/README.md +9 -0
- package/packages/editor/package.json +18 -0
- package/packages/editor/src/index.ts +344 -0
- package/packages/editor/tsconfig.json +24 -0
- package/packages/fs/README.md +7 -0
- package/packages/fs/package.json +16 -0
- package/packages/fs/src/backends.ts +301 -0
- package/packages/fs/src/index.ts +18 -0
- package/packages/fs/src/types.ts +44 -0
- package/packages/fs/src/vfs-service.ts +257 -0
- package/packages/fs/tsconfig.json +22 -0
- package/packages/preview/README.md +3 -0
- package/packages/preview/package.json +16 -0
- package/packages/preview/src/index.ts +125 -0
- package/packages/preview/tsconfig.json +22 -0
- package/packages/runtime/README.md +3 -0
- package/packages/runtime/package.json +17 -0
- package/packages/runtime/src/index.ts +134 -0
- package/packages/runtime/tsconfig.json +23 -0
- package/packages/settings/README.md +7 -0
- package/packages/settings/package.json +16 -0
- package/packages/settings/src/builtin-schemas.ts +235 -0
- package/packages/settings/src/configuration-service.ts +543 -0
- package/packages/settings/src/index.ts +37 -0
- package/packages/settings/src/jsonc.ts +189 -0
- package/packages/settings/src/schema.ts +164 -0
- package/packages/settings/tsconfig.json +22 -0
- package/packages/sql/README.md +12 -0
- package/packages/sql/package.json +13 -0
- package/packages/sql/src/completions.ts +359 -0
- package/packages/sql/src/diagnostics.ts +200 -0
- package/packages/sql/src/formatter.ts +271 -0
- package/packages/sql/src/index.ts +54 -0
- package/packages/sql/src/sql-editor.ts +802 -0
- package/packages/sql/src/styles.ts +501 -0
- package/packages/sql/src/tokenizer.ts +457 -0
- package/packages/sql/src/types.ts +148 -0
- package/packages/sql/tsconfig.json +19 -0
- package/packages/terminal/README.md +3 -0
- package/packages/terminal/package.json +16 -0
- package/packages/terminal/src/index.ts +183 -0
- package/packages/terminal/tsconfig.json +22 -0
- package/packages/ui/README.md +8 -0
- package/packages/ui/package.json +18 -0
- package/packages/ui/src/index.ts +36 -0
- package/packages/ui/src/observability.ts +175 -0
- package/packages/ui/src/plugin-registry.ts +274 -0
- package/packages/ui/src/settings-dialog.ts +293 -0
- package/packages/ui/src/themes.ts +174 -0
- package/packages/ui/tsconfig.json +24 -0
- package/src/code-lab.css +298 -2
- package/src/csp.ts +7 -10
- package/src/diagnostics.ts +42 -3
- package/src/extensions/cpp.ts +105 -24
- package/src/extensions/python.ts +260 -116
- package/src/extensions/umbrella.ts +5 -0
- package/src/index.ts +1 -1
- package/src/modular-kernel.ts +11 -0
- package/src/preview-sw.js +73 -12
- package/src/runtime.ts +501 -74
- package/src/schemas.ts +62 -62
- package/src/scm.ts +106 -19
- package/src/search.ts +71 -27
- package/src/shell.ts +433 -53
- package/src/terminal.ts +239 -52
- package/src/workbench/diff-editor.ts +106 -18
- package/src/workbench/drawer.ts +17 -4
- package/src/workbench/guided-pane.ts +12 -2
- package/src/workbench/icons.ts +5 -2
- package/src/workbench/share.ts +37 -8
- package/src/workbench/styles.ts +2 -1
- package/src/workbench/toolbar.ts +15 -4
- package/src/workbench.ts +2877 -284
- package/src/zip.ts +29 -7
- package/dist/runtime/index.d.ts +0 -4
- package/dist/shell/coreutils/compilers-cli.d.ts +0 -24
- package/dist/shell/index.d.ts +0 -4
- package/src/runtime/index.ts +0 -5
- package/src/shell/coreutils/compilers-cli.ts +0 -103
- package/src/shell/index.ts +0 -5
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { tokenizeSql, type SqlToken } from './tokenizer';
|
|
2
|
+
import type { SqlDialect, SqlFormatOptions } from './types';
|
|
3
|
+
|
|
4
|
+
const MAJOR_CLAUSES = new Set([
|
|
5
|
+
'SELECT', 'FROM', 'WHERE', 'GROUP', 'HAVING', 'WINDOW', 'QUALIFY', 'ORDER',
|
|
6
|
+
'LIMIT', 'OFFSET', 'FETCH', 'VALUES', 'SET', 'RETURNING', 'UNION', 'INTERSECT',
|
|
7
|
+
'EXCEPT', 'INSERT', 'UPDATE', 'DELETE', 'WITH', 'EXPLAIN'
|
|
8
|
+
]);
|
|
9
|
+
|
|
10
|
+
const JOIN_MODIFIERS = new Set(['LEFT', 'RIGHT', 'INNER', 'FULL', 'CROSS', 'NATURAL', 'LATERAL']);
|
|
11
|
+
|
|
12
|
+
function applyCase(word: string, mode: 'upper' | 'lower' | 'preserve'): string {
|
|
13
|
+
if (mode === 'upper') return word.toUpperCase();
|
|
14
|
+
if (mode === 'lower') return word.toLowerCase();
|
|
15
|
+
return word;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function formatSql(sql: string, options: SqlFormatOptions = {}): string {
|
|
19
|
+
const dialect: SqlDialect = options.dialect ?? 'postgres';
|
|
20
|
+
const indentSize = Math.max(1, Math.min(options.indent ?? 2, 8));
|
|
21
|
+
const keywordCase = options.keywordCase ?? 'upper';
|
|
22
|
+
const padUnit = ' '.repeat(indentSize);
|
|
23
|
+
|
|
24
|
+
const rawTokens = tokenizeSql(sql, dialect);
|
|
25
|
+
const meaningful: SqlToken[] = rawTokens.filter((t) => t.type !== 'whitespace');
|
|
26
|
+
if (meaningful.length === 0) return '';
|
|
27
|
+
|
|
28
|
+
const lines: string[] = [];
|
|
29
|
+
let currentLine = '';
|
|
30
|
+
let parenDepth = 0;
|
|
31
|
+
let inSelectList = false;
|
|
32
|
+
let pendingIndent = 0;
|
|
33
|
+
|
|
34
|
+
const flushLine = (): void => {
|
|
35
|
+
const trimmed = currentLine.replace(/[ \t]+$/g, '');
|
|
36
|
+
if (trimmed.length > 0) {
|
|
37
|
+
lines.push(trimmed);
|
|
38
|
+
}
|
|
39
|
+
currentLine = '';
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const ensureIndent = (extra = 0): void => {
|
|
43
|
+
if (currentLine.length === 0) {
|
|
44
|
+
currentLine = padUnit.repeat(Math.max(0, parenDepth + extra));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const appendSpaceIfNeeded = (): void => {
|
|
49
|
+
if (
|
|
50
|
+
currentLine.length > 0 &&
|
|
51
|
+
!/[\s([\].]$/.test(currentLine) &&
|
|
52
|
+
!currentLine.endsWith('::')
|
|
53
|
+
) {
|
|
54
|
+
currentLine += ' ';
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
for (let i = 0; i < meaningful.length; i++) {
|
|
59
|
+
const tok = meaningful[i];
|
|
60
|
+
const next = meaningful[i + 1];
|
|
61
|
+
const upper = tok.value.toUpperCase();
|
|
62
|
+
|
|
63
|
+
if (tok.type === 'comment') {
|
|
64
|
+
if (tok.value.startsWith('--')) {
|
|
65
|
+
appendSpaceIfNeeded();
|
|
66
|
+
currentLine += tok.value;
|
|
67
|
+
flushLine();
|
|
68
|
+
} else {
|
|
69
|
+
appendSpaceIfNeeded();
|
|
70
|
+
currentLine += tok.value;
|
|
71
|
+
}
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (tok.type === 'punctuation') {
|
|
76
|
+
if (tok.value === '(') {
|
|
77
|
+
const prev = meaningful[i - 1];
|
|
78
|
+
const prevIsFuncOrCast =
|
|
79
|
+
prev && (prev.type === 'function' || prev.type === 'identifier' || prev.type === 'type');
|
|
80
|
+
if (!prevIsFuncOrCast) {
|
|
81
|
+
appendSpaceIfNeeded();
|
|
82
|
+
}
|
|
83
|
+
currentLine += '(';
|
|
84
|
+
parenDepth++;
|
|
85
|
+
if (next && next.type === 'keyword' && (next.value.toUpperCase() === 'SELECT' || next.value.toUpperCase() === 'WITH')) {
|
|
86
|
+
flushLine();
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (tok.value === ')') {
|
|
91
|
+
parenDepth = Math.max(0, parenDepth - 1);
|
|
92
|
+
currentLine = currentLine.replace(/[ \t]+$/g, '');
|
|
93
|
+
currentLine += ')';
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (tok.value === ',') {
|
|
97
|
+
currentLine = currentLine.replace(/[ \t]+$/g, '');
|
|
98
|
+
currentLine += ',';
|
|
99
|
+
if (inSelectList && parenDepth === 0) {
|
|
100
|
+
flushLine();
|
|
101
|
+
pendingIndent = 1;
|
|
102
|
+
} else {
|
|
103
|
+
currentLine += ' ';
|
|
104
|
+
}
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
if (tok.value === ';') {
|
|
108
|
+
currentLine = currentLine.replace(/[ \t]+$/g, '');
|
|
109
|
+
currentLine += ';';
|
|
110
|
+
inSelectList = false;
|
|
111
|
+
pendingIndent = 0;
|
|
112
|
+
flushLine();
|
|
113
|
+
if (next) lines.push('');
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (tok.value === '.') {
|
|
117
|
+
currentLine = currentLine.replace(/[ \t]+$/g, '');
|
|
118
|
+
currentLine += '.';
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (tok.type === 'cast') {
|
|
124
|
+
currentLine = currentLine.replace(/[ \t]+$/g, '');
|
|
125
|
+
const castBody = tok.value.slice(2).trim();
|
|
126
|
+
currentLine += '::' + applyCase(castBody, keywordCase === 'upper' ? 'lower' : keywordCase);
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (tok.type === 'keyword') {
|
|
131
|
+
const formattedKw = applyCase(tok.value, keywordCase);
|
|
132
|
+
|
|
133
|
+
// Multi-word JOIN (`LEFT JOIN`, `LEFT OUTER JOIN`, `INNER JOIN`, `CROSS JOIN`, `LATERAL JOIN`)
|
|
134
|
+
if (JOIN_MODIFIERS.has(upper)) {
|
|
135
|
+
let lookIdx = i + 1;
|
|
136
|
+
let sawJoin = false;
|
|
137
|
+
while (lookIdx < meaningful.length && lookIdx <= i + 3) {
|
|
138
|
+
const w = meaningful[lookIdx].value.toUpperCase();
|
|
139
|
+
if (w === 'JOIN') {
|
|
140
|
+
sawJoin = true;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
if (w !== 'OUTER' && !JOIN_MODIFIERS.has(w)) break;
|
|
144
|
+
lookIdx++;
|
|
145
|
+
}
|
|
146
|
+
if (sawJoin && parenDepth === 0) {
|
|
147
|
+
inSelectList = false;
|
|
148
|
+
pendingIndent = 0;
|
|
149
|
+
flushLine();
|
|
150
|
+
ensureIndent(0);
|
|
151
|
+
currentLine += formattedKw;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (upper === 'JOIN' && parenDepth === 0) {
|
|
157
|
+
const prev = meaningful[i - 1];
|
|
158
|
+
const prevUpper = prev ? prev.value.toUpperCase() : '';
|
|
159
|
+
if (prevUpper !== 'OUTER' && !JOIN_MODIFIERS.has(prevUpper)) {
|
|
160
|
+
inSelectList = false;
|
|
161
|
+
pendingIndent = 0;
|
|
162
|
+
flushLine();
|
|
163
|
+
}
|
|
164
|
+
ensureIndent(0);
|
|
165
|
+
appendSpaceIfNeeded();
|
|
166
|
+
currentLine += formattedKw;
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// `ON CONFLICT` in Postgres / SQLite
|
|
171
|
+
if (upper === 'ON' && next && next.value.toUpperCase() === 'CONFLICT' && parenDepth === 0) {
|
|
172
|
+
inSelectList = false;
|
|
173
|
+
pendingIndent = 0;
|
|
174
|
+
flushLine();
|
|
175
|
+
ensureIndent(0);
|
|
176
|
+
currentLine += formattedKw;
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// `AND` / `OR` inside top-level WHERE / HAVING / ON
|
|
181
|
+
if ((upper === 'AND' || upper === 'OR') && parenDepth === 0) {
|
|
182
|
+
// Do not split `BETWEEN x AND y`
|
|
183
|
+
let isBetweenAnd = false;
|
|
184
|
+
if (upper === 'AND') {
|
|
185
|
+
for (let back = i - 1; back >= Math.max(0, i - 5); back--) {
|
|
186
|
+
const bw = meaningful[back].value.toUpperCase();
|
|
187
|
+
if (bw === 'BETWEEN') {
|
|
188
|
+
isBetweenAnd = true;
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
if (MAJOR_CLAUSES.has(bw)) break;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (!isBetweenAnd) {
|
|
195
|
+
flushLine();
|
|
196
|
+
ensureIndent(1);
|
|
197
|
+
currentLine += formattedKw;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Major top-level SQL clauses (`SELECT`, `FROM`, `WHERE`, `GROUP BY`, `ORDER BY`, ...)
|
|
203
|
+
if (MAJOR_CLAUSES.has(upper) && parenDepth <= 1) {
|
|
204
|
+
// Avoid breaking `GROUP` or `ORDER` if preceded by `WITHIN` or `OVER (`
|
|
205
|
+
const prev = meaningful[i - 1];
|
|
206
|
+
const prevUpper = prev ? prev.value.toUpperCase() : '';
|
|
207
|
+
const insideWindow =
|
|
208
|
+
parenDepth > 0 && (upper === 'ORDER' || upper === 'PARTITION' || prevUpper === '(');
|
|
209
|
+
if (!insideWindow && prevUpper !== 'WITHIN' && prevUpper !== 'DISTINCT') {
|
|
210
|
+
if (currentLine.trim().length > 0) {
|
|
211
|
+
flushLine();
|
|
212
|
+
}
|
|
213
|
+
inSelectList = upper === 'SELECT';
|
|
214
|
+
pendingIndent = 0;
|
|
215
|
+
ensureIndent(0);
|
|
216
|
+
currentLine += formattedKw;
|
|
217
|
+
if (upper === 'SELECT' && !(next && next.value.toUpperCase() === 'DISTINCT')) {
|
|
218
|
+
flushLine();
|
|
219
|
+
pendingIndent = 1;
|
|
220
|
+
}
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (upper === 'DISTINCT' && inSelectList && parenDepth === 0) {
|
|
226
|
+
ensureIndent(0);
|
|
227
|
+
appendSpaceIfNeeded();
|
|
228
|
+
currentLine += formattedKw;
|
|
229
|
+
if (!(next && next.value.toUpperCase() === 'ON')) {
|
|
230
|
+
flushLine();
|
|
231
|
+
pendingIndent = 1;
|
|
232
|
+
}
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
ensureIndent(pendingIndent);
|
|
237
|
+
appendSpaceIfNeeded();
|
|
238
|
+
currentLine += formattedKw;
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (tok.type === 'function' || tok.type === 'type') {
|
|
243
|
+
ensureIndent(pendingIndent);
|
|
244
|
+
appendSpaceIfNeeded();
|
|
245
|
+
currentLine += applyCase(tok.value, keywordCase);
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
ensureIndent(pendingIndent);
|
|
250
|
+
if (tok.type === 'operator' && (tok.value === '->' || tok.value === '->>' || tok.value === '#>' || tok.value === '#>>')) {
|
|
251
|
+
currentLine = currentLine.replace(/[ \t]+$/g, '');
|
|
252
|
+
currentLine += tok.value;
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
const prevTok = meaningful[i - 1];
|
|
256
|
+
if (
|
|
257
|
+
prevTok &&
|
|
258
|
+
prevTok.type === 'operator' &&
|
|
259
|
+
(prevTok.value === '->' || prevTok.value === '->>' || prevTok.value === '#>' || prevTok.value === '#>>')
|
|
260
|
+
) {
|
|
261
|
+
currentLine += tok.value;
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
appendSpaceIfNeeded();
|
|
266
|
+
currentLine += tok.value;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
flushLine();
|
|
270
|
+
return lines.join('\n');
|
|
271
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export {
|
|
2
|
+
type SqlDialect,
|
|
3
|
+
type SqlEditorMode,
|
|
4
|
+
type SqlThemeMode,
|
|
5
|
+
type SqlColumnSchema,
|
|
6
|
+
type SqlTableSchema,
|
|
7
|
+
type SqlFunctionSchema,
|
|
8
|
+
type SqlSchema,
|
|
9
|
+
type SqlDiagnostic,
|
|
10
|
+
type SqlRunPayload,
|
|
11
|
+
type SqlFormatOptions,
|
|
12
|
+
type SqlCompletionKind,
|
|
13
|
+
type SqlCompletionItem,
|
|
14
|
+
type SqlEditorOptions,
|
|
15
|
+
type SqlEditorInstance,
|
|
16
|
+
type SqlRunnerStepInfo,
|
|
17
|
+
type SqlRunnerRequest,
|
|
18
|
+
type SqlRunnerVerification,
|
|
19
|
+
type SqlRunnerResult,
|
|
20
|
+
type SqlRunnerFn
|
|
21
|
+
} from './types';
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
type SqlTokenType,
|
|
25
|
+
type SqlToken,
|
|
26
|
+
getDialectKeywords,
|
|
27
|
+
getSqlBuiltinFunctions,
|
|
28
|
+
tokenizeSql,
|
|
29
|
+
escapeSqlHtml,
|
|
30
|
+
highlightSql
|
|
31
|
+
} from './tokenizer';
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
formatSql
|
|
35
|
+
} from './formatter';
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
type ParsedSqlContext,
|
|
39
|
+
extractTableAliases,
|
|
40
|
+
completeSql
|
|
41
|
+
} from './completions';
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
parseSqlEngineError
|
|
45
|
+
} from './diagnostics';
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
SQL_EDITOR_CSS,
|
|
49
|
+
ensureSqlStylesInjected
|
|
50
|
+
} from './styles';
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
createSqlEditor
|
|
54
|
+
} from './sql-editor';
|