@@ -170,7 +170,7 @@ def matches(self, cursor_offset, line, **kwargs):
170170 * determine whether suggestions should be `shown_before_tab`
171171 * `substitute(cur, line, match)` in a match for what's found with
172172 `target`
173- """
173+ """
174174 raise NotImplementedError
175175
176176 def locate (self , cursor_offset , line ):
@@ -315,8 +315,7 @@ def format(self, word):
315315 return after_last_dot (word )
316316
317317 def attr_matches (self , text , namespace ):
318- """Taken from rlcompleter.py and bent to my will.
319- """
318+ """Taken from rlcompleter.py and bent to my will."""
320319
321320 m = self .attr_matches_re .match (text )
322321 if not m :
@@ -377,9 +376,7 @@ def matches(self, cursor_offset, line, **kwargs):
377376 return None
378377 if isinstance (obj , dict ) and obj .keys ():
379378 matches = {
380- f"{ k !r} ]"
381- for k in obj .keys ()
382- if repr (k ).startswith (r .word )
379+ f"{ k !r} ]" for k in obj .keys () if repr (k ).startswith (r .word )
383380 }
384381 return matches if matches else None
385382 else :
@@ -462,9 +459,7 @@ def matches(self, cursor_offset, line, **kwargs):
462459 if isinstance (name , str ) and name .startswith (r .word )
463460 }
464461 matches .update (
465- name + "="
466- for name in argspec [1 ][4 ]
467- if name .startswith (r .word )
462+ name + "=" for name in argspec [1 ][4 ] if name .startswith (r .word )
468463 )
469464 return matches if matches else None
470465
@@ -519,10 +514,10 @@ def matches(self, cursor_offset, line, **kwargs):
519514 history = "\n " .join (history ) + "\n " + line
520515
521516 try :
522- script = jedi .Script (
523- history , path = "fake.py"
517+ script = jedi .Script (history , path = "fake.py" )
518+ completions = script .complete (
519+ len (history .splitlines ()), cursor_offset
524520 )
525- completions = script .complete (len (history .splitlines ()), cursor_offset )
526521 except (jedi .NotFoundError , IndexError , KeyError ):
527522 # IndexError for #483
528523 # KeyError for #544
@@ -566,9 +561,7 @@ def matches(self, cursor_offset, line, **kwargs):
566561 cursor_offset ,
567562 line ,
568563 )
569- results = super ().matches (
570- cursor_offset , line , history = history
571- )
564+ results = super ().matches (cursor_offset , line , history = history )
572565 return results
573566 else :
574567 return None
0 commit comments