Skip to content

Commit

Permalink
Merge 7736d58 into f3461ee
Browse files Browse the repository at this point in the history
  • Loading branch information
galaunay committed Nov 19, 2019
2 parents f3461ee + 7736d58 commit d495f9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions elpy.el
Original file line number Diff line number Diff line change
Expand Up @@ -1675,9 +1675,15 @@ with a prefix argument)."
"Initial position before expanding to indentation.")
(make-variable-buffer-local 'elpy-nav-expand--initial-position)

(defun elpy-rpc-warn-if-jedi-not-available ()
"Check if jedi is available, else, display a message."
(unless elpy-rpc--jedi-available
(error "This feature requires the `jedi` package to be installed. Please check `elpy-config` for more information.")))

(defun elpy-goto-definition ()
"Go to the definition of the symbol at point, if found."
(interactive)
(elpy-rpc-warn-if-jedi-not-available)
(let ((location (elpy-rpc-get-definition)))
(if location
(elpy-goto-location (car location) (cadr location))
Expand All @@ -1686,6 +1692,7 @@ with a prefix argument)."
(defun elpy-goto-assignment ()
"Go to the assignment of the symbol at point, if found."
(interactive)
(elpy-rpc-warn-if-jedi-not-available)
(let ((location (elpy-rpc-get-assignment)))
(if location
(elpy-goto-location (car location) (cadr location))
Expand All @@ -1694,6 +1701,7 @@ with a prefix argument)."
(defun elpy-goto-definition-other-window ()
"Go to the definition of the symbol at point in other window, if found."
(interactive)
(elpy-rpc-warn-if-jedi-not-available)
(let ((location (elpy-rpc-get-definition)))
(if location
(elpy-goto-location (car location) (cadr location) 'other-window)
Expand All @@ -1702,6 +1710,7 @@ with a prefix argument)."
(defun elpy-goto-assignment-other-window ()
"Go to the assignment of the symbol at point in other window, if found."
(interactive)
(elpy-rpc-warn-if-jedi-not-available)
(let ((location (elpy-rpc-get-assignment)))
(if location
(elpy-goto-location (car location) (cadr location) 'other-window)
Expand Down

0 comments on commit d495f9c

Please sign in to comment.