AvaloniaUI / AvaloniaVS

Visual Studio Extension for Avalonia
MIT License
421 stars 81 forks source link

TextBlock/Run Formatter problem #428

Open strangerinla opened 9 months ago

strangerinla commented 9 months ago

There are also formatter problems: It formats the string <Run Text="123"/><Run Text="456"/> into separate lines which results in extra space between runs in output. It would also be cool to have hyperlink.

Originally posted by @strangerinla in https://github.com/AvaloniaUI/AvaloniaVS/discussions/417#discussioncomment-7586629

How to repeat this:

  1. Create TextBlock wtih several <Run> elements in single line

  2. Build and run the project - TextBlock displays concatenation of Runs' text properties. No space between texts. изображение

  3. Execute "Format Document" command on axaml file edited in step 1 - <Run> controls split in different lines

  4. Build and run the project - TextBlock content differs from step 2: text properties are separated by space изображение

The key problem here is the formatter logic. Row <Run/><Run/> should not be formatted as <Run/>\n<Run/> as it produces different output result.

maxkatz6 commented 9 months ago

I don't think we provide any formatting tools build-in the plugin.

maxkatz6 commented 9 months ago

Probably Visual Studio tries to force its own XML formatted here