File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ class Autocomplete {
112
112
113
113
this . $firstOpenTimer = lang . delayedCall ( /**@this {Autocomplete}*/ function ( ) {
114
114
var initialPosition = this . completionProvider && this . completionProvider . initialPosition ;
115
- if ( this . autoShown || ( this . popup && this . popup . isOpen ) || ! initialPosition ) return ;
115
+ if ( this . autoShown || ( this . popup && this . popup . isOpen ) || ! initialPosition || this . editor . completers . length === 0 ) return ;
116
116
117
117
this . completions = new FilteredList ( Autocomplete . completionsForLoading ) ;
118
118
this . openPopup ( this . editor , initialPosition . prefix , false ) ;
Original file line number Diff line number Diff line change @@ -1328,6 +1328,19 @@ module.exports = {
1328
1328
1329
1329
done ( ) ;
1330
1330
} , 100 ) ;
1331
+ } ,
1332
+ "test: should not show loading state when empty completer array is provided" : function ( done ) {
1333
+ var editor = initEditor ( "" ) ;
1334
+ editor . completers = [ ] ;
1335
+ var completer = Autocomplete . for ( editor ) ;
1336
+ completer . showLoadingState = true ;
1337
+
1338
+ user . type ( "Ctrl-Space" ) ;
1339
+
1340
+ // Tooltip should not be open
1341
+ assert . ok ( ! ( completer . popup && completer . popup . isOpen ) ) ;
1342
+
1343
+ done ( ) ;
1331
1344
}
1332
1345
} ;
1333
1346
You can’t perform that action at this time.
0 commit comments