MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _complete_location

Method _complete_location

tools/python-3.11.9-amd64/Lib/pdb.py:525–542  ·  view source on GitHub ↗
(self, text, line, begidx, endidx)

Source from the content-addressed store, hash-verified

523 # assigned below to one of these functions.
524
525 def _complete_location(self, text, line, begidx, endidx):
526 # Complete a file/module/function location for break/tbreak/clear.
527 if line.strip().endswith((':', ',')):
528 # Here comes a line number or a condition which we can't complete.
529 return []
530 # First, try to find matching functions (i.e. expressions).
531 try:
532 ret = self._complete_expression(text, line, begidx, endidx)
533 except Exception:
534 ret = []
535 # Then, try to complete file names as well.
536 globs = glob.glob(glob.escape(text) + '*')
537 for fn in globs:
538 if os.path.isdir(fn):
539 ret.append(fn + '/')
540 elif os.path.isfile(fn) and fn.lower().endswith(('.py', '.pyw')):
541 ret.append(fn + ':')
542 return ret
543
544 def _complete_bpnumber(self, text, line, begidx, endidx):
545 # Complete a breakpoint number. (This would be more helpful if we could

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected