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

Goto definition opens package __init__.py instead of module itself #768

Open
kr41 opened this issue Jun 10, 2018 · 7 comments
Open

Goto definition opens package __init__.py instead of module itself #768

kr41 opened this issue Jun 10, 2018 · 7 comments

Comments

@kr41
Copy link

kr41 commented Jun 10, 2018

Steps to Reproduce

Here is the file layout:

myproject/
  package/
    subpackage/
      __init__.py
      module.py
    __init__.py

Content of myproject/package/__init__.py:

from .subpackage import module

Within myproject/package/__init__.py I rightclick on module and choose "Anaconda/Goto Definition".

Expected Behaviour

I expected to go into myproject/package/subpackage/module.py.

Actual Behaviour

Anaconda opens myproject/package/subpackage/__init__.py instead.

ST3, Anaconda and OS versions

ST3: v3.1.1 Build 3176
Anaconda: v2.1.26
OS: Linux 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64 GNU/Linux

ST3 Console Logs

startup, version: 3176 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
working dir: /
packages path: /home/krat/.config/sublime-text-3/Packages
state path: /home/krat/.config/sublime-text-3/Local
zip path: /opt/sublime_text/Packages
zip path: /home/krat/.config/sublime-text-3/Installed Packages
ignored_packages: ["Python", "Vintage"]
pre session restore time: 0.100394
startup time: 0.247635
first paint time: 0.263803
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.55-jsonschema
reloading plugin DocBlockr.jsdocs
reloading plugin MagicPython.sublime
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin sublack.sublack
reloading plugin SublimeLinter-shellcheck.linter
reloading plugin SublimeLinter.__init__
reloading plugin SublimeLinter.active_linters_view
reloading plugin SublimeLinter.busy_indicator_view
reloading plugin SublimeLinter.goto_commands
reloading plugin SublimeLinter.highlight_view
reloading plugin SublimeLinter.log_handler
reloading plugin SublimeLinter.message_view
reloading plugin SublimeLinter.panel_view
reloading plugin SublimeLinter.status_bar_view
reloading plugin SublimeLinter.sublime_linter
reloading plugin Anaconda.anaconda
reloading plugin Anaconda.setup
reloading plugin Anaconda.version
plugins loaded
Package Control: Skipping automatic upgrade, last run at 2018-06-10 17:41:37, next run at 2018-06-10 18:41:37 or after

Anaconda's JsonServer Logs

2018-06-10 18:03:49,529: DEBUG   : bind: address=/home/krat/.local/share/anaconda/run/myproject/anaconda.sock
2018-06-10 18:03:49,529: DEBUG   : listen: backlog=5
2018-06-10 18:03:49,529: INFO    : Anaconda Server started in /home/krat/.local/share/anaconda/run/myproject/anaconda.sock for PID 30316 with cache dir /home/krat/.cache/jedi/myproject and extra paths /home/krat/Projects/myproject
2018-06-10 18:04:12,087: INFO    : Incomming connection from ''
2018-06-10 18:04:12,087: INFO    : Incomming connection from ''
2018-06-10 18:04:12,098: INFO    : client requests: lint
2018-06-10 18:04:12,478: DEBUG   : bind: address=/home/krat/.local/share/anaconda/run/myproject/anaconda.sock
2018-06-10 18:04:12,478: DEBUG   : listen: backlog=5
2018-06-10 18:04:12,478: INFO    : Anaconda Server started in /home/krat/.local/share/anaconda/run/myproject/anaconda.sock for PID 30316 with cache dir /home/krat/.cache/jedi/myproject and extra paths /home/krat/Projects/myproject
2018-06-10 18:04:15,911: INFO    : client requests: goto
2018-06-10 18:04:16,007: INFO    : client requests: lint
2018-06-10 18:04:16,009: INFO    : client requests: lint
@kr41 kr41 changed the title Goto defenition opens package __init__.py instead of module itself Goto definition opens package __init__.py instead of module itself Jun 10, 2018
@DamnWidget
Copy link
Owner

This is a Jedi problem, we are testing a new Jedi version, if you want, you can clone this repository into your Packages/ directory (after remove Anaconda package using the Command Palette) and checkout the jedi_0_12 branch if you want to check if new version of Jedi solved this problem.

If it didn't I recommend you to open a new ticket in Jedi Github repository directly.

@DamnWidget
Copy link
Owner

This should be solved as per anaconda v2.1.27

@max-white
Copy link

I still have the same problem. Version is V2.1.29.

@ghost
Copy link

ghost commented Jan 23, 2019

I really like anaconda , Many thanks!
i have this problem , version 2.1.29
i tried using a few jedi branches without any luck.

  1. jedi_bump
  2. new_jedi_fixes
  3. jedi_0_12 <-- recommended to try above.

opened ticket
srusskih/SublimeJEDI#280

@daniele-niero
Copy link

I still have the same problem too on V2.1.29.

@daniele-niero
Copy link

This will be fixed if jedi was updated to a more recent version.
If I'm not wrong the one used in Anaconda is quite old, from 2017. Correct me if I'm wrong.

I tried to replace jedi with different tags from their repository. Tag version 0.12.0 seems to solve this issue... unfortunately other things looks broken. For example "Show Documentation" seems doing absolutely nothing...

Anyway, a bumb in jedi version used, would be beneficial, I think

@DamnWidget
Copy link
Owner

DamnWidget commented Feb 14, 2020

Tried to update Jedi version many times but macOS users reported severe performance regression

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

4 participants