mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
make default suggestion if there is no suggestion from back-end.
Change-Id: Ic53c4c8ceb62d5e274307df360c35d351b7814a6
This commit is contained in:
parent
97f594dc85
commit
701f93f854
1 changed files with 10 additions and 1 deletions
|
|
@ -34,6 +34,7 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
|
|||
'ngInject';
|
||||
|
||||
let ANGULAR_FUNCTION_OBJECT_NAME_PREFIX = '_Z_ANGULAR_FUNC_';
|
||||
let completionListLength = undefined;
|
||||
$rootScope.keys = Object.keys;
|
||||
$scope.parentNote = null;
|
||||
$scope.paragraph = {};
|
||||
|
|
@ -750,6 +751,10 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
|
|||
// not applying emacs key binding while the binding override Ctrl-v. default behavior of paste text on windows.
|
||||
}
|
||||
|
||||
$scope.$on('completionListLength', function(event, data) {
|
||||
completionListLength = data;
|
||||
});
|
||||
|
||||
let remoteCompleter = {
|
||||
getCompletions: function(editor, session, pos, prefix, callback) {
|
||||
let langTools = ace.require('ace/ext/language_tools');
|
||||
|
|
@ -805,6 +810,7 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
|
|||
});
|
||||
}
|
||||
}
|
||||
$rootScope.$broadcast('completionListLength', completions.length);
|
||||
callback(null, completions);
|
||||
}
|
||||
});
|
||||
|
|
@ -1008,7 +1014,9 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
|
|||
|
||||
matches = matches.filter(function(item) {
|
||||
if (item.meta !== '') {
|
||||
return false;
|
||||
if (completionListLength !== 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
let caption = item.snippet || item.caption || item.value;
|
||||
if (caption === prev) {
|
||||
|
|
@ -1018,6 +1026,7 @@ function ParagraphCtrl($scope, $rootScope, $route, $window, $routeParams, $locat
|
|||
return true;
|
||||
});
|
||||
this.filtered = matches;
|
||||
completionListLength = undefined;
|
||||
};
|
||||
|
||||
const handleFocus = function(focused, isDigestPass) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue