microsoft / qsharp-compiler

Q# compiler, command line tool, and Q# language server
https://docs.microsoft.com/quantum
MIT License
682 stars 171 forks source link

Q# Code Actions in Visual Studio Code are not included as "Quick Fixes" #1268

Open guenp opened 2 years ago

guenp commented 2 years ago

Describe the bug

Code actions do not work. When hovering over a code warning, the pop up says "no fixes available".

Screenshot 2021-11-23 100314

The following error is displayed in the logs:

[2021-11-23 09:09:58.889] [exthost] [warning] quantum.quantum-devkit-vscode - Code actions of kind 'quickfix 'requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.

To Reproduce

Create a new file with the following contents and hover over "using":

namespace Qrng {
    open Microsoft.Quantum.Intrinsic;
    open Microsoft.Quantum.Canon;

    operation Name(target : Qubit) : Unit
    is Adj + Ctl {
        using q = Qubit() {
            foo bar baz;
        }
    }

}

Expected behavior

I expect to see a light bulb with a code action drop down.

System information

Additional context

This issue was also seen on the previous version v0.20.2110

ricardo-espinoza commented 2 years ago

After some investigation and debugging our different setups, we concluded that the issue is not that code actions are not available (they are, as light bulb suggestions when clicking on them or when using ctrl+.), however, there are two problems:

We're repurposing this issue to address the latter.