Skip to content

Find All References does not work on function definition #810

Closed

Description

@KyleMoser

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"

Activity

  1. MikhailArkhipov commented on Feb 17, 2018

    @MikhailArkhipov

    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

  2. KyleMoser commented on Feb 19, 2018

    @KyleMoser
    Author

    Mikhail Arkhipov (@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.

  3. DonJayamanne commented on Feb 19, 2018

    @DonJayamanne

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

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

  4. KyleMoser commented on Feb 19, 2018

    @KyleMoser
    Author

    Don Jayamanne (@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.

  5. DonJayamanne commented on Feb 19, 2018

    @DonJayamanne

    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.

  6. KyleMoser commented on Feb 20, 2018

    @KyleMoser
    Author

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

  7. locked as resolved and limited conversation to collaborators on Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    info-neededIssue requires more information from poster

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions