Line data Source code
1 : import { EditorView } from '@codemirror/view';
2 :
3 : import { DashQLDecorationPlugin } from './dashql_decorations.js';
4 : import { DashQLProcessorPlugin, DashQLCompletionStartEffect } from './dashql_processor.js';
5 : import { DashQLCursorDiagnosticsPlugin } from './dashql_cursor_diagnostics.js';
6 : import { DashQLGutterPlugin } from './dashql_gutters.js';
7 : import { DashQLCompletionHintPlugin } from './dashql_completion_hint.js';
8 : import { DashQLCompletionListPlugin } from './dashql_completion_list.js';
9 : import { DashQLCompletionListenerPlugin } from './dashql_completion_listener.js';
10 : import { DashQLDiffDecorationPlugin } from './dashql_diff_decorations.js';
11 : import { DashQLDiffHintPlugin } from './dashql_diff_hint.js';
12 : import { DashQLAutoclosePlugin } from './dashql_autoclose.js';
13 : import { DashQLQuoteTombstonePlugin } from './dashql_quote_tombstone.js';
14 : import { DashQLVisFoldingPlugin } from './dashql_vis_folding.js';
15 : import { DashQLScriptReferencesPlugin } from './dashql_script_references.js';
16 :
17 : /// Starts a completion when an empty editor gains focus
18 1 : export const DashQLFocusCompletionEffect = EditorView.focusChangeEffect.of((state, focusing) => {
19 1 : if (!focusing || state.doc.length > 0) return null;
20 0 : return DashQLCompletionStartEffect.of(null);
21 1 : });
22 :
23 1 : export const DashQLExtensions = [
24 1 : DashQLProcessorPlugin,
25 1 : DashQLQuoteTombstonePlugin,
26 1 : DashQLAutoclosePlugin,
27 1 : DashQLFocusCompletionEffect,
28 1 : DashQLCompletionHintPlugin,
29 1 : DashQLCompletionListPlugin,
30 1 : DashQLCompletionListenerPlugin,
31 1 : DashQLDiffDecorationPlugin,
32 1 : DashQLDiffHintPlugin,
33 1 : DashQLScriptReferencesPlugin,
34 1 : DashQLDecorationPlugin,
35 1 : DashQLCursorDiagnosticsPlugin,
36 1 : DashQLGutterPlugin,
37 1 : DashQLVisFoldingPlugin,
38 1 : ];
39 :
40 1 : export const DashQLReadonlyExtensions = [
41 1 : DashQLProcessorPlugin,
42 1 : DashQLDecorationPlugin,
43 1 : DashQLCursorDiagnosticsPlugin,
44 1 : DashQLGutterPlugin,
45 1 : DashQLVisFoldingPlugin,
46 1 : ];
|