qsharp-compiler
qsharp-compiler copied to clipboard
Q# Code Action on adding documentation for operation is broken for @EntryPoint() decorated ones
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
- Start from a Q# project with a code file with contents as shown below.
- Select the operation name.
- Invoke Code Actions through the corresponding IDE (VS or VS Code).
- 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!");
}
}
It looks like code actions are also not working for operations without the @EntryPoint() decorator:

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