Dan
Dan

Reputation: 1078

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

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!

Upvotes: 35

Views: 50337

Answers (10)

Pedro Contipelli
Pedro Contipelli

Reputation: 387

VSCode C# Omnisharp - I have no idea how, but THIS FIX WORKED FOR ME

Upvotes: 0

Delphoenyx
Delphoenyx

Reputation: 39

For me, it was that Omnisharp: Use Modern Net was set to false. It needs to be set to true.

I set it to false in the past to be compatible with an older version of Unity. Now that I am using a newer version of Unity, I installed the Visual Studio Code Editor package in Unity and set the above option to true. That solved the issue after restarting Omnisharp.

Upvotes: 1

Rebwar
Rebwar

Reputation: 413

I have this issue and by clicking on the extension panel I see the text shown in front of Omnisharp C# that says reload and this issue has been fixed by clicking on this text, maybe you have more than an extension for the language you code with , if it's doesn't work uninstall one of them and you see this work

Upvotes: 0

Matias Vallejos
Matias Vallejos

Reputation: 1

Please run visual studio code as Administrator. For more information check your Output Console. It happen because one of running programs block your omnisharp and it didn't work!

Upvotes: 0

Hellaren
Hellaren

Reputation: 467

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.

Upvotes: 10

ItayB
ItayB

Reputation: 11337

In my Python project I solved it by switching to the right python interpreter (I'm using a different virtual environment for every project.

I clicked on the python button (bottom of VS Code UI) and set the proper path within my /path/to/my/project/venv/bin/python:

enter image description here

Now when I'm using the shortcuts I'm able to Add import <some_import>, for example:

enter image description here

My VS Code version: 1.52.1

Upvotes: 0

Sapakus
Sapakus

Reputation: 1

Make sure you dont have a badly formatted or empty .sln file.

Upvotes: -6

Denis
Denis

Reputation: 383

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

Upvotes: 5

Fiaz Ahmed Ranjha
Fiaz Ahmed Ranjha

Reputation: 253

in my case this was due to duplicate line number in my js file. removing the duplicate line numbers worked for me.

Upvotes: 0

Vic Yu
Vic Yu

Reputation: 185

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.

Upvotes: 16

Related Questions