Xavalon / XamlStyler

Visual Studio extension to help format your XAML source code
Apache License 2.0
1.21k stars 130 forks source link

Add support for avalonia (.axaml files) #321

Closed chkr1011 closed 2 years ago

chkr1011 commented 3 years ago

Description:

Fixes #320, #300

Add .axaml files to the document type checking.

Checklist:

grochocki commented 3 years ago

Thanks for the PR! There are some implementation details about how we want to approach .axaml file support in #300. Would it be possible to update your PR with those changes?

chkr1011 commented 3 years ago

@grochocki Sure I will update the PR. From what I read the only currently important thing is that the "Selector" attribute should allow the character ">". If there is more to it please let me know.

I will add some "LanguageContext" which will contain information about these escaping stuff per supported language/framework like described in #302.

chkr1011 commented 3 years ago

@grochocki I added the ability to get some XAML dialect specific options when checking the affected file. Now the > is no longer escaped when an Avalonia file is formatted. I still need to refactor the code a bit but let me know if this is the right way in general.

Nickelony commented 3 years ago

Is this still being worked on?

Mikolaytis commented 3 years ago

any update on a PR? We are really need an avalonia support!

Mikolaytis commented 3 years ago

XamlStyler.Extension.Windows.vsix.zip here is VS2019 build of this fork. I've tried. it works. I'm happy now

also here is VS2022 revision: XamlStyler.Extension.Windows.VS2022.vsix.zip

chkr1011 commented 3 years ago

I am basically done with my work. I am still waiting for feedback regarding code style etc.

NicoVermeir commented 2 years ago

@maxkatz6 thanks for helping the review from the Avaolonia side of things, greatly appreciated! @chkr1011 sorry for the (very) long wait, we have looked over your PR and it looks good! just 2 things:

thanks again for your contribution! I'm confident we can merge this in fast

chkr1011 commented 2 years ago

Sure thing. Please give me a couple of days to do so...

chkr1011 commented 2 years ago

I added a UnitTests for Avalonia axaml files. Not I still have to test it in VS2022...

chkr1011 commented 2 years ago

It also works perfectly in VS2022.

chkr1011 commented 2 years ago

I fixed the build errors but I have no clue how to fix the Rider Plugin build.

chkr1011 commented 2 years ago

@NicoVermeir Is there something missing from my side?

NicoVermeir commented 2 years ago

@chkr1011 yes, you've added a new parameter to StylerService. That parameter was missing in the Rider extension. I've added it into my own branch but couldn't figure out how to get my change into your PR.. https://github.com/Xavalon/XamlStyler/pull/369

chkr1011 commented 2 years ago

OK then I will do it manually.

chkr1011 commented 2 years ago

@NicoVermeir Now it works 😄

grochocki commented 2 years ago

Thanks, @chkr1011! 👍

waliarubal commented 2 years ago

The official update does not seem to be working with latest Visual Studio 2022 with Avalonia extension.

I downloaded the version attached to this PR, it works. Seems like current official version is broken.

grochocki commented 2 years ago

@omnjpa27516 Update with this change should now be available for VS2017, VS2019, and VS2022 with version 3.2208.1.