Move autocomplete constant to autocomplete module
parent
ff44951c45
commit
df4d926d55
|
@ -5,8 +5,7 @@ import {EditorChange, LineWidget} from 'codemirror'
|
||||||
import {ShowHintOptions} from 'src/types/codemirror'
|
import {ShowHintOptions} from 'src/types/codemirror'
|
||||||
import {ErrorHandling} from 'src/shared/decorators/errors'
|
import {ErrorHandling} from 'src/shared/decorators/errors'
|
||||||
import {OnChangeScript, Suggestion} from 'src/types/flux'
|
import {OnChangeScript, Suggestion} from 'src/types/flux'
|
||||||
import {EXCLUDED_KEYS} from 'src/flux/constants/editor'
|
import {getSuggestions, EXCLUDED_KEYS} from 'src/flux/helpers/autoComplete'
|
||||||
import {getSuggestions} from 'src/flux/helpers/autoComplete'
|
|
||||||
import 'src/external/codemirror'
|
import 'src/external/codemirror'
|
||||||
|
|
||||||
interface Gutter {
|
interface Gutter {
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
export const EXCLUDED_KEYS = [
|
|
||||||
'ArrowRight',
|
|
||||||
'ArrowLeft',
|
|
||||||
'ArrowDown',
|
|
||||||
'ArrowUp',
|
|
||||||
'Backspace',
|
|
||||||
'Tab',
|
|
||||||
'Enter',
|
|
||||||
'Shift',
|
|
||||||
'Ctrl',
|
|
||||||
'Control',
|
|
||||||
'Alt',
|
|
||||||
'Pause',
|
|
||||||
'Capslock',
|
|
||||||
'Escape',
|
|
||||||
'Pageup',
|
|
||||||
'Pagedown',
|
|
||||||
'End',
|
|
||||||
'Home',
|
|
||||||
'Left',
|
|
||||||
'Up',
|
|
||||||
'Right',
|
|
||||||
'Down',
|
|
||||||
'Insert',
|
|
||||||
'Delete',
|
|
||||||
'Left window key',
|
|
||||||
'Right window key',
|
|
||||||
'Select',
|
|
||||||
'Add',
|
|
||||||
'Subtract',
|
|
||||||
'Decimal point',
|
|
||||||
'Divide',
|
|
||||||
'>',
|
|
||||||
'|',
|
|
||||||
')',
|
|
||||||
'F1',
|
|
||||||
'F2',
|
|
||||||
'F3',
|
|
||||||
'F4',
|
|
||||||
'F5',
|
|
||||||
'F6',
|
|
||||||
'F7',
|
|
||||||
'F8',
|
|
||||||
'F9',
|
|
||||||
'F10',
|
|
||||||
'F11',
|
|
||||||
'F12',
|
|
||||||
'Numlock',
|
|
||||||
'Scrolllock',
|
|
||||||
'Semicolon',
|
|
||||||
'Equalsign',
|
|
||||||
'Comma',
|
|
||||||
'Dash',
|
|
||||||
'Slash',
|
|
||||||
'Graveaccent',
|
|
||||||
'Backslash',
|
|
||||||
'Quote',
|
|
||||||
'Meta',
|
|
||||||
' ',
|
|
||||||
]
|
|
||||||
|
|
||||||
export const DEFAULT_SCRIPT = ''
|
|
|
@ -1,9 +1,8 @@
|
||||||
import {ast} from 'src/flux/constants/ast'
|
import {ast} from 'src/flux/constants/ast'
|
||||||
import * as editor from 'src/flux/constants/editor'
|
|
||||||
import * as argTypes from 'src/flux/constants/argumentTypes'
|
import * as argTypes from 'src/flux/constants/argumentTypes'
|
||||||
import * as vis from 'src/flux/constants/vis'
|
import * as vis from 'src/flux/constants/vis'
|
||||||
import * as explorer from 'src/flux/constants/explorer'
|
import * as explorer from 'src/flux/constants/explorer'
|
||||||
|
|
||||||
const MAX_RESPONSE_BYTES = 1e7 // 10 MB
|
const MAX_RESPONSE_BYTES = 1e7 // 10 MB
|
||||||
|
|
||||||
export {ast, argTypes, editor, vis, explorer, MAX_RESPONSE_BYTES}
|
export {ast, argTypes, vis, explorer, MAX_RESPONSE_BYTES}
|
||||||
|
|
|
@ -3,6 +3,66 @@ import {IInstance} from 'react-codemirror2'
|
||||||
import {Suggestion} from 'src/types/flux'
|
import {Suggestion} from 'src/types/flux'
|
||||||
import {Hints} from 'src/types/codemirror'
|
import {Hints} from 'src/types/codemirror'
|
||||||
|
|
||||||
|
export const EXCLUDED_KEYS = [
|
||||||
|
'ArrowRight',
|
||||||
|
'ArrowLeft',
|
||||||
|
'ArrowDown',
|
||||||
|
'ArrowUp',
|
||||||
|
'Backspace',
|
||||||
|
'Tab',
|
||||||
|
'Enter',
|
||||||
|
'Shift',
|
||||||
|
'Ctrl',
|
||||||
|
'Control',
|
||||||
|
'Alt',
|
||||||
|
'Pause',
|
||||||
|
'Capslock',
|
||||||
|
'Escape',
|
||||||
|
'Pageup',
|
||||||
|
'Pagedown',
|
||||||
|
'End',
|
||||||
|
'Home',
|
||||||
|
'Left',
|
||||||
|
'Up',
|
||||||
|
'Right',
|
||||||
|
'Down',
|
||||||
|
'Insert',
|
||||||
|
'Delete',
|
||||||
|
'Left window key',
|
||||||
|
'Right window key',
|
||||||
|
'Select',
|
||||||
|
'Add',
|
||||||
|
'Subtract',
|
||||||
|
'Decimal point',
|
||||||
|
'Divide',
|
||||||
|
'>',
|
||||||
|
'|',
|
||||||
|
')',
|
||||||
|
'F1',
|
||||||
|
'F2',
|
||||||
|
'F3',
|
||||||
|
'F4',
|
||||||
|
'F5',
|
||||||
|
'F6',
|
||||||
|
'F7',
|
||||||
|
'F8',
|
||||||
|
'F9',
|
||||||
|
'F10',
|
||||||
|
'F11',
|
||||||
|
'F12',
|
||||||
|
'Numlock',
|
||||||
|
'Scrolllock',
|
||||||
|
'Semicolon',
|
||||||
|
'Equalsign',
|
||||||
|
'Comma',
|
||||||
|
'Dash',
|
||||||
|
'Slash',
|
||||||
|
'Graveaccent',
|
||||||
|
'Backslash',
|
||||||
|
'Quote',
|
||||||
|
'Meta',
|
||||||
|
]
|
||||||
|
|
||||||
export const getSuggestions = (
|
export const getSuggestions = (
|
||||||
editor: IInstance,
|
editor: IInstance,
|
||||||
allSuggestions: Suggestion[]
|
allSuggestions: Suggestion[]
|
||||||
|
|
Loading…
Reference in New Issue