Skip to content

Go to Symbol in Workspace... breaks if custom file system provider folders exist in workspace #4107

Closed

Description

@bnorick

Environment data

  • VS Code version: 1.30.2
  • Extension version (available under the Extensions sidebar): 2018.12.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.8, Anaconda
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

When using Go To Symbol in Workspace... I should get a list populated with symbols in the workspace, at least for the directories which are not virtual.

Actual behaviour

An error is thrown when trying to process virtual directories, resulting in the popup prompting the user to install ctags (even though it is installed) being fired.

Steps to reproduce:

  1. Use some method to add a virtual directory to your workspace. I used GitLens and "Explore Repository from Here" on a branch, which gives be a virtual directory representing the repository's state in that branch.
  2. Try "Go to Symbol in Workspace..."

Logs

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

I fixed this locally, so I can't post logs without undoing my fix which is cumbersome.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)

Ditto.

Fix

To fix this issue locally, I edited the extension.js file replacing
get enabled(){return this.pythonSettings.workspaceSymbols.enabled}
with
get enabled(){return this.pythonSettings.workspaceSymbols.enabled&&this.workspaceFolder.scheme === "file"}

Refer to this line of the actual TypeScript source of the extension for where I placed the check, essentially disabling generators if the related folder does not have the file scheme for the uri. This might not be the best approach, but it was easiest to hack into extension.js.

The idea of the approach should work though, don't try to generate symbols for virtual directories.

Activity

  1. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Jan 23, 2019
  2. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jan 24, 2019
  3. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jan 24, 2019
  4. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jan 24, 2019
  5. added
    area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.
    and removed on May 13, 2020
  6. brettcannon commented on Jul 24, 2020

    @brettcannon
    Member

    We are going through old issues and we noticed that no one from the team had replied to this issue. I want to apologize for the oversight and to let you know that the issue was reviewed by the team and triaged (as shown by the labels applied to this issue).

  7. luabud commented on Apr 27, 2021

    @luabud
    Member

    Closing in favour of #16063.

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

    area-editor-*User-facing catch-allarea-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions