Skip to content

Find All References does not work on function definition #810

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

Closed
KyleMoser opened this issue Feb 16, 2018 · 6 comments
Closed

Find All References does not work on function definition #810

KyleMoser opened this issue Feb 16, 2018 · 6 comments
Labels
info-needed Issue requires more information from poster

Comments

@KyleMoser
Copy link

I have created a full example demonstrating the issue at the following Git repo: https://github.com/KyleMoser/findrefs/tree/master

Environment data

VS Code version: 1.20.0
Python Extension version: 2018.1.0
Python Version: 3.6, 64-bit
OS and version: Windows 10

Actual behavior

In the project, if you right click on the function definition for "configure_params" in the contrived.py file, and click "Find All References", it will not find any references outside of the current file. However, if you click "Find All References" in the prove_its_broken.py, it will find two references - one from prove_its_broken.py and the other from contrived.py.

Expected behavior

I would expect ALL references to be found when you click find all references on the function header.

Steps to reproduce:

  1. Git clone my project from the link I provided
  2. Right click on "configure_params" in the contrived.py file, and click "Find All References"
@MikhailArkhipov
Copy link

I get 'can't import contrived' from pylint in the cloned solution which might explain why references are not found. If I place files one next to another, references are found.

image

@MikhailArkhipov MikhailArkhipov added info-needed Issue requires more information from poster feature-code navigation labels Feb 17, 2018
@KyleMoser
Copy link
Author

@MikhailArkhipov The docs say that I should be able to set the PYTHONPATH in the .env file with a relative path. I am using Pylint in my solution as well and I get no such error - the imports are resolved just fine. You can also explicitly set PYTHONPATH in Powershell using $env:PYTHONPATH="whatever".

Even if there is an import error, which in my solution there isn't, there is still some sort of bug here.

@DonJayamanne
Copy link

Please change the entry as follows:
PYTHONPATH="./PyCommons"

Please confirm that fixes the issue.
Accidentally closed the issue.

@KyleMoser
Copy link
Author

@DonJayamanne That did not solve the issue for me. I made the change you suggested in the .env file, closed VS Code, reopened, and click find all references. I get the same result - only a single reference to the function definition is found. Thanks for looking into this issue, which I'm sure seems minor.

@DonJayamanne
Copy link

Please could you go into the Core/prove_its_broken.py file and then right click on the configure_params method and select the menu option Go To Definition.
Please check whether the above works.

If this works, then its most likely a bug in Jedi.

@KyleMoser
Copy link
Author

@DonJayamanne Yes, go to definition is working fine. I will open a bug report on the Jedi repo and see what they think. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants