MCPcopy Index your code
hub / github.com/RustPython/RustPython / _complete_location

Method _complete_location

Lib/pdb.py:474–491  ·  view source on GitHub ↗
(self, text, line, begidx, endidx)

Source from the content-addressed store, hash-verified

472 # assigned below to one of these functions.
473
474 def _complete_location(self, text, line, begidx, endidx):
475 # Complete a file/module/function location for break/tbreak/clear.
476 if line.strip().endswith((':', ',')):
477 # Here comes a line number or a condition which we can't complete.
478 return []
479 # First, try to find matching functions (i.e. expressions).
480 try:
481 ret = self._complete_expression(text, line, begidx, endidx)
482 except Exception:
483 ret = []
484 # Then, try to complete file names as well.
485 globs = glob.glob(text + '*')
486 for fn in globs:
487 if os.path.isdir(fn):
488 ret.append(fn + '/')
489 elif os.path.isfile(fn) and fn.lower().endswith(('.py', '.pyw')):
490 ret.append(fn + ':')
491 return ret
492
493 def _complete_bpnumber(self, text, line, begidx, endidx):
494 # Complete a breakpoint number. (This would be more helpful if we could

Callers

nothing calls this directly

Calls 8

_complete_expressionMethod · 0.95
endswithMethod · 0.45
stripMethod · 0.45
globMethod · 0.45
isdirMethod · 0.45
appendMethod · 0.45
isfileMethod · 0.45
lowerMethod · 0.45

Tested by

no test coverage detected