0

In Sublime Text 3, this is the content of my User Settings (config) file, found through Sublime Text > Preferences > Package Settings > Anaconda > Settings - User:

{
    "python_interpreter": "/usr/local/bin/python3",
    "anaconda_linting": false,
    "pep8": false
}

However, with language set to Python, when I right-click on an object and use Anaconda > Goto Definition, a blank tab opens. I have watched a tutorial that shows this option opening the source __init__.py file where namedtuple is defined.

Any ideas? Several permutations of this questions have been asked but mainly refer to issues with virtualenvs or django. This is the sample code in which I was trying Goto Definition for namedtuple:

from collections import namedtuple

namedtuple

The above two lines are the contents of untitled tab below, and the empty new tab is the result of Goto Definition.

enter image description here

In a tutorial I'm following along with, the option works as intended:

enter image description here

Brad Solomon
  • 38,521
  • 31
  • 149
  • 235
BluePython
  • 1,635
  • 3
  • 24
  • 35

2 Answers2

2

This probably a bug/limitation in Anaconda plugin. The go to definition does this when the file is not saved. If you save the file it will work fine.

When the go to definition is supposed to take you in the same file and the file is not saved, the plugin opens a blank window.

But if you save the file it would work fine. So you should open a bug on their github repo for the same. Also since there is simple workaround to get this working I doubt the developer may entertain the fix for this issue.

Tarun Lalwani
  • 142,312
  • 9
  • 204
  • 265
  • Yes, Tarun. A couple of bugs got fixed for this plugin. We submitted a somewhat similar issue and it has been fixed. We initially thought this was part of that but it is not and the workaround you describe is exactly what should be done. I don't think this one is a big deal since the bigger issue has been solved. I am trying to find it to add it here for reference. – BluePython Oct 29 '17 at 20:07
1

Was facing this same issue even after saving the file as mentioned in the answer above. My config was sublime 4126 with Anaconda 2.3.0.

Resolved this issue by manually downgrading Anaconda to 2.2.3 (releases).

Don't forget to remove the package first, then manually download Anaconda into your "Packages" directory. Apparently 2.3.0 doesn't properly support sublime 4 yet.

A.P
  • 21
  • 2