| 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 |