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
Rope fails to rename variable identifier within a generator expression #249
Comments
Hello and help, any workaround for this issue? |
Sorry, I haven't had much time to look into these issues further. If anyone else here is able to pick it up, that would be appreciated. |
Any news on this? |
I still encounter this behaviour in v0.16.0. Anyone got tipps? Using it within VSCode. |
Hello, I can confirm the issue.I got the error in vim using LanguageCliente-neovim as client. The rope version that I'm using is v0.16.0. Any advice for this? |
Hi, I am also still having this issue. Does anyone have a fix? |
Other solution: https://stackoverflow.com/a/59570939/14522024 |
@lieryan Do you have any idea about this one? We seem to have many very unhappy customers here. |
I took a look at this, it seems like there are a number of issues at play here:
Probably the quickest way to fix this is to fix that issue 3 first. That should make rope treat comprehension with Python 2 scope semantics (i.e. leaky loop variable), so renames will work most of the time. In Python 3 though, renames will be a bit overzealous if your loop variable shadows a name in the surrounding scope. We can fix the scoping issue later on. |
Issue found with renaming a variable within a generator expression. Exception thrown is:
RefactoringError: Rename refactoring should be performed on resolvable python identifiers.
Python version: 3.6.6
OS: Ubuntu 18.04
Rope Version: 0.10.7
Reproduction Steps
project
cd project
> python renamer.py
Expected result
A printout of the
issue.py
file's contents, with the 2 instances of the 'countervariable renamed to
valid_count`.Observed result
Thrown exception:
The text was updated successfully, but these errors were encountered: