qsharp-compiler icon indicating copy to clipboard operation
qsharp-compiler copied to clipboard

Q# Code Action on adding documentation for operation is broken for @EntryPoint() decorated ones

Open ricardo-espinoza opened this issue 4 years ago • 2 comments

Describe the bug

In both Visual Studio and Visual Studio Code, there is a CodeAction that suggests adding documentation to Q# operations. This action becomes unavailable when the corresponding operation is decorated with @EntryPoint().

To Reproduce

  1. Start from a Q# project with a code file with contents as shown below.
  2. Select the operation name.
  3. Invoke Code Actions through the corresponding IDE (VS or VS Code).
  4. Observe if a code action is recommended.

Expected behavior

A code action indicating "Add documentation for..." should be shown to the user.

This repro goes away if the @EntryPoint() decorator is removed.

System information

  • This reproes on QDK since at least 0.15.2103.133969 (released on March 30th, 2021).
  • Using Windows 10 (19043.1288) and .NET 3.1.20
  • VS 16.11.5 and VSC 1.61.2

Sample Q# File

namespace vscp {

    open Microsoft.Quantum.Canon;
    open Microsoft.Quantum.Intrinsic;
    
    @EntryPoint()
    operation SayHello() : Unit {
        Message("Hello quantum world!");
    }
}

ricardo-espinoza avatar Oct 26 '21 01:10 ricardo-espinoza

It looks like code actions are also not working for operations without the @EntryPoint() decorator: Screenshot 2021-11-22 121045

guenp avatar Nov 22 '21 20:11 guenp

Opened a new issue here for the issue I mentioned above: https://github.com/microsoft/qsharp-compiler/issues/1268

guenp avatar Nov 24 '21 18:11 guenp