diff --git a/python/completers/python/jedi_completer.py b/python/completers/python/jedi_completer.py index 7d363510..5fa1d10f 100644 --- a/python/completers/python/jedi_completer.py +++ b/python/completers/python/jedi_completer.py @@ -88,6 +88,8 @@ class JediCompleter( ThreadedCompleter ): self._GoToDefinition() elif command == 'GoToDeclaration': self._GoToDeclaration() + elif command == 'GoToDefinitionElseDeclaration': + self._GoToDefinitionElseDeclaration() def _GoToDefinition( self ): @@ -106,6 +108,15 @@ class JediCompleter( ThreadedCompleter ): vimsupport.PostVimMessage( 'Can\'t jump to declaration.' ) + def _GoToDefinitionElseDeclaration( self ): + definitions = self._GetDefinitionsList() or \ + self._GetDefinitionsList( declaration = True ) + if definitions: + self._JumpToLocation(definitions) + else: + vimsupport.PostVimMessage( 'Can\'t jump to definition or declaration.' ) + + def _GetDefinitionsList( self, declaration = False ): definitions = [] script = self._GetJediScript()