Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[help] jedi:goto-definition overjumping the import section #355

Open
avatar-lavventura opened this issue Feb 15, 2021 · 0 comments
Open

Comments

@avatar-lavventura
Copy link

I am using jedi:goto-definition to jump to function definitions.

If the function has a definiton under import it first jumps into that and I have to do second jump to the module again. Can it directly jump to the module by over passing the import jump?


Here: cursor is on top of my_function. When I do jedi:goto-definition it first jumps to my_function, under import at the top of the file. Than when I do jedi:goto-definition it jump to its definition.

from utils import (                      |
    my_function, <-----| --------------> |  def my_function(arg):
    _log               |                 |      ....
)                      |                 |
                       |                 |
my_function("hello") --| # cursor is here

wanted behavior:

my_function("hello") --| # cursor is here ----> | def my_function(arg):

setup:

(setq elpy-rpc-backend "jedi")
(add-hook 'python-mode-hook 'jedi:setup)

(global-set-key "\C-x\C-j" 'jedi:goto-definition)
(global-set-key "\C-x\C-k" 'jedi:goto-definition-pop-marker)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant