MCPcopy Index your code
hub / github.com/python/cpython / _complete_location

Method _complete_location

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

Source from the content-addressed store, hash-verified

1166 return self.completedefault(text, line, begidx, endidx)
1167
1168 def _complete_location(self, text, line, begidx, endidx):
1169 # Complete a file/module/function location for break/tbreak/clear.
1170 if line.strip().endswith((':', ',')):
1171 # Here comes a line number or a condition which we can't complete.
1172 return []
1173 # First, try to find matching functions (i.e. expressions).
1174 try:
1175 ret = self._complete_expression(text, line, begidx, endidx)
1176 except Exception:
1177 ret = []
1178 # Then, try to complete file names as well.
1179 globs = glob.glob(glob.escape(text) + '*')
1180 for fn in globs:
1181 if os.path.isdir(fn):
1182 ret.append(fn + '/')
1183 elif os.path.isfile(fn) and fn.lower().endswith(('.py', '.pyw')):
1184 ret.append(fn + ':')
1185 return ret
1186
1187 def _complete_bpnumber(self, text, line, begidx, endidx):
1188 # Complete a breakpoint number. (This would be more helpful if we could

Callers

nothing calls this directly

Calls 9

_complete_expressionMethod · 0.95
escapeMethod · 0.80
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