Skip to content

vscode.executeDocumentSymbolProvider seems to only work once (or at least only once in close succession) #2112

Closed

Description

@eamodio

Environment data

  • VS Code version: 1.25 or 1.26
  • Extension version (available under the Extensions sidebar): 2018.6.0
  • OS and version: Windows 10 x64
  • Python version (& distribution if applicable, e.g. Anaconda): Python 2.7.15
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A

Originally reported here: https://github.com/DonJayamanne/pythonVSCode/issues/553
Another case of this here: gitkraken/vscode-gitlens#439

Actual behavior

Executing vscode.executeDocumentSymbolProvider only returns all the symbols on the first call, successive calls return 0 symbols (at least within a small window)

Expected behavior

Executing vscode.executeDocumentSymbolProvider should return all the symbols no matter how many times (concurrently or not) it is called

Steps to reproduce:

  1. Call vscode.executeDocumentSymbolProvider more than once in close succession (or observe the behavior seen in GitLens breaks Outline for Python gitkraken/vscode-gitlens#439)

Activity

  1. ericsnowcurrently commented on Jul 31, 2018

    @ericsnowcurrently
  2. ericsnowcurrently commented on Jul 31, 2018

    @ericsnowcurrently

    Hi Eric Amodio (@eamodio)! Thanks for letting us know about this. Sorry about the delay and how DonJayamanne#553 slipped through the cracks when we moved the issues over to this repo.

    I've taken a stab at reproducing the issue, following the steps in gitkraken/vscode-gitlens#439:

    1. use the default settings in the Python extension
    2. install the GitLens extension
    3. open the outline view
    4. open a simple Python file (and check the outline)
    5. open another Python file (and check the outline)

    Doing this I didn't have any problems (the outline filled out properly for each file). I also did not have any problems when I used the new language server. It could be that the results differ based on the contents of the file. We'd need examples of such files in order to proceed. Could you provide any?

    FYI, there's a known issue with the language server that we're handling separately.

  3. ericsnowcurrently commented on Aug 1, 2018

    @ericsnowcurrently

    (from Robert-Jan Bruintjes (@rjbruin) Aug 1, 2018, 5:39 AM MDT)

    Eric Snow (@ericsnowcurrently) Thanks!

    It seems the issue is connected to the new language server:

    • No GitLens + "python.jediEnabled": true: works;
    • No GitLens + "python.jediEnabled": false: no file outline will load anymore, and switching out of Explorer and back doesn't return the outline anymore

    However, even when disabling the new language server and enabling GitLens the issue remains. Even more confusing, I'm not seeing the same behavior anymore even with the settings of the original issue:

    • GitLens + "python.jediEnabled": true (original issue): certain files load without problem, while others don't. Things I've tried to narrow down the differences:
      • Both files are in a repository tracked by GitLens: the one that breaks outline is in our main company repository, the one that works is in a new local repository;
      • Both files have the exact same content and name;
      • Both workspace folders use the same Python interpreter (from virtualenv)

    I'm getting kind of lost here. As for the GitLens issue, it seems to have to do with the repository the file is in. If I can do anything to help debug this, please let me know!

  4. ericsnowcurrently commented on Aug 1, 2018

    @ericsnowcurrently

    Robert-Jan Bruintjes (@rjbruin), from the GitLens issue I noticed you are using VSCode 1.24.1. I've been trying to reproduce the problem using 1.25.1 (with no failures). Try upgrading VSCode and then see if the failure persists. Also, what version of the Python extension are you on right now? I'm using 2018.7.1 (the latest release). Thanks!

    Don Jayamanne (@DonJayamanne), any thoughts on this?

  5. ericsnowcurrently commented on Aug 1, 2018

    @ericsnowcurrently

    Robert-Jan Bruintjes (@rjbruin), also, any VSCode logs you can provide would be helpful:

    Logs

    Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

    XXX
    

    Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)

    XXX
    
  6. 9 remaining items

  7. brettcannon commented on Aug 3, 2018

    @brettcannon
    Member

    Maybe we should re-orient this issue then to say the Outline view starts as empty upon initial load?

  8. rjbruin commented on Aug 6, 2018

    @rjbruin

    Brett Cannon (@brettcannon) Sure. Do you need me to update the original issue?

  9. d3r3kk commented on Aug 14, 2018

    @d3r3kk

    Seems to be related to project size, I tested this issue out using the relatively sizeable project Microsoft/vsts-cli on Github.

    Repro:

    1. Clone the vsts-cli repo from Github.
    2. Set up the developer environment as described in their developer setup document. (I used venv instead of virtualenv).
    3. Open VSCode-Insiders within the directory I cloned.
    4. Open one of the *.py files in the command_modules subtree.
    5. Open different *.py files throughout the command_modules subtree, watching for outlines to appear.

    Observed output:

    On first visit to .py files, no outline is shown and none appear if you wait around.
    On some subsequent visit (can be 2nd, or 3rd, or Nth) to files you've seen before the outline will appear.

    outline-empty-on-first-visit-to-file

    Expected output:

    On any visit to any *.py file, the outline is filled in. Perhaps even a 'loading' indicator.

  10. brettcannon commented on Aug 14, 2018

    @brettcannon
    Member

    Duplicate of #2334

  11. sandipb commented on Aug 17, 2018

    @sandipb

    This problem with Gitlens and vscode is present also when I am using jedi, and not the language server. Does that case make it a duplicate of #2334 too?

  12. brettcannon commented on Aug 20, 2018

    @brettcannon
    Member

    Sandip Bhattacharya (@sandipb) feel free to open a new issue

  13. locked as resolved and limited conversation to collaborators on Sep 17, 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

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions