Added setCompleters(...) function
Added setCompleters() method, so that completers can be explicitly set from a pre-populated array, or can be removed entirely (if null is passed, or setCompleters() is called without an argument or an empty array is passed. Please check this carefully for rookie JavaScript bugs, as I'm not sure if the null/undefined test is best-practise here as I don't typically code in JavaScript in my day-job.
This commit is contained in:
parent
9b8385b07d
commit
28b95df12c
1 changed files with 8 additions and 2 deletions
|
|
@ -67,8 +67,14 @@ var snippetCompleter = {
|
|||
}
|
||||
};
|
||||
|
||||
exports.removeCompleters = function() {
|
||||
completers = [];
|
||||
// Allows default completers to be removed or replaced with a explict set of completers
|
||||
// A null argument here will result in an empty completer array, not a null attribute
|
||||
exports.setCompleters = function(val) {
|
||||
if (val == null || val == undefined || (!(val instanceof Array)) ) {
|
||||
completers = [];
|
||||
} else {
|
||||
completers = val;
|
||||
}
|
||||
};
|
||||
|
||||
var completers = [snippetCompleter, textCompleter, keyWordCompleter];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue