Open piojanu opened 7 years ago
Hello, and thanks for the report! Jedi provides two types of "find definition" functions, and both can return multiple responses … the logic Elpy currently uses was defined a whole long time ago (at least two almost full rewrites of Jedi ago), and might not be quite sensible now anymore.
I'll keep this issue open to keep in mind that the logic might reworking.
I am having a similar issue.
Will calling elpy-goto-definition
with variable elpy-rpc-backend
set to "jedi"
make it call jedi:goto-definition
instead? That's what I thought, but I am having different results.
jedi:goto-definition
correctly takes me to the function argument definition when the pointer is on a
or b
within the following function, even if I delete test(1, 2)
.
def test(a, b):
print(a + b)
test(1, 2) # If I delete this line, elpy-goto-definition does not work for variables a and b.
elpy-goto-definition
does not do find the definition for both a
and b
variables, unless I call the function (with test(1, 2)
for example). If that line is deleted elpy-goto-definition
does not work.
I was under the impression that using jedi as an RPC backend for elpy would result in it calling jedi:goto-definition
.
I am using Ubuntu 17.10.
Hi!
I made fresh elpy installation with python plugins:
jedi flake8 importmagic autopep8
(after ubuntu format). I use jedi as a backend.Now, let's consider this example:
If you want to find definition of
res
in line 7 and useelpy-goto-definition
, it properly finds line 6. But, if you want to find definition ofcls
in line 10, it jumps to the class name in line 1. Is it expected? For me it seems like a bug and I think, it worked differently in the past.jedi:goto-deinition
seems to do it more reasonable and jumps to line 9, which is proper definition. If i'd want to find a class, I'd go to line 9 and use goto-definition over class name. This case works good for both elpy and jedi functions.Thanks, Piotr