Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding nested Tag renames parent closing element #338

Closed
Mrxx99 opened this issue Jun 9, 2023 · 2 comments · Fixed by #344
Closed

Adding nested Tag renames parent closing element #338

Mrxx99 opened this issue Jun 9, 2023 · 2 comments · Fixed by #344
Labels

Comments

@Mrxx99
Copy link

Mrxx99 commented Jun 9, 2023

Describe the bug

When typing a nested Tag like <UserControl.Styles> it renames the closing Tag of the parent UserControl instead of leaving this intact and adding it's own closing tag like for other not nested Tags (e.g. a Control).
This is pretty annoying and breaks the flow of typing.

To Reproduce

  1. Open a UserControl
  2. Inside type character by character (not copy-paste): <UserControl.Styles>

Observe how the parent UserControl tag gets renamed and the file invalid.

AvaloniaVS_AddNestedTag

AvaloniaVS plugin version

0.10.18.3

Avalonia version

11.0.0-rc1.1

Visual Studio version

17.7.0 Preview 1.0 & 17.5.4

Relevant log output

19:21:02.428 [Error] 19516 UpdateXamlResult error
System.Xaml.XamlException: 'Name cannot begin with the '
' character, hexadecimal value 0x0D. Line 10, position 4.' Line number '10' and line position '4'.
19:21:03.161 [Error] 19516 UpdateXamlResult error
System.Xaml.XamlException: 'Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 12, position 3.' Line number '12' and line position '3'.
19:21:04.115 [Error] 19516 UpdateXamlResult error
System.Xaml.XamlException: 'Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 12, position 3.' Line number '12' and line position '3'.
19:21:04.943 [Error] 19516 UpdateXamlResult error
System.Xaml.XamlException: 'Name cannot begin with the '<' character, hexadecimal value 0x3C. Line 12, position 3.' Line number '12' and line position '3'.
19:21:05.382 [Error] 19516 UpdateXamlResult error
System.Xaml.XamlException: 'Unexpected end of file has occurred. The following elements are not closed: UserControl. Line 14, position 1.' Line number '14' and line position '1'.

Additional context

Note: this does only happen with the Avalonia extension installed, without it, the default XML editor used than behaves correctly.

@Mrxx99 Mrxx99 added the bug label Jun 9, 2023
@workgroupengineering
Copy link
Contributor

Can you try PR #340. The artifcat is here.

@Mrxx99
Copy link
Author

Mrxx99 commented Jun 13, 2023

@workgroupengineering Tried the PR. It did improve it in some way but it still can happen. It seem if you type slowly it still happen, but if you accept the suggestion fast it does not:

AvaloniaVS_AddNestedTag_notfix

maxkatz6 added a commit that referenced this issue Jun 15, 2023
fix(Manupilation): Adding nested Tag renames parent closing element #338
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants