Razor editor - adding await adds async keyword has erroneous behaviour #9942
Labels
author: migration bot 🤖
The issue was created by a issue mover bot. The author may not be the actual author
Milestone
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 theawait
keyword in the method body triggers Intellisense to add theasync
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 theawait
. 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 theawait
is now corrupted to readawaitwait
.Expected Behaviour:
In regular
.cs
files, a method with aTask
return type, whenawait
is added to the method body, the same operation addsasync
to the method declaration, and returns to the editing position afterOriginal 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)
The text was updated successfully, but these errors were encountered: