skip to Main Content

I am trying to rename a python file and want to have all the import instances updated with as well.

Based on the below link, there should be a pop up window every time I rename a file and Pylance will find all the instances and ask to refactor:
https://code.visualstudio.com/docs/python/editing#_autocomplete-and-intellisense

However I am not getting this pop up window at all… does anyone know what the issue is?

2

Answers


  1. I can confirm this is a bug of Pylance extension for VSCode on Windows platform.

    I’ve tested with VSCode 1.83.1 on Windows 10 and the following Pylance version.

    Won’t work:

    Pylance v2023.10.21 (pre-release)
    Pylance v2023.10.20
    Pylance v2023.10.11 (pre-release)
    

    Module renaming works:

    Pylance v2023.10.10
    Pylance v2023.9.31 (pre-release)
    Pylance v2023.9.30
    

    If you absolutely need the module renaming functionality on VSCode for Windows, stick to Pylance v2023.10.10 until there is a new version which fixes this bug. See: How to install previous versions of extensions

    Login or Signup to reply.
  2. I submit this issue to github. And now this bug has been fixed in pre-release version 2023.10.31.

    You can switch to pre-release version in extension store to solve it.

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