Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code quick fix always give "no code actions available"

Tags:

VS Code with Go, the quick fix always give "no code actions available". No matter what's the error or warning, no fix is given.

enter image description here

Is this my config/environment problem or is it a vscode bug/expected? Any help will be highly appreciated!

like image 544
Dan Avatar asked Mar 29 '19 08:03

Dan


3 Answers

I have the same problem when using the mouse to select a quick fix.
Instead of using the mouse use hot key, it works on win10:

  1. Place the cursor on the error.
  2. Press Ctrl + .
  3. Use the keyboard to select your fix.
like image 186
Vic Yu Avatar answered Sep 23 '22 04:09

Vic Yu


I had the same problem but with C# project and the Omnisharp extension (C# v1.24.0).

VsCode didn't resolve the namespaces, but instead showed the "No code actions available". After some time I stumbled across this GitHub issue https://github.com/OmniSharp/omnisharp-vscode/issues/5029.

After changing the Omnisharp settings via extension settings menu and setting the value

"omnisharp.path": "latest",

I restarted my Omnisharp extension and it finally started giving me proper quick fixes.

like image 42
Hellaren Avatar answered Sep 19 '22 04:09

Hellaren


I have restarted the VS Code and the problem has gone.

like image 4
Denis Avatar answered Sep 22 '22 04:09

Denis