You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Unexpected behavior when commenting out code in AXAML file. #203
I have a simple view with a Button nested inside a StackPanel. When I select only the starting element of the StackPanel and execute the Comment Selection command via either Ctrl+K, Ctrl+C or by Edit | Advanced | Comment Selection, the entire StackPanel with all the nested content is selected.
This behavior differs from VS 2026 with a WPF project and is undesirable.
To Reproduce
Create an Avalonia UserControl and add a StackPanel control to the xml with a nested Button inside the StackPanel.
Swipe across the opening element of the StackPanel to select the opening bracket to the closing bracket at the end of the same line.
Comment the selection.
Notice that the ending xml comment is placed at the end of the StackPanel's end tag rather than at the end of the selection.
See the attached screenshot below.
If I then select the Button element and uncomment it the markup becomes littered with start and end comment tags. This is not the desired behavior.
You can never do wrong by doing what the user requested. If that is not what they wanted, then it is their fault, not yours!
Thanks,
Rick B
Product(s)
Avalonia for Visual Studio
Platform
Windows
License Tier
Community
Avalonia version
No response
Tool/Control Version
Avalonia for Visual Studio extension version 12.3.2.0
Relevant log output
Additional context
Notice that only text on line 9 is selected, but the end comment is added at the end of line 13.
Activity
mrlacey commentedon Oct 1, 2026
Good find. This isn't behaving as it should.
It will be fixed in the next release.