diff --git a/README.rst b/README.rst index 7c90f8b7..d2cd3556 100644 --- a/README.rst +++ b/README.rst @@ -128,9 +128,9 @@ Autocompletion / Goto / Pydoc Please check the API for a good explanation. There are the following commands: -- ``jedi.Script.goto_assignments`` -- ``jedi.Script.completions`` -- ``jedi.Script.usages`` +- ``jedi.Script.goto`` +- ``jedi.Script.complete`` +- ``jedi.Script.find_references`` The returned objects are very powerful and really all you might need. diff --git a/docs/docs/api.rst b/docs/docs/api.rst index 58c88ef1..a3d6404f 100644 --- a/docs/docs/api.rst +++ b/docs/docs/api.rst @@ -29,7 +29,7 @@ API Documentation The API consists of a few different parts: -- The main starting points for completions/goto: :class:`.Script` and :class:`.Interpreter` +- The main starting points for complete/goto: :class:`.Script` and :class:`.Interpreter` - Helpful functions: :func:`.names`, :func:`.preload_module` and :func:`.set_debug_function` - :ref:`API Result Classes ` @@ -76,10 +76,10 @@ Completions: >>> import jedi >>> source = '''import json; json.l''' - >>> script = jedi.Script(source, 1, 19, '') + >>> script = jedi.Script(source, path='') >>> script - >>> completions = script.completions() + >>> completions = script.complete(1, 19) >>> completions [, ] >>> completions[1] @@ -102,15 +102,15 @@ Definitions / Goto: ... inception = my_list[2] ... ... inception()''' - >>> script = jedi.Script(source, 8, 1, '') + >>> script = jedi.Script(source, path='') >>> - >>> script.goto_assignments() + >>> script.goto(8, 1) [] >>> - >>> script.goto_definitions() + >>> script.infer(8, 1) [] -Related names: +References: .. sourcecode:: python @@ -120,13 +120,12 @@ Related names: ... x = 4 ... else: ... del x''' - >>> script = jedi.Script(source, 5, 8, '') - >>> rns = script.related_names() + >>> script = jedi.Script(source, '') + >>> rns = script.find_references(5, 8) >>> rns - [, ] - >>> rns[0].start_pos - (3, 4) - >>> rns[0].is_keyword - False - >>> rns[0].text - 'x' + [, + ] + >>> rns[1].line + 5 + >>> rns[0].column + 8 diff --git a/scripts/profile_output.py b/scripts/profile_output.py index 27b9e9f5..a85f44a4 100755 --- a/scripts/profile_output.py +++ b/scripts/profile_output.py @@ -47,7 +47,7 @@ def run(code, index, infer=False): if infer: result = script.goto_definitions() else: - result = script.completions() + result = script.complete() print('Used %ss for the %sth run.' % (time.time() - start, index + 1)) return result diff --git a/scripts/wx_check.py b/scripts/wx_check.py index 2692f43a..6d49aa77 100755 --- a/scripts/wx_check.py +++ b/scripts/wx_check.py @@ -45,7 +45,7 @@ def run(): print('Process Memory before: %skB' % process_memory()) # After this the module should be cached. # Need to invent a path so that it's really cached. - jedi.Script(wx_core, path='foobar.py').completions() + jedi.Script(wx_core, path='foobar.py').complete() gc.collect() # make sure that it's all fair and the gc did its job. print('Process Memory after: %skB' % process_memory())