Python: Update Imports on File Move or Rename

Feature request for product/service

Cursor IDE

Describe the request

Currently it looks like auto-updating import paths after renaming a file is only available for JS and TS files. VSCode (via the Pylance extension, it looks like, which isn’t available in Cursor) is able to do this Python files. Would be great if this was available in Cursor too.

Hi @alythobani, could you create a feature request in DetachHead/basedpyright? Our extension is forked from this, so we’ll incorporate any features and improvements they add.

Hey @ravirahman , I was about to file an issue there, but actually, after digging in more, it looks like this issue is specific to Cursor’s fork, for some reason. Testing the basedpyright extension directly in VSCode (with Pylance disabled), auto-updating imports works successfully. And in fact, installing basedpyright directly in Cursor also makes auto-updating imports work:

I was unable to get the auto import updates when installing BasedPyright. I also tried to uninstall the cursor version. Also tried installing BasedPyright in vscode and disabling pylance, did’n’t work either. Pylance in vscode works though

In the extension there is this

Formatting on rename is disabled to improve performance.

Not sure this means they disabled it on purpose. It is very annoying to to go all the ref files and update the imports on file renaming.

I would consider this a bug not a feature request.

where did you find this?

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.