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

Method completedefault

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

Source from the content-addressed store, hash-verified

1239 return self.completedefault(text, line, begidx, endidx)
1240
1241 def completedefault(self, text, line, begidx, endidx):
1242 if text.startswith("$"):
1243 # Complete convenience variables
1244 conv_vars = self.curframe.f_globals.get('__pdb_convenience_variables', {})
1245 return [f"${name}" for name in conv_vars if name.startswith(text[1:])]
1246
1247 state = 0
1248 matches = []
1249 completer = self.rlcompleter(self.curframe.f_globals | self.curframe.f_locals)
1250 while (match := completer.complete(text, state)) is not None:
1251 matches.append(match)
1252 state += 1
1253 return matches
1254
1255 @contextmanager
1256 def _enable_rlcompleter(self, ns):

Callers 2

completenamesMethod · 0.95

Calls 5

rlcompleterMethod · 0.95
startswithMethod · 0.45
getMethod · 0.45
completeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected