Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vscode "no refactorings available" for python

Ctrl + alt + R for extension python.python 2020.1.58038 always gives me a "No refactorings available" message.

Probably a configuration issue but I've tried several times to uninstall/reinstall and restart vs code to no avail.

Thought maybe I was missing python-rope but python -m pip install --upgrade rope Requirement already up-to-date: rope in c:\users\cdoyle\appdata\roaming\python\python37\site-packages (0.16.0)

VS Code Version info : Version: 1.42.0 (user setup) Commit: ae08d5460b5a45169385ff3fd44208f431992451 Date: 2020-02-06T10:51:34.058Z Electron: 6.1.6 Chrome: 76.0.3809.146 Node.js: 12.4.0 V8: 7.6.303.31-electron.0 OS: Windows_NT x64 10.0.18362

Also I don't see any open issues https://github.com/Microsoft/vscode-python/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+refactoring

Not sure what to try next.

Thanks

like image 298
ciaran Avatar asked Feb 07 '20 12:02

ciaran


People also ask

Why does VS Code not recognize Python?

In VS Code, open the Settings with (Ctrl+,) then search settings for "Interpreter." There will an option for "Python: Default Interpreter Path." Set the location of your python.exe file. Open a new VS terminal with (Ctrl+Shift+`) to test the python command; you may need to restart VS Code.

How do I install Python extensions in Visual Studio Code?

Install Python and the Python extension# For a quick install, use Python from python.org and install the extension from the VS Code Marketplace. Once you have a version of Python installed, activate it using the Python: Select Interpreter command.


Video Answer


1 Answers

I'm new to programming Python in VS Code and ran into the same problem. I successfully used the "Rename Symbol" command to rename a function and update all its references. More detail at https://code.visualstudio.com/docs/editor/refactoring . Hope this helps!

like image 192
jein Avatar answered Sep 17 '22 21:09

jein