Razor editor - adding await adds async keyword has erroneous behaviour
This issue has been moved from a ticket on Developer Community.
[severity:It's more difficult to complete my work]
Current Behaviour
When writing async event handlers in .razor components, adding the await keyword in the method body triggers Intellisense to add the async keyword to the method declaration (which is excellent!) but has two bugs I've seen when doing this.
Sometimes after adding async, the editing cursor is left in the in the method declaration. This requires me to manually reposition the cursor back after the await. More frequently I continue to write the code in the wrong place, resulting in more work to undo and fix.
On other occasions the async is added correctly and the cursor is returned to the original line, but the await is now corrupted to read awaitwait.
Expected Behaviour:
In regular .cs files, a method with a Task return type, when await is added to the method body, the same operation adds async to the method declaration, and returns to the editing position after
Original Comments
Feedback Bot on 2/5/2024, 05:04 PM:
(private comment, text removed)
Feedback Bot on 2/8/2024, 02:41 PM:
(private comment, text removed)
Alex Gavrilov [MSFT] on 2/11/2024, 09:17 PM:
(private comment, text removed)
Original Solutions
(no solutions)