mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 06:44:46 +08:00
default of no arguments at an execution changed to a parsing.Array
This commit is contained in:
10
evaluate.py
10
evaluate.py
@@ -110,7 +110,9 @@ class CachedMetaClass(type):
|
||||
|
||||
class Executable(object):
|
||||
""" An instance is also an executable - because __init__ is called """
|
||||
def __init__(self, base, var_args=[]):
|
||||
def __init__(self, base, var_args=parsing.Array(None, None)):
|
||||
#if var_args == []:
|
||||
# raise NotImplementedError()
|
||||
self.base = base
|
||||
# the param input array
|
||||
self.var_args = var_args
|
||||
@@ -428,13 +430,13 @@ class Execution(Executable):
|
||||
"""
|
||||
Create a param with the original scope (of varargs) as parent.
|
||||
"""
|
||||
calls = parsing.Array(parsing.Array.NOARRAY,
|
||||
self.var_args.parent_stmt)
|
||||
parent_stmt = self.var_args.parent_stmt
|
||||
calls = parsing.Array(parsing.Array.NOARRAY, parent_stmt)
|
||||
calls.values = values
|
||||
calls.keys = keys
|
||||
calls.type = array_type
|
||||
new_param = copy.copy(param)
|
||||
new_param.parent = self.var_args.parent_stmt
|
||||
new_param.parent = parent_stmt
|
||||
new_param._assignment_calls_calculated = True
|
||||
new_param._assignment_calls = calls
|
||||
name = copy.copy(param.get_name())
|
||||
|
||||
6
ftest.py
6
ftest.py
@@ -8,7 +8,7 @@ functions.debug.ignored_modules = ['parsing', 'builtin']
|
||||
functions.modules.builtin.module_find_path.insert(0, '.')
|
||||
|
||||
f_name = 'functions.py'
|
||||
f_name = 'parsetest.py'
|
||||
#f_name = 'parsetest.py'
|
||||
#f_name = 'test/completion/classes.py'
|
||||
import os
|
||||
path = os.path.join(os.getcwd(), f_name)
|
||||
@@ -16,8 +16,8 @@ path = os.path.join(os.getcwd(), f_name)
|
||||
f = open(path)
|
||||
code = f.read()
|
||||
for i in range(1):
|
||||
completions = functions.complete(code, 15, 200, path)
|
||||
#completions = functions.complete(code, 163, 200, path)
|
||||
#completions = functions.complete(code, 15, 200, path)
|
||||
completions = functions.complete(code, 164, 200, path)
|
||||
#completions = functions.get_definitions(code, 181, 2, path)
|
||||
#completions = functions.complete(code, 42, 200, path)
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@ import evaluate
|
||||
import modules
|
||||
import debug
|
||||
|
||||
__all__ = ['complete', 'goto', 'get_completion_parts', 'set_debug_function']
|
||||
__all__ = ['complete', 'get_completion_parts', 'get_definitions',
|
||||
'set_debug_function']
|
||||
|
||||
|
||||
class NotFoundError(Exception):
|
||||
|
||||
@@ -86,6 +86,8 @@ exe[1]
|
||||
|
||||
#? int()
|
||||
func()[0]
|
||||
#? str()
|
||||
func()[1]
|
||||
#? float()
|
||||
func(1.0)[0]
|
||||
#? str()
|
||||
|
||||
7
test/completion/thirdparty/jedi.py
vendored
7
test/completion/thirdparty/jedi.py
vendored
@@ -1,5 +1,5 @@
|
||||
|
||||
from jedi import functions
|
||||
from jedi import functions, evaluate
|
||||
|
||||
el = functions.complete()[0]
|
||||
#? ['description']
|
||||
@@ -14,5 +14,8 @@ scopes, path, dot, like = \
|
||||
source_path, True)
|
||||
|
||||
# has problems with that (sometimes) very deep nesting.
|
||||
#? str()
|
||||
#? set()
|
||||
el = scopes.
|
||||
|
||||
##? str() <--- recursion
|
||||
el = evaluate.get_names_for_scope()[0].
|
||||
|
||||
Reference in New Issue
Block a user