forked from VimPlug/jedi
Very small refactoring
This commit is contained in:
@@ -45,7 +45,7 @@ class AbstractContext(object):
|
|||||||
|
|
||||||
def create_context(self, node):
|
def create_context(self, node):
|
||||||
def from_scope_node(scope_node, is_nested=True):
|
def from_scope_node(scope_node, is_nested=True):
|
||||||
if scope_node == base_node:
|
if scope_node == self.tree_node:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
if scope_node.type in ('funcdef', 'lambdef', 'classdef'):
|
if scope_node.type in ('funcdef', 'lambdef', 'classdef'):
|
||||||
@@ -58,8 +58,6 @@ class AbstractContext(object):
|
|||||||
return CompForContext(parent_context, scope_node)
|
return CompForContext(parent_context, scope_node)
|
||||||
raise Exception("There's a scope that was not managed.")
|
raise Exception("There's a scope that was not managed.")
|
||||||
|
|
||||||
base_node = self.tree_node
|
|
||||||
|
|
||||||
def parent_scope(node):
|
def parent_scope(node):
|
||||||
while True:
|
while True:
|
||||||
node = node.parent
|
node = node.parent
|
||||||
|
|||||||
Reference in New Issue
Block a user