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
Rename symbol failed to work, only showing "No result" notification #1069
Comments
Thanks for the report. Will investigate the problem |
I have the same issue. In addition, when I try using "Find All References" on a function, I initially get "No results." in the "References" sidebar. When I run it again, it works. I am guessing that these two issues are related. |
I experienced the exact same issue on my system. It seems that server stopped working in recent versions of vscode, at least for me. |
This appears to be a bug in the core Python extension. It is not forwarding the "onRenameRequest" call to Pylance. The problem doesn't occur in Pyright or in the debug version of Pylance that uses its own minimal client. |
Same issue with both renaming (variables/functions/methods/classes/...) and following references and similar. It does not happen consistently, but still most of the time (on the first try). As a workaround at the moment, I can usually do the action again and it works (i.e. renaming a variable on the second try mostly works; when following a reference, hitting F12 also mostly works on the second try). |
See microsoft/vscode-python#15727; this will be fixed in the core extension. |
This is now fixed in the core extension (v2021.3.680753044). |
Did this get re-broken? I have |
@judej we probably want to tell users why rename failed rather than just showing "No Result" |
@WORMSS can you open new issue and provide us repro steps for your "no result" issue? unless repro is same as one in this issue's description. |
Exactly the same steps as above. Just pressing F2 on a "variable" / "function" etc etc. |
@WORMSS can you provide us a log or some screencast? I just tried and it worked as expected. |
Just as a data point here: As a complete newbie to vscode, I have been experiencing this issue on latest release both on Python and TypeScript which is what brought me to this issue. |
I'm having this issue in vscode jupyter, but works fine when editing regular python. |
I was also seeing this problem: I checked my python extensions and found Python and Pylance Uninstalling Pylance seems to have fixed it. |
Thank you. I uinstalled Pylance, used JEDI as language server then re-installed Pylance and reverted back to Pylance. That made it work. Using WLS. |
Reinstall extension Pylance and it will work |
Reinstalling Pylance did not work for me, and none other solution too |
Please open a new issue with the requested details, and we can take a look at it. It's unlikely that it's related to this issue, which has been fixed and closed for a long time. |
@erictraut Actually i found this almost impossible to reproduce intentionally. It just works sometimes, and sometimes doesn't. If I keep Pylance disabled. Everything works fine. But with it enabled. Things are just unpredictable. It happens randomly which is even more disturbing. |
I've had this issue as well. uninstalling or disabling pylance has no effect for me. |
Some variables can't be renamed by F2 when you call them "table" in example, try "table_something" then you will can change it |
Still getting the issue with pylance. Tried switching to Jedi and the refactor worked as expected. Here's what I tried:
|
@renjujv check if your variables isn't called like "table" "list" etc |
@OchotaDariusz I tried for multiple variables with different names. Some of the names which I tried to refactor were 'image_name', 'response_json' e.t.c Also checked with a variable without underscore character to confirm that the issue is not caused due to symbols. No luck. For any refactor, I'm getting the same error - |
Same issue here with python extension |
Same version here but it is working again. I just had to press "reload" button next to the extension symbol. Update - Well, I thought it was fixed but it seem to work only part of the times. |
I seem to have the same issue, but the prompt looks like |
Same issue, the notification I'm getting says VSCode v1.65.2 with following extension:
|
Still broken, should be re-opened. |
@aws-stdun, please open a new issue and we can take a look at it. It's unlikely that it's related to this issue, which has been fixed and closed for a long time. |
I am also having issues when using both Microsoft python extension and pylance. Without the latter, my code autocompletion becomes buggy, however, when using pylance as the language server, renaming symbol would fail to change all references and this become hugely inconvenient for refactoring. My current workaround is to change language server to Jedi, but yet to know if additional conflicts would occur. Would love to see if others have similar problems and how it gets resolved. |
Please create a new issue and provide details on how to reproduce. In the past there has been issues related to "open file vs open folder" modes and multiple workspaces. |
Environment data
python.languageServer
setting: Pylance[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
After clicking F2 and giving a new name to a local variable, all related symbols should change to the new name.
Actual behaviour
After clicking F2 and giving a new name to a local variable, only a "No result" notification showed up in the bottom right. Strangely, doing this a second time will succeed. This function also worked without problem in the previous version v2021.2.636928669.
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
main.py
and define the following function:Use VSCode to open the folder and click on the file.
Click on variable
x
and press button F2, rename it toy
. This will fail.Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: