skip to Main Content

I have a python file on a network drive (X:foo.py). If I click on a python function defined in the same file and press F12 (go to definition), VSCode opens a new window where the file name is \some.unc.pathfoo.py
This behavior is recent but downgrading VSCode to an older version didn’t help.
Is there a setting perhaps that makes VSCode convert network mapped drives to UNC?

2

Answers


  1. I work on pylance. This is a bug we introduced in 2023.12.1. It is not intentional. We’ve recently posted a new prerelease that should fix the issue.

    The latest release here should have the fix:
    https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance

    Login or Signup to reply.
  2. This was a bug introduced in v2023.12.1 of the Pylance extension. The canonical issue ticket is at Go to definition not working in network drive after updating Pylance from 2023.11.10 to 2023.12.1 #5260.

    It’s fixed in pre-release version 2023.12.104 (source). You can switch to the pre-release channel (either right click the extension item in the Extensions View and click "Switch to Pre-Release Version", or left click, and click the button with the same text in the opened extension page). The related changelog entry is here. Once the next release version comes out after that pre-release version, it should have the fix as well.

    FYI: I found out about this by contacting the maintainers with a question issue ticket (granted, you kind of have to know the right repo to raise an issue ticket in, and check whether they accept question issue tickets): Has something changed recently that causes Go To Definition to open files with network-share-drive paths converted to UNC paths?
    #5395
    .

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search