davidhalter/jedi — pull request #106 by dbrgn (2013-01-03 22:16:56+00:00)
Title: Added quick_complete convenience function

I'd like to have a `quick_complete(source)` convenience function shipped with jedi. The purpose is to complete a source string at its end.

Reasons:

```
>>> import jedi
>>> source = '''import json; json.l'''
>>> script = jedi.Script(source, 1, 19, '')
>>> completions = script.complete()
```
vs
```
>>> import jedi
>>> source = '''import json; json.l'''
>>> completions = jedi.quick_complete(source)
```

The main use is surely testing and debugging. It's very easy to quickly see the completions for a specific test string.

I'm pretty sure there are also use cases outside of dev and debugging. If there are, then the function should be in `api.py` (-> `jedi.quick_complete`). Otherwise, I'd suggest either `api._quick_complete` or `utils.quick_complete`.

Opinions?