diff --git a/client/app/components/queries/query-editor.js b/client/app/components/queries/query-editor.js index 770bc4b48c..665f4776ff 100644 --- a/client/app/components/queries/query-editor.js +++ b/client/app/components/queries/query-editor.js @@ -119,7 +119,7 @@ function queryEditor(QuerySnippet) { newSchema.reduce((totalLength, table) => totalLength + table.columns.length, 0); // If there are too many tokens we disable live autocomplete, // as it makes typing slower. - if (tokensCount > 5000) { + if (tokensCount > 5000 || !$scope.$parent.editorAutocomplete) { editor.setOption('enableLiveAutocompletion', false); editor.setOption('enableBasicAutocompletion', false); } else { @@ -132,6 +132,10 @@ function queryEditor(QuerySnippet) { $scope.$parent.$on('angular-resizable.resizing', () => { editor.resize(); }); + $scope.$parent.$watch('editorAutocomplete', () => { + editor.setOption('enableLiveAutocompletion', $scope.$parent.editorAutocomplete); + editor.setOption('enableBasicAutocompletion', $scope.$parent.editorAutocomplete); + }); editor.focus(); }, diff --git a/client/app/pages/queries/query.html b/client/app/pages/queries/query.html index ac4a9476c5..bf42da0d7d 100644 --- a/client/app/pages/queries/query.html +++ b/client/app/pages/queries/query.html @@ -107,6 +107,10 @@

{{ dataSource.type_name }} documentation + + Enable Autocomplete + +