sql-editor.ts46 lines · main
1// @ts-nocheck
2import { RegistryDefinations } from '../types'
3
4export const SQL_EDITOR_SHORTCUT_IDS = {
5 SQL_EDITOR_BLUR_EDITOR: 'sql-editor.blur-editor',
6 SQL_EDITOR_FOCUS_EDITOR: 'sql-editor.focus-editor',
7 SQL_EDITOR_FORMAT: 'sql-editor.format',
8 SQL_EDITOR_EXPLAIN: 'sql-editor.explain',
9 SQL_EDITOR_NEW_SNIPPET: 'sql-editor.new-snippet',
10}
11
12export type SqlEditorShortcutId =
13 (typeof SQL_EDITOR_SHORTCUT_IDS)[keyof typeof SQL_EDITOR_SHORTCUT_IDS]
14
15export const sqlEditorRegistry: RegistryDefinations<SqlEditorShortcutId> = {
16 [SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_BLUR_EDITOR]: {
17 id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_BLUR_EDITOR,
18 label: 'Blur SQL editor',
19 sequence: ['Escape'],
20 showInSettings: false,
21 },
22 [SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FOCUS_EDITOR]: {
23 id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FOCUS_EDITOR,
24 label: 'Focus SQL editor',
25 sequence: ['Shift+E'],
26 showInSettings: false,
27 },
28 [SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FORMAT]: {
29 id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_FORMAT,
30 label: 'Prettify SQL',
31 sequence: ['Alt+Shift+F'],
32 showInSettings: false,
33 },
34 [SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_EXPLAIN]: {
35 id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_EXPLAIN,
36 label: 'Run EXPLAIN ANALYZE',
37 sequence: ['Mod+Shift+Enter'],
38 showInSettings: false,
39 },
40 [SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_NEW_SNIPPET]: {
41 id: SQL_EDITOR_SHORTCUT_IDS.SQL_EDITOR_NEW_SNIPPET,
42 label: 'New SQL snippet',
43 sequence: ['Shift+N'],
44 showInSettings: false,
45 },
46}