Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Move symbol to..." refactor does not honor Import Format setting. #6440

Open
maflAT opened this issue Sep 24, 2024 · 1 comment
Open

"Move symbol to..." refactor does not honor Import Format setting. #6440

maflAT opened this issue Sep 24, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@maflAT
Copy link

maflAT commented Sep 24, 2024

Environment data

  • Pylance version: v2024.9.101
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.12

Repro Steps

  1. change "Import Format" setting to "relative".
  2. create a python module and define a symbol in it and a reference to that symbol.
  3. Refactor -> Move Symbol to new file.

Expected behavior

Symbol definition is moved to new file, and a relative import for the symbol is generated in the original file:
from .new_file import symbol

Actual behavior

Absolute import for the symbol is generated in the original file:
from new_file import symbol

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 24, 2024
@KacieKK
Copy link
Contributor

KacieKK commented Sep 24, 2024

Thanks for reporting, I can reproduce it.

@KacieKK KacieKK added bug Something isn't working and removed needs repro Issue has not been reproduced yet labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants