Open jrzaurin opened 2 years ago
Just in case it helps, manually downgrading to Anaconda 2.2.3 fixed the issue
Same problem for me
Time to time control + option + g opens new empty tab instead of searching definition
I'm experiencing the same thing too.
I will not have time to look into this for a while, I am very busy with other projects right now, if someone steps up to look into this it would be great.
@DamnWidget Thanks for the heads-up. :)
Note, I also experience this issue when jumping within the same file. It seems in that case, it's not thePosixPath is not JSON serializable
error, but rather the position returns None
instead of the filepath, thus leading to a blank tab when calling sublime.active_window().open_file(self.position, flags)
in Jumper
:
{"success": true, "result": [["__main__.hello", null, 7, 5]], "uid": "df29c0a94da3408e93b1204c9aa7ac74"}
Something similar happens with "Find Usages", command palette drop down list with the results prefixed with "main"
quickfix that fixed that for me - change this line:
https://github.com/DamnWidget/anaconda/blob/master/anaconda_server/commands/goto.py#L36
from: (i.full_name, i.module_path, i.line, i.column + 1)
to: (i.full_name, str(i.module_path), i.line, i.column + 1)
@x0nix :) Thank you! This fixes "go to" involving import
statements for me.
However, navigating within the same file, I still get a blank tab as described here: https://github.com/DamnWidget/anaconda/issues/924#issuecomment-1064063392 — maybe that's another issue.
x0nix's 'quickfix' only hacks/paves the way to "Goto Definition" of an imported library (at the import
statement location, like mikez mentioned above). Thanks to x0nix for their suggestion.
A quick diff between v2.3.0 and v2.2.3 shows that the problem couldn't reside in those two files alone, goto.py
and find_usages.py
(not sure, Anaconda's code base is too big for me to grasp it in a glimpse). The shift to ST4-only, and Python 3.8 for ST plugins, introduced many changes in multiple locations.
Then, there is
A. the release notes,
https://github.com/DamnWidget/anaconda/releases/tag/v2.3.0
Fixes
- Goto Definition
- Goto Assignment
B. the fix: fix anaconda to work with Python 3.10
commit
https://github.com/DamnWidget/anaconda/commit/ef6750f1dc66fa2da16245cfcaf2d54afb86d285
and
C. issue #921
So far I have the plugin working again with the latest version of Jedi and Python 3.10.1 in an Artix Linux box, that means, auto completion, docs, function signatures and goto, are working again.
...
I will make a new release as soon as I can, btw, I am not caring if older versions of Python gets broken by the update, ...
| |
Short pause to express my total respect to DamnWidget's decision and gratitude for all the past years of their hard work.
|>
So, do the v2.3.0 "Goto" commands work only with Python >= v3.10 ?
I don't know, I currently deal only with v3.7 =< Python =< v3.9 .
Windows/Linux + ST4 + Anaconda-plugin v2.3.0 => 'linting' v3.7 =< Python =< v3.9 code-base
None of the v2.3.0 Goto Definition
, Goto Assignment
, and Find Usages
commands work, at all, or as they should be.
I think a project-developer/project-previous-contributor should step in (code familiarity) or we'll have to wait for someone (including us subscribed to this issue) who has the time or the "talent" ("talent" as in less time/effort). Till then, v2.2.3 is the way backwards for anyone that wants the functionality above (described commands) or just a reassurance that all things work as before (including known quirks and bugs).
@Gregory-K Thanks for the digging and write-up!
Does upgrading to Python 3.10 resolve this?
If so, as Sublime plugins as of now run at most on 3.8 (see documentation here), I wonder what workaround @DamnWidget had in mind.
@mikez the situation is a little perplexed.
ST4 provides and 'runs' Python 3.8 for its plugins/plugin-system and will continue to do so till the next major version upgrade, ST5.
What DamnWidget is aiming for (at least what I understood by a quick glance at the relevant issues/announcements) is for Anaconda to support the "linting" of Python 3.10 code base.
e.g. Anaconda runs in ST4's provided Python 3.8 and provides "linting" for code written in/for Python 3.10
That said, I haven't tried to test it, as all my code for now targets =< Python 3.9.
It's not difficult though, but it requires time to create a virtual env Python 3.10 and test it. (pyenv
could be of help)
Just an update.
I tried today a Python 3.10 virtual env and ST4 + Anaconda v2.3.0.
Goto Definition
, Goto Assignment
, and Find Usages
commands persist on not working.
I'm attaching some logs and notes.
So, the problem described in https://github.com/DamnWidget/anaconda/issues/924#issuecomment-1064063392 keeps persisting.
Anyone has found a solution to this? Thanks!
@jrzaurin I'm not aware of a fix yet. It seems @DamnWidget (the maintainer) is prioritizing other projects per https://github.com/DamnWidget/anaconda/issues/924#issuecomment-1063990902 and requested someone look into it.
hey @mikez
Yean I read it. The truth is that this to me is a major drawback 😔.
Oh well, maybe I will give VScode a go and hope they fix this soon (I do love Sublime 🙂). Or if anyone knows an Alternative to Amaconda, please let me know.
@jrzaurin I feel you. I think you may try posting here: https://forum.sublimetext.com/c/ideas-and-feature-requests ... and explain the importance of it. That is, to have Sublime natively support a more powerful "show definition", including imported libraries akin to VSCode.
Big thank you to @DamnWidget who has been running this project since 2013. I totally understand if he has less energy and resources for it today.
Or if anyone knows an Alternative to Amaconda, please let me know.
@jrzaurin I don't know what your needs, constraints, and workflow are, but you can always downgrade to Anaconda v2.2.3 or try the other LSP alternatives mentioned here https://github.com/DamnWidget/anaconda#alternatives .
Hi there,
I added some alternatives to this plugin a while ago, they can be found in this section of the README file.
I am not sure how well they really work, I don't really use ST since circa 2014 so I really couldn't say but they look good to me.
Being honest, I didn't archived this repository yet because I still have hopes that someone (or someones) would step up and take care of the project but the possibility seems less probable each day.
Good luck everyone!
@Gregory-K I did try, since I actually wrote this comment https://github.com/DamnWidget/anaconda/issues/924#issuecomment-1057458022. However I found the behaviour rather random in the sense that, sometimes worked, sometimes did not🤷🏻♂️
Expected Behaviour
Go to the definition of the object in the source code. For example, when using python for Machine Learning, I cannot access any function in
sklearn
Actual Behaviour
Prints
unable to find 'object'
(see picture attached)Steps to Reproduce
set up an environment with pyenv
install any package (e.g. sklearn)
open sublime and type:
in the editor. Then try: Anaconda -> go to definition
my anaconda user settings look like this:
ST3, Anaconda and OS versions
ST4: 4126 Anaconda version: 2.3.0 MacOS: 12.2.1
ST3 Console Logs
Anaconda's JsonServer Logs
these are the relevant logs I think