1
0
forked from VimPlug/jedi

Additional helper methods, to find all the statement elements that are needed.

This commit is contained in:
Dave Halter
2014-09-02 03:26:17 +02:00
parent be9e77d7d3
commit f785aa26dd
3 changed files with 41 additions and 3 deletions

View File

@@ -689,6 +689,11 @@ def defined_names(source, path=None, encoding='utf-8'):
def _names(source=None, path=None, encoding='utf-8'):
"""
Returns a list of `Definition` objects, containing name parts.
This means you can call ``Definition.goto_assignments()`` and get the
reference of a name.
"""
# Set line/column to a random position, because they don't matter.
script = Script(source, line=1, column=0, path=path, encoding=encoding)
defs = [classes.Definition(script._evaluator, name_part)