1
0
forked from VimPlug/jedi

Merge pull request #790 from blueyed/fix-goto_definitions-for-derived-class

Fix goto_definitions being invoked on a parent class
This commit is contained in:
Dave Halter
2016-11-06 13:55:03 +01:00
committed by GitHub
2 changed files with 4 additions and 1 deletions

View File

@@ -446,7 +446,9 @@ class Evaluator(object):
def_ = name.get_definition()
is_simple_name = name.parent.type not in ('power', 'trailer')
if is_simple_name:
if name.parent.type in ('file_input', 'classdef', 'funcdef'):
if name.parent.type == 'classdef' and name.parent.name == name:
return [self.wrap(name.parent)]
if name.parent.type in ('file_input', 'funcdef'):
return [self.wrap(name.parent)]
if def_.type == 'expr_stmt' and name in def_.get_defined_names():
return self.eval_statement(def_, name)

View File

@@ -160,6 +160,7 @@ class Mixin(SuperClass):
def method_mixin(self):
return int
#? 20 SuperClass
class SubClass(SuperClass):
class_sub = 3
def __init__(self):