mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
get_definitions -> get_definition
This commit is contained in:
@@ -130,7 +130,7 @@ have the following objects available:
|
|||||||
> Similar to complete. The returned `functions.Definition` objects contain
|
> Similar to complete. The returned `functions.Definition` objects contain
|
||||||
> information about the definitions found.
|
> information about the definitions found.
|
||||||
|
|
||||||
`get_definitions`
|
`get_definition`
|
||||||
> A mostly for tests used function. Like goto, but follows statements and
|
> A mostly for tests used function. Like goto, but follows statements and
|
||||||
> imports and doesn't break there. You probably don't want to use this
|
> imports and doesn't break there. You probably don't want to use this
|
||||||
> function. It's mostly for testing.
|
> function. It's mostly for testing.
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import debug
|
|||||||
import imports
|
import imports
|
||||||
import settings
|
import settings
|
||||||
|
|
||||||
__all__ = ['complete', 'goto', 'get_definitions',
|
__all__ = ['complete', 'goto', 'get_definition',
|
||||||
'NotFoundError', 'set_debug_function']
|
'NotFoundError', 'set_debug_function']
|
||||||
|
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ def _prepare_goto(source, position, source_path, module, goto_path,
|
|||||||
return scopes
|
return scopes
|
||||||
|
|
||||||
|
|
||||||
def get_definitions(source, line, column, source_path):
|
def get_definition(source, line, column, source_path):
|
||||||
"""
|
"""
|
||||||
Returns the definitions of a the path under the cursor.
|
Returns the definitions of a the path under the cursor.
|
||||||
This is not a goto function! This follows complicated paths and returns the
|
This is not a goto function! This follows complicated paths and returns the
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ def run_definition_test(correct, source, line_nr, line, correct_start, path):
|
|||||||
Return if the test was a fail or not, with 1 for fail and 0 for success.
|
Return if the test was a fail or not, with 1 for fail and 0 for success.
|
||||||
"""
|
"""
|
||||||
def defs(line_nr, indent):
|
def defs(line_nr, indent):
|
||||||
return set(functions.get_definitions(source, line_nr, indent, path))
|
return set(functions.get_definition(source, line_nr, indent, path))
|
||||||
try:
|
try:
|
||||||
result = defs(line_nr, len(line))
|
result = defs(line_nr, len(line))
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user