Visual Studio Code is never able to populate the 'Quick Fix' contextual drop down, only displaying 'No Code Actions Available'
Python extension is installed, along with python3.7.3 and flake8, pep8.
Visual Studio Code is never able to populate the 'Quick Fix' contextual drop down, only displaying 'No Code Actions Available'
Python extension is installed, along with python3.7.3 and flake8, pep8.
The Python extension for VS Code currently doesn't offer any quick fixes.
Solution for 2021.
I got the same issue with Python for VSCode 1.54.2.
I solved it by installing the Pylance extension and making it the default Python language server (a message should pop up just after the installation asking if you want to make it the default Python language server). Now everything works flawlessly.
Python extension started to support Quick Fix. First, function adding imports is supported.
Python in Visual Studio Code – November 2019 Release | Python
Python extension ver.2020.1.58038
and 2020.1.57204
have bug that it doesn't display Quick Fix.
If you haven't install Python extension, install it once.
2.Install ver.2019.11.50794
or 2019.11.49689
by following steps in below answer.
vs code - rollback extension/install specific extension version - Stack Overflow
Install Visual Studio Code - Insiders.
Download Visual Studio Code Insiders
2.Install Python extension once, then click [Reload Required] button.
3.Open Settings editor. (Ctrl + ,)
4.Search by keyword: "Insiders Channel", then change pulldown to "daily" or "weekly", and save Settings. Then, Visual Studio Code start to download Insider version of Python extension. (Below status bar displays progress)
5.When popup message "Please reload Visual Studio Code to use the insiders build of the Python extension." is displayed, click [Reload] button.
Don't forget that there are two requirement to use Quick Fix feature.
Set python.jediEnabled
to false in your settings.json file.
Open Command Palette. (View > Command Palette... or F1 or Ctrl + Shift + P)
2.Run "Python: Enable Linting" command.
3.Select "On" in the drop-down menu.
I also recently tried the Sourcery VSCode Python Refactoring Extension to provide more refactorings that helps eliminate the errors in some cases implementing the line in question more clearly.
Having spent ages reading many articles on this, I've slightly improved my position. The right mouse button never comes up with anything, but I can press Ctrl + a full stop (period if you're in the US) to bring up suggested imports - sometimes.
I have Pylance installed in VS Code (so do you probably), which should be the default linter, but just in case I forced this in VS Code Settings:
// Defines type of the language server (should default to Pylance if installed anyway)
"python.languageServer": "Pylance",
The comments are mine. But then I read the notes on PyLance, and it seems you have to enable this setting by adding these lines:
// Offer auto-import completions.
"python.analysis.autoImportCompletions": true,
Having said all of this, the feature has now stopped working again! I've left this in just in case a) it gives anyone any ideas or b) I get it working again and can come back to edit this answer.
For import quick fixes, there is a solution.
Use the following VsCode Extension which work just as expected.
https://marketplace.visualstudio.com/items?itemName=Bar.python-import-helper