microsoft / qsharp

Azure Quantum Development Kit, including the Q# programming language, resource estimator, and Quantum Katas
https://microsoft.github.io/qsharp/
MIT License
423 stars 86 forks source link

Language Server: Add Local Kind to Hover Card for Locals #650

Open ScottCarda-MS opened 1 year ago

ScottCarda-MS commented 1 year ago

It would be a nice to add a little more information to the hover cards for locals, by way of adding the appropriate declaration keyword to the the local's hover card. i.e. let, mutable, use, borrow and nothing for for-loop iterators.

This needs looking into to see how this can be done and further design considerations.

ScottCarda-MS commented 1 year ago

One issue with this come from the HIR pass to remove use statements and sanitize all qubit declarations to use immutable let bindings. This can make it difficult to distinguish between use and borrow for qubit references, and use and let for qubit alias declarations (use q = Qubit; let w = q;).