mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-20 19:02:50 +08:00
Move get_node() to tree_node and replace all the custom classdefs/funcdefs.
This commit is contained in:
@@ -30,3 +30,16 @@ class Y(X):
|
||||
|
||||
#? []
|
||||
myfoobar
|
||||
|
||||
# -----------------
|
||||
# Inheritance
|
||||
# -----------------
|
||||
|
||||
class Super():
|
||||
enabled = True
|
||||
if enabled:
|
||||
yo_dude = 4
|
||||
|
||||
class Sub(Super):
|
||||
#? ['yo_dude']
|
||||
yo_dud
|
||||
|
||||
@@ -291,16 +291,3 @@ elif 3 == flow_import.env:
|
||||
|
||||
#? int() str()
|
||||
a
|
||||
|
||||
# -----------------
|
||||
# Inheritance
|
||||
# -----------------
|
||||
|
||||
class Super():
|
||||
enabled = True
|
||||
if enabled:
|
||||
yo_dude = 4
|
||||
|
||||
class Sub(Super):
|
||||
#? ['yo_dude']
|
||||
yo_dud
|
||||
|
||||
@@ -195,7 +195,7 @@ class IntegrationTestCase(object):
|
||||
user_context = get_user_scope(module_context, (self.line_nr, 0))
|
||||
if user_context.api_type == 'function':
|
||||
user_context = user_context.get_function_execution()
|
||||
element.parent = user_context.get_node()
|
||||
element.parent = user_context.tree_node
|
||||
results = evaluator.eval_element(user_context, element)
|
||||
if not results:
|
||||
raise Exception('Could not resolve %s on line %s'
|
||||
|
||||
@@ -33,7 +33,7 @@ def test_fake_loading():
|
||||
|
||||
|
||||
def test_fake_docstr():
|
||||
assert compiled.create(_evaluator(), next).get_node().raw_doc == next.__doc__
|
||||
assert compiled.create(_evaluator(), next).tree_node.raw_doc == next.__doc__
|
||||
|
||||
|
||||
def test_parse_function_doc_illegal_docstr():
|
||||
|
||||
@@ -257,7 +257,7 @@ def test_string_literals():
|
||||
""")
|
||||
|
||||
script = jedi.Script(dedent(source))
|
||||
script._get_module().module_node.end_pos == (6, 0)
|
||||
script._get_module().tree_node.end_pos == (6, 0)
|
||||
assert script.completions()
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ def test_decorator_string_issue():
|
||||
|
||||
s = jedi.Script(source)
|
||||
assert s.completions()
|
||||
assert s._get_module().module_node.get_code() == source
|
||||
assert s._get_module().tree_node.get_code() == source
|
||||
|
||||
|
||||
def test_round_trip():
|
||||
|
||||
@@ -175,7 +175,7 @@ class TestRegression(TestCase):
|
||||
completions = Script('').completions()
|
||||
c = get_str_completion(completions)
|
||||
str_context, = c._name.infer()
|
||||
n = len(str_context.classdef.children[-1].children)
|
||||
n = len(str_context.tree_node.children[-1].children)
|
||||
if i == 0:
|
||||
limit = n
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user