@@ -68,19 +68,19 @@ def get_completer(cursor_offset, current_line, locals_, argspec, full_code, mode
6868 kwargs = {'locals_' :locals_ , 'argspec' :argspec , 'full_code' :full_code ,
6969 'mode' :mode , 'complete_magic_methods' :complete_magic_methods }
7070
71+ # mutually exclusive if matches: If one of these returns [], try the next one
72+ for completer in [DictKeyCompletion ]:
73+ matches = completer .matches (cursor_offset , current_line , ** kwargs )
74+ if matches :
75+ return sorted (set (matches )), completer
76+
7177 # mutually exclusive matchers: if one returns [], don't go on
7278 for completer in [StringLiteralAttrCompletion , ImportCompletion ,
7379 FilenameCompletion , MagicMethodCompletion , GlobalCompletion ]:
7480 matches = completer .matches (cursor_offset , current_line , ** kwargs )
7581 if matches is not None :
7682 return sorted (set (matches )), completer
7783
78- # mutually exclusive if matches: If one of these returns [], try the next one
79- for completer in [DictKeyCompletion ]:
80- matches = completer .matches (cursor_offset , current_line , ** kwargs )
81- if matches :
82- return sorted (set (matches )), completer
83-
8484 matches = AttrCompletion .matches (cursor_offset , current_line , ** kwargs )
8585
8686 # cumulative completions - try them all
0 commit comments