pythonic-emacs / anaconda-mode

Code navigation, documentation lookup and completion for Python.
GNU General Public License v3.0
706 stars 87 forks source link

`conda-mode-find-definitions` on constant variable points to class, not the def site #435

Open sangwoo-joh opened 11 months ago

sangwoo-joh commented 11 months ago

Description

If I have a constant.py file like below:

CONST_A = 1

, and other module that use this module like below:

from my_package import constant

foo = constant.CONST_A + 1

With this setting, when I call conda-mode-find-definitions on const.CONST_A, it gave me the following:

...
class int:
    @overload
    ....

... which is in anaconda/0.1.15-py3/jedi/third_party/typeshed/stdlib/3/builtins.pyi.

I though it would jump to the actual definition site in constant.py file... Other definitions, e.g., some user-defined class, go to the proper def-site. Only builtin types gave me strange location.

What should I do to make it give me the actual def-site? Is there any variable to set up?