Move autocomplete constant to autocomplete module

pull/4593/head
Christopher Henn 2018-10-15 10:01:44 -07:00 committed by Chris Henn
parent ff44951c45
commit df4d926d55
4 changed files with 62 additions and 66 deletions

View File

@ -5,8 +5,7 @@ import {EditorChange, LineWidget} from 'codemirror'
import {ShowHintOptions} from 'src/types/codemirror'
import {ErrorHandling} from 'src/shared/decorators/errors'
import {OnChangeScript, Suggestion} from 'src/types/flux'
import {EXCLUDED_KEYS} from 'src/flux/constants/editor'
import {getSuggestions} from 'src/flux/helpers/autoComplete'
import {getSuggestions, EXCLUDED_KEYS} from 'src/flux/helpers/autoComplete'
import 'src/external/codemirror'
interface Gutter {

View File

@ -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 = ''

View File

@ -1,9 +1,8 @@
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 vis from 'src/flux/constants/vis'
import * as explorer from 'src/flux/constants/explorer'
const MAX_RESPONSE_BYTES = 1e7 // 10 MB
export {ast, argTypes, editor, vis, explorer, MAX_RESPONSE_BYTES}
export {ast, argTypes, vis, explorer, MAX_RESPONSE_BYTES}

View File

@ -3,6 +3,66 @@ import {IInstance} from 'react-codemirror2'
import {Suggestion} from 'src/types/flux'
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 = (
editor: IInstance,
allSuggestions: Suggestion[]