feat: add separate endpoint to fetch function names for autocomplete (#12840)

* WIP

* Add unit test for API

* Add spec

* Fix unit test

* Fix unit test

* Fix test

* Fix test

* Add period to error message
This commit is contained in:
Beto Dealmeida
2021-02-02 18:01:01 -08:00
committed by GitHub
parent 8553543ab0
commit ab3f4bd94b
10 changed files with 113 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ type HotKey = {
interface Props {
actions: {
queryEditorSetSelectedText: (edit: any, text: null | string) => void;
queryEditorSetFunctionNames: (queryEditor: object, dbId: number) => void;
addTable: (queryEditor: any, value: any, schema: any) => void;
};
autocomplete: boolean;
@@ -85,6 +86,10 @@ class AceEditorWrapper extends React.PureComponent<Props, State> {
componentDidMount() {
// Making sure no text is selected from previous mount
this.props.actions.queryEditorSetSelectedText(this.props.queryEditor, null);
this.props.actions.queryEditorSetFunctionNames(
this.props.queryEditor,
this.props.queryEditor.dbId,
);
this.setAutoCompleter(this.props);
}