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

Go to definition for Python project does not work with relative imports #274

Closed
imdadahad opened this issue Nov 22, 2017 · 9 comments
Closed
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@imdadahad
Copy link

Environment data

VS Code version: Version 1.18.1 (1.18.1)
Python Extension version: 0.8.0
Python Version: 3.6
OS and version: Mac High Sierra

Actual behavior

Assuming my current project structure:

-stopwatch_app
--test.py
--utils
---greeter.py

And contents of:

# test.py

from utils.greeter import print_greeting

def main():
    print_greeting()
# utils/greeter.py

def print_greeting():
   print('Hello')

In test.py, when I select go to definition for the print_greeting method in main (Figure 1), it automatically places the cursor right before the import definition (Figure 2).

Figure 1
image

Figure 2
image

Expected behavior

It should instead take me to the print_greeting() definition in the utils/greeter.py file.

Steps to reproduce:

  • Download the source
    stopwatch_app.zip
  • Open the source project in VSCode
  • Go to test.py, right click on print_greeting() defined in main and select Go To Definition

Logs

Output from Python output panel
N/A

@DonJayamanne DonJayamanne added awaiting 1-verification area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug labels Nov 22, 2017
@imdadahad
Copy link
Author

Bump

@brettcannon
Copy link
Member

@imdadahad there's no need to bump the issue as we've triaged it and are aware of your request. We just also have 57 other issues to verify along with 41 bugs awaiting fixes. 😟

@DonJayamanne
Copy link

Reported as an upstream issue davidhalter/jedi#1029

@pchomik
Copy link

pchomik commented Mar 15, 2018

Any update regarding this issue?
I downloaded latest version of jedi and configured vscode to use it. Problem still exists.

@DonJayamanne
Copy link

I downloaded latest version of jedi and configured vscode to use it. Problem still exists.

@pchomik Have you reported this upstream?

@pchomik
Copy link

pchomik commented Mar 19, 2018

I haven't report it upstream.
I don't know how to prepare small example for them to show issue. In my opinion example from vscode is not valid.

@brettcannon
Copy link
Member

Should be fixed in the next release.

@JensMadsen
Copy link

it is still not working. Works when starting vsc but stops working after a while

Version 1.23.0
Commit 7c7da59c2333a1306c41e6e7b68d7f0caa7b3d45
Date 2018-05-03T15:23:19.356Z
Shell 1.7.12
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64

@DonJayamanne
Copy link

Please could you check if there are any errors in the console window (go into Help->Toggle Developer Tools)

@lock lock bot locked as resolved and limited conversation to collaborators Jul 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

5 participants